Merge pull request #4246 from leoetlino/in-class-init

In-class initialise member variables
This commit is contained in:
Mat M 2016-09-25 16:53:46 -04:00 committed by GitHub
commit e7efbf7ae5
10 changed files with 87 additions and 105 deletions

View File

@ -33,7 +33,6 @@
namespace Common namespace Common
{ {
#if !defined(_WIN32) #if !defined(_WIN32)
#include <unistd.h> #include <unistd.h>
static uintptr_t RoundPage(uintptr_t addr) static uintptr_t RoundPage(uintptr_t addr)

View File

@ -9,7 +9,6 @@
namespace Common namespace Common
{ {
void* AllocateExecutableMemory(size_t size, bool low = true); void* AllocateExecutableMemory(size_t size, bool low = true);
void* AllocateMemoryPages(size_t size); void* AllocateMemoryPages(size_t size);
void FreeMemoryPages(void* ptr, size_t size); void FreeMemoryPages(void* ptr, size_t size);

View File

@ -17,7 +17,7 @@
#include "Core/Movie.h" #include "Core/Movie.h"
SysConf::SysConf() : m_IsValid(false) SysConf::SysConf()
{ {
UpdateLocation(); UpdateLocation();
} }

View File

@ -182,5 +182,5 @@ private:
std::string m_Filename; std::string m_Filename;
std::string m_FilenameDefault; std::string m_FilenameDefault;
std::vector<SSysConfEntry> m_Entries; std::vector<SSysConfEntry> m_Entries;
bool m_IsValid; bool m_IsValid = false;
}; };

View File

@ -27,24 +27,6 @@
SConfig* SConfig::m_Instance; SConfig* SConfig::m_Instance;
SConfig::SConfig() SConfig::SConfig()
: bEnableDebugging(false), bAutomaticStart(false), bBootToPause(false), bJITNoBlockCache(false),
bJITNoBlockLinking(false), bJITOff(false), bJITLoadStoreOff(false),
bJITLoadStorelXzOff(false), bJITLoadStorelwzOff(false), bJITLoadStorelbzxOff(false),
bJITLoadStoreFloatingOff(false), bJITLoadStorePairedOff(false), bJITFloatingPointOff(false),
bJITIntegerOff(false), bJITPairedOff(false), bJITSystemRegistersOff(false),
bJITBranchOff(false), bJITILTimeProfiling(false), bJITILOutputIR(false), bFPRF(false),
bAccurateNaNs(false), iTimingVariance(40), bCPUThread(true), bDSPThread(false), bDSPHLE(true),
bSkipIdle(true), bSyncGPUOnSkipIdleHack(true), bNTSC(false), bForceNTSCJ(false),
bHLE_BS2(true), bEnableCheats(false), bEnableMemcardSdWriting(true), bDPL2Decoder(false),
iLatency(14), bRunCompareServer(false), bRunCompareClient(false), bMMU(false),
bDCBZOFF(false), iBBDumpPort(0), bFastDiscSpeed(false), bSyncGPU(false), SelectedLanguage(0),
bOverrideGCLanguage(false), bWii(false), bConfirmStop(false), bHideCursor(false),
bAutoHideCursor(false), bUsePanicHandlers(true), bOnScreenDisplayMessages(true),
iRenderWindowXPos(-1), iRenderWindowYPos(-1), iRenderWindowWidth(640),
iRenderWindowHeight(480), bRenderWindowAutoSize(false), bKeepWindowOnTop(false),
bFullscreen(false), bRenderToMain(false), bProgressive(false), bPAL60(false),
bDisableScreenSaver(false), iPosX(100), iPosY(100), iWidth(800), iHeight(600),
m_analytics_enabled(false), m_analytics_permission_asked(false), bLoopFifoReplay(true)
{ {
LoadDefaults(); LoadDefaults();
// Make sure we have log manager // Make sure we have log manager

View File

@ -53,91 +53,98 @@ struct SConfig : NonCopyable
bool m_RecursiveISOFolder; bool m_RecursiveISOFolder;
// Settings // Settings
bool bEnableDebugging; bool bEnableDebugging = false;
#ifdef USE_GDBSTUB #ifdef USE_GDBSTUB
int iGDBPort; int iGDBPort;
#ifndef _WIN32 #ifndef _WIN32
std::string gdb_socket; std::string gdb_socket;
#endif #endif
#endif #endif
bool bAutomaticStart; bool bAutomaticStart = false;
bool bBootToPause; bool bBootToPause = false;
int iCPUCore; int iCPUCore;
// JIT (shared between JIT and JITIL) // JIT (shared between JIT and JITIL)
bool bJITNoBlockCache, bJITNoBlockLinking; bool bJITNoBlockCache = false;
bool bJITOff; bool bJITNoBlockLinking = false;
bool bJITLoadStoreOff, bJITLoadStorelXzOff, bJITLoadStorelwzOff, bJITLoadStorelbzxOff; bool bJITOff = false;
bool bJITLoadStoreFloatingOff; bool bJITLoadStoreOff = false;
bool bJITLoadStorePairedOff; bool bJITLoadStorelXzOff = false;
bool bJITFloatingPointOff; bool bJITLoadStorelwzOff = false;
bool bJITIntegerOff; bool bJITLoadStorelbzxOff = false;
bool bJITPairedOff; bool bJITLoadStoreFloatingOff = false;
bool bJITSystemRegistersOff; bool bJITLoadStorePairedOff = false;
bool bJITBranchOff; bool bJITFloatingPointOff = false;
bool bJITILTimeProfiling; bool bJITIntegerOff = false;
bool bJITILOutputIR; bool bJITPairedOff = false;
bool bJITSystemRegistersOff = false;
bool bJITBranchOff = false;
bool bJITILTimeProfiling = false;
bool bJITILOutputIR = false;
bool bFastmem; bool bFastmem;
bool bFPRF; bool bFPRF = false;
bool bAccurateNaNs; bool bAccurateNaNs = false;
int iTimingVariance; // in milli secounds int iTimingVariance = 40; // in milli secounds
bool bCPUThread; bool bCPUThread = true;
bool bDSPThread; bool bDSPThread = false;
bool bDSPHLE; bool bDSPHLE = true;
bool bSkipIdle; bool bSkipIdle = true;
bool bSyncGPUOnSkipIdleHack; bool bSyncGPUOnSkipIdleHack = true;
bool bNTSC; bool bNTSC = false;
bool bForceNTSCJ; bool bForceNTSCJ = false;
bool bHLE_BS2; bool bHLE_BS2 = true;
bool bEnableCheats; bool bEnableCheats = false;
bool bEnableMemcardSdWriting; bool bEnableMemcardSdWriting = true;
bool bDPL2Decoder; bool bDPL2Decoder = false;
int iLatency; int iLatency = 14;
bool bRunCompareServer; bool bRunCompareServer = false;
bool bRunCompareClient; bool bRunCompareClient = false;
bool bMMU; bool bMMU = false;
bool bDCBZOFF; bool bDCBZOFF = false;
int iBBDumpPort; int iBBDumpPort = 0;
bool bFastDiscSpeed; bool bFastDiscSpeed = false;
bool bSyncGPU; bool bSyncGPU = false;
int iSyncGpuMaxDistance; int iSyncGpuMaxDistance;
int iSyncGpuMinDistance; int iSyncGpuMinDistance;
float fSyncGpuOverclock; float fSyncGpuOverclock;
int SelectedLanguage; int SelectedLanguage = 0;
bool bOverrideGCLanguage; bool bOverrideGCLanguage = false;
bool bWii; bool bWii = false;
// Interface settings // Interface settings
bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers, bOnScreenDisplayMessages; bool bConfirmStop = false;
bool bHideCursor = false, bAutoHideCursor = false;
bool bUsePanicHandlers = true;
bool bOnScreenDisplayMessages = true;
std::string theme_name; std::string theme_name;
// Display settings // Display settings
std::string strFullscreenResolution; std::string strFullscreenResolution;
int iRenderWindowXPos, iRenderWindowYPos; int iRenderWindowXPos = -1, iRenderWindowYPos = -1;
int iRenderWindowWidth, iRenderWindowHeight; int iRenderWindowWidth = 640, iRenderWindowHeight = 480;
bool bRenderWindowAutoSize, bKeepWindowOnTop; bool bRenderWindowAutoSize = false, bKeepWindowOnTop = false;
bool bFullscreen, bRenderToMain; bool bFullscreen = false, bRenderToMain = false;
bool bProgressive, bPAL60; bool bProgressive = false, bPAL60 = false;
bool bDisableScreenSaver; bool bDisableScreenSaver = false;
int iPosX, iPosY, iWidth, iHeight; int iPosX, iPosY, iWidth, iHeight;
// Analytics settings. // Analytics settings.
std::string m_analytics_id; std::string m_analytics_id;
bool m_analytics_enabled; bool m_analytics_enabled = false;
bool m_analytics_permission_asked; bool m_analytics_permission_asked = false;
// Fifo Player related settings // Fifo Player related settings
bool bLoopFifoReplay; bool bLoopFifoReplay = true;
// Custom RTC // Custom RTC
bool bEnableCustomRTC; bool bEnableCustomRTC;

View File

@ -61,8 +61,8 @@
std::string CWII_IPC_HLE_Device_es::m_ContentFile; std::string CWII_IPC_HLE_Device_es::m_ContentFile;
CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string& _rDeviceName) CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 device_id, const std::string& device_name)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName), m_TitleID(-1), m_AccessIdentID(0x6000000) : IWII_IPC_HLE_Device(device_id, device_name)
{ {
} }

View File

@ -132,8 +132,8 @@ private:
CContentAccessMap m_ContentAccessMap; CContentAccessMap m_ContentAccessMap;
std::vector<u64> m_TitleIDs; std::vector<u64> m_TitleIDs;
u64 m_TitleID; u64 m_TitleID = -1;
u32 m_AccessIdentID; u32 m_AccessIdentID = 0x6000000;
static u8* keyTable[11]; static u8* keyTable[11];

View File

@ -386,13 +386,8 @@ static BOOL WINAPI s_ctrl_handler(DWORD fdwCtrlType)
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos,
const wxSize& size, bool _UseDebugger, bool _BatchMode, bool ShowLogWindow, const wxSize& size, bool _UseDebugger, bool _BatchMode, bool ShowLogWindow,
long style) long style)
: CRenderFrame(parent, id, title, pos, size, style), g_pCodeWindow(nullptr), : CRenderFrame(parent, id, title, pos, size, style), UseDebugger(_UseDebugger),
g_NetPlaySetupDiag(nullptr), g_CheatsWindow(nullptr), m_SavedPerspectives(nullptr), m_bBatchMode(_BatchMode)
m_ToolBar(nullptr), m_GameListCtrl(nullptr), m_Panel(nullptr), m_RenderFrame(nullptr),
m_RenderParent(nullptr), m_LogWindow(nullptr), m_LogConfigWindow(nullptr),
m_FifoPlayerDlg(nullptr), UseDebugger(_UseDebugger), m_bBatchMode(_BatchMode), m_bEdit(false),
m_bTabSplit(false), m_bNoDocking(false), m_bGameLoading(false), m_bClosing(false),
m_confirmStop(false), m_menubar_shadow(nullptr)
{ {
for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++) for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++)
bFloatWindow[i] = false; bFloatWindow[i] = false;

View File

@ -79,9 +79,9 @@ public:
} }
// These have to be public // These have to be public
CCodeWindow* g_pCodeWindow; CCodeWindow* g_pCodeWindow = nullptr;
NetPlaySetupFrame* g_NetPlaySetupDiag; NetPlaySetupFrame* g_NetPlaySetupDiag = nullptr;
wxCheatsWindow* g_CheatsWindow; wxCheatsWindow* g_CheatsWindow = nullptr;
TASInputDlg* g_TASInputDlg[8]; TASInputDlg* g_TASInputDlg[8];
void InitBitmaps(); void InitBitmaps();
@ -123,11 +123,11 @@ public:
X11Utils::XRRConfiguration* m_XRRConfig; X11Utils::XRRConfiguration* m_XRRConfig;
#endif #endif
wxMenu* m_SavedPerspectives; wxMenu* m_SavedPerspectives = nullptr;
wxToolBar* m_ToolBar; wxToolBar* m_ToolBar = nullptr;
// AUI // AUI
wxAuiManager* m_Mgr; wxAuiManager* m_Mgr = nullptr;
bool bFloatWindow[IDM_CODE_WINDOW - IDM_LOG_WINDOW + 1]; bool bFloatWindow[IDM_CODE_WINDOW - IDM_LOG_WINDOW + 1];
// Perspectives (Should find a way to make all of this private) // Perspectives (Should find a way to make all of this private)
@ -143,21 +143,21 @@ public:
u32 ActivePerspective; u32 ActivePerspective;
private: private:
CGameListCtrl* m_GameListCtrl; CGameListCtrl* m_GameListCtrl = nullptr;
wxPanel* m_Panel; wxPanel* m_Panel = nullptr;
CRenderFrame* m_RenderFrame; CRenderFrame* m_RenderFrame = nullptr;
wxWindow* m_RenderParent; wxWindow* m_RenderParent = nullptr;
CLogWindow* m_LogWindow; CLogWindow* m_LogWindow = nullptr;
LogConfigWindow* m_LogConfigWindow; LogConfigWindow* m_LogConfigWindow = nullptr;
FifoPlayerDlg* m_FifoPlayerDlg; FifoPlayerDlg* m_FifoPlayerDlg = nullptr;
bool UseDebugger; bool UseDebugger = false;
bool m_bBatchMode; bool m_bBatchMode = false;
bool m_bEdit; bool m_bEdit = false;
bool m_bTabSplit; bool m_bTabSplit = false;
bool m_bNoDocking; bool m_bNoDocking = false;
bool m_bGameLoading; bool m_bGameLoading = false;
bool m_bClosing; bool m_bClosing = false;
bool m_confirmStop; bool m_confirmStop = false;
int m_saveSlot = 1; int m_saveSlot = 1;
std::vector<std::string> drives; std::vector<std::string> drives;
@ -191,7 +191,7 @@ private:
wxBitmap m_Bitmaps[EToolbar_Max]; wxBitmap m_Bitmaps[EToolbar_Max];
wxMenuBar* m_menubar_shadow; wxMenuBar* m_menubar_shadow = nullptr;
void PopulateToolbar(wxToolBar* toolBar); void PopulateToolbar(wxToolBar* toolBar);
void RecreateToolbar(); void RecreateToolbar();