IPC_HLE: In-class initialise member variables

This commit is contained in:
Léo Lam 2016-10-22 17:05:17 +02:00
parent 3263831928
commit f82051a365
6 changed files with 31 additions and 38 deletions

View File

@ -93,11 +93,9 @@ void HLE_IPC_CreateVirtualFATFilesystem()
} }
} }
CWII_IPC_HLE_Device_FileIO::CWII_IPC_HLE_Device_FileIO(u32 _DeviceID, CWII_IPC_HLE_Device_FileIO::CWII_IPC_HLE_Device_FileIO(u32 device_id,
const std::string& _rDeviceName) const std::string& device_name)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName, false) // not a real hardware : IWII_IPC_HLE_Device(device_id, device_name, false) // not a real hardware
,
m_Mode(0), m_SeekPos(0), m_file()
{ {
Common::ReadReplacements(replacements); Common::ReadReplacements(replacements);
} }

View File

@ -80,8 +80,8 @@ private:
ISFS_IOCTL_SHUTDOWN = 13 ISFS_IOCTL_SHUTDOWN = 13
}; };
u32 m_Mode; u32 m_Mode = 0;
u32 m_SeekPos; u32 m_SeekPos = 0;
std::string m_filepath; std::string m_filepath;
std::shared_ptr<File::IOFile> m_file; std::shared_ptr<File::IOFile> m_file;

View File

@ -17,10 +17,9 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h" #include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.h"
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(const u32 device_id,
const std::string& _rDeviceName) const std::string& device_name)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName), m_Status(CARD_NOT_EXIST), m_BlockLength(0), : IWII_IPC_HLE_Device(device_id, device_name)
m_BusWidth(0), m_Card(nullptr)
{ {
} }

View File

@ -19,7 +19,7 @@ class PointerWrap;
class CWII_IPC_HLE_Device_sdio_slot0 : public IWII_IPC_HLE_Device class CWII_IPC_HLE_Device_sdio_slot0 : public IWII_IPC_HLE_Device
{ {
public: public:
CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName); CWII_IPC_HLE_Device_sdio_slot0(u32 device_id, const std::string& device_name);
void DoState(PointerWrap& p) override; void DoState(PointerWrap& p) override;
@ -110,14 +110,13 @@ private:
// TODO do we need more than one? // TODO do we need more than one?
struct Event struct Event
{ {
EventType type; EventType type = EVENT_NONE;
u32 addr; u32 addr = 0;
Event() : type(EVENT_NONE), addr() {}
} m_event; } m_event;
u32 m_Status; u32 m_Status = CARD_NOT_EXIST;
u32 m_BlockLength; u32 m_BlockLength = 0;
u32 m_BusWidth; u32 m_BusWidth = 0;
std::array<u32, 0x200 / sizeof(u32)> m_registers; std::array<u32, 0x200 / sizeof(u32)> m_registers;

View File

@ -33,20 +33,17 @@ void SetUsbPointer(CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* ptr)
s_Usb = ptr; s_Usb = ptr;
} }
CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* _pHost, CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305_emu* host,
int _Number, bdaddr_t _BD, bool ready) int number, bdaddr_t bd, bool ready)
: m_HIDControlChannel_Connected(false), m_HIDControlChannel_ConnectedWait(false), : m_BD(bd),
m_HIDControlChannel_Config(false), m_HIDControlChannel_ConfigWait(false), m_Name(number == WIIMOTE_BALANCE_BOARD ? "Nintendo RVL-WBC-01" : "Nintendo RVL-CNT-01"),
m_HIDInterruptChannel_Connected(false), m_HIDInterruptChannel_ConnectedWait(false), m_pHost(host)
m_HIDInterruptChannel_Config(false), m_HIDInterruptChannel_ConfigWait(false), m_BD(_BD),
m_Name(_Number == WIIMOTE_BALANCE_BOARD ? "Nintendo RVL-WBC-01" : "Nintendo RVL-CNT-01"),
m_pHost(_pHost)
{ {
INFO_LOG(WII_IPC_WIIMOTE, "Wiimote: #%i Constructed", _Number); INFO_LOG(WII_IPC_WIIMOTE, "Wiimote: #%i Constructed", number);
m_ConnectionState = (ready) ? CONN_READY : CONN_INACTIVE; m_ConnectionState = (ready) ? CONN_READY : CONN_INACTIVE;
m_ConnectionHandle = 0x100 + _Number; m_ConnectionHandle = 0x100 + number;
memset(m_LinkKey, 0xA0 + _Number, HCI_KEY_SIZE); memset(m_LinkKey, 0xA0 + number, HCI_KEY_SIZE);
bdaddr_t _nullBD = BDADDR_ANY; bdaddr_t _nullBD = BDADDR_ANY;
if (memcmp(&m_BD, &_nullBD, sizeof(bdaddr_t)) == 0) if (memcmp(&m_BD, &_nullBD, sizeof(bdaddr_t)) == 0)
@ -56,7 +53,7 @@ CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305_e
m_BD.b[2] = 0x19; m_BD.b[2] = 0x19;
m_BD.b[3] = 0x79; m_BD.b[3] = 0x79;
m_BD.b[4] = 0x00; m_BD.b[4] = 0x00;
m_BD.b[5] = _Number; m_BD.b[5] = number;
} }
uclass[0] = 0x00; uclass[0] = 0x00;
uclass[1] = 0x04; uclass[1] = 0x04;

View File

@ -76,14 +76,14 @@ private:
}; };
ConnectionState m_ConnectionState; ConnectionState m_ConnectionState;
bool m_HIDControlChannel_Connected; bool m_HIDControlChannel_Connected = false;
bool m_HIDControlChannel_ConnectedWait; bool m_HIDControlChannel_ConnectedWait = false;
bool m_HIDControlChannel_Config; bool m_HIDControlChannel_Config = false;
bool m_HIDControlChannel_ConfigWait; bool m_HIDControlChannel_ConfigWait = false;
bool m_HIDInterruptChannel_Connected; bool m_HIDInterruptChannel_Connected = false;
bool m_HIDInterruptChannel_ConnectedWait; bool m_HIDInterruptChannel_ConnectedWait = false;
bool m_HIDInterruptChannel_Config; bool m_HIDInterruptChannel_Config = false;
bool m_HIDInterruptChannel_ConfigWait; bool m_HIDInterruptChannel_ConfigWait = false;
// STATE_TO_SAVE // STATE_TO_SAVE
bdaddr_t m_BD; bdaddr_t m_BD;