General: Apply the const specifier where applicable

This commit is contained in:
Lioncash committed 2015-04-15 02:04:03 -04:00
1 parent 7506c386cf
commit b0613bb1c8
39 files changed
+75 -75

No files matched your search

@@ -208,7 +208,7 @@ IPCCommandResult CWII_IPC_HLE_Device_net_kd_request::IOCtl(u32 _CommandAddress)
}
u8 CWII_IPC_HLE_Device_net_kd_request::GetAreaCode(const std::string& area)
u8 CWII_IPC_HLE_Device_net_kd_request::GetAreaCode(const std::string& area) const
{
static std::map<const std::string, u8> regions = {
{ "JPN", 0 }, { "USA", 1 }, { "EUR", 2 },
@@ -225,7 +225,7 @@ u8 CWII_IPC_HLE_Device_net_kd_request::GetAreaCode(const std::string& area)
return 7; // Unknown
}
u8 CWII_IPC_HLE_Device_net_kd_request::GetHardwareModel(const std::string& model)
u8 CWII_IPC_HLE_Device_net_kd_request::GetHardwareModel(const std::string& model) const
{
static std::map<const std::string, u8> models = {
{ "RVL", MODEL_RVL },
@@ -275,14 +275,14 @@ public:
return 0;
}
u32 Magic() {return Common::swap32(config.magic);}
void SetMagic(u32 magic) {config.magic = Common::swap32(magic);}
u32 Magic() const { return Common::swap32(config.magic); }
void SetMagic(u32 magic) { config.magic = Common::swap32(magic); }
u32 Unk() {return Common::swap32(config._unk_04);}
void SetUnk(u32 _unk_04) {config._unk_04 = Common::swap32(_unk_04);}
u32 Unk() const { return Common::swap32(config._unk_04); }
void SetUnk(u32 _unk_04) { config._unk_04 = Common::swap32(_unk_04); }
u32 IdGen() {return Common::swap32(config.id_generation);}
void SetIdGen(u32 id_generation) {config.id_generation = Common::swap32(id_generation);}
u32 IdGen() const { return Common::swap32(config.id_generation); }
void SetIdGen(u32 id_generation) { config.id_generation = Common::swap32(id_generation); }
void IncrementIdGen()
{
@@ -292,19 +292,19 @@ public:
SetIdGen(id_ctr);
}
u32 Checksum() {return Common::swap32(config.checksum);}
void SetChecksum(u32 checksum) {config.checksum = Common::swap32(checksum);}
u32 Checksum() const { return Common::swap32(config.checksum); }
void SetChecksum(u32 checksum) { config.checksum = Common::swap32(checksum); }
u32 CreationStage() {return Common::swap32(config.creation_stage);}
void SetCreationStage(u32 creation_stage) {config.creation_stage = Common::swap32(creation_stage);}
u32 CreationStage() const { return Common::swap32(config.creation_stage); }
void SetCreationStage(u32 creation_stage) { config.creation_stage = Common::swap32(creation_stage); }
u32 EnableBooting() {return Common::swap32(config.enable_booting);}
void SetEnableBooting(u32 enable_booting) {config.enable_booting = Common::swap32(enable_booting);}
u32 EnableBooting() const { return Common::swap32(config.enable_booting); }
void SetEnableBooting(u32 enable_booting) { config.enable_booting = Common::swap32(enable_booting); }
u64 Id() {return Common::swap64(config.nwc24_id);}
void SetId(u64 nwc24_id) {config.nwc24_id = Common::swap64(nwc24_id);}
u64 Id() const { return Common::swap64(config.nwc24_id); }
void SetId(u64 nwc24_id) { config.nwc24_id = Common::swap64(nwc24_id); }
const char* Email() {return config.email;}
const char* Email() const { return config.email; }
void SetEmail(const char* email)
{
strncpy(config.email, email, nwc24_config_t::MAX_EMAIL_LENGTH);
@@ -431,8 +431,8 @@ private:
MODEL_ELSE = 7
};
u8 GetAreaCode(const std::string& area);
u8 GetHardwareModel(const std::string& model);
u8 GetAreaCode(const std::string& area) const;
u8 GetHardwareModel(const std::string& model) const;
s32 NWC24MakeUserID(u64* nwc24_id, u32 hollywood_id, u16 id_ctr, u8 hardware_model, u8 area_code);
@@ -40,7 +40,7 @@ CWII_IPC_HLE_Device_net_ssl::~CWII_IPC_HLE_Device_net_ssl()
}
}
int CWII_IPC_HLE_Device_net_ssl::getSSLFreeID()
int CWII_IPC_HLE_Device_net_ssl::GetSSLFreeID() const
{
for (int i = 0; i < NET_SSL_MAXINSTANCES; i++)
{
@@ -134,7 +134,7 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtlV(u32 _CommandAddress)
int verifyOption = Memory::Read_U32(BufferOut);
std::string hostname = Memory::GetString(BufferOut2, BufferOutSize2);
int freeSSL = this->getSSLFreeID();
int freeSSL = GetSSLFreeID();
if (freeSSL)
{
int sslID = freeSSL - 1;
@@ -81,7 +81,7 @@ public:
virtual IPCCommandResult IOCtl(u32 _CommandAddress) override;
virtual IPCCommandResult IOCtlV(u32 _CommandAddress) override;
int getSSLFreeID();
int GetSSLFreeID() const;
static WII_SSL _SSL[NET_SSL_MAXINSTANCES];
};
@@ -21,9 +21,9 @@ class CBigEndianBuffer
public:
CBigEndianBuffer(u8* pBuffer) : m_pBuffer(pBuffer) {}
u8 Read8(u32 offset) { return m_pBuffer[offset]; }
u16 Read16(u32 offset) { return Common::swap16(*(u16*)&m_pBuffer[offset]); }
u32 Read32(u32 offset) { return Common::swap32(*(u32*)&m_pBuffer[offset]); }
u8 Read8(u32 offset) const { return m_pBuffer[offset]; }
u16 Read16(u32 offset) const { return Common::swap16(*(u16*)&m_pBuffer[offset]); }
u32 Read32(u32 offset) const { return Common::swap32(*(u32*)&m_pBuffer[offset]); }
void Write8(u32 offset, u8 data) { m_pBuffer[offset] = data; }
void Write16(u32 offset, u16 data) { *(u16*)&m_pBuffer[offset] = Common::swap16(data); }
+2 -2
View File
@@ -189,7 +189,7 @@ private:
void DoSock(u32 _CommandAddress, NET_IOCTL type);
void DoSock(u32 _CommandAddress, SSL_IOCTL type);
void Update(bool read, bool write, bool except);
bool IsValid() { return fd >= 0; }
bool IsValid() const { return fd >= 0; }
public:
WiiSocket() : fd(-1), nonBlock(false) {}
~WiiSocket();
@@ -216,7 +216,7 @@ public:
s32 NewSocket(s32 af, s32 type, s32 protocol);
void AddSocket(s32 fd);
s32 DeleteSocket(s32 s);
s32 GetLastNetError() { return errno_last; }
s32 GetLastNetError() const { return errno_last; }
void SetLastNetError(s32 error) { errno_last = error; }
void Clean()