Merge pull request #783 from lioncash/consts

Core: Apply const to some functions
This commit is contained in:
Alexandro Sánchez Bach 2014-08-31 22:56:39 +02:00
commit 6fa75cf993
11 changed files with 27 additions and 26 deletions

View file

@ -593,17 +593,17 @@ void KeyVault::LoadSelfUNK7Keys()
0x0F); 0x0F);
} }
SELF_KEY KeyVault::GetSelfLV0Key() SELF_KEY KeyVault::GetSelfLV0Key() const
{ {
return sk_LV0_arr[0]; return sk_LV0_arr[0];
} }
SELF_KEY KeyVault::GetSelfLDRKey() SELF_KEY KeyVault::GetSelfLDRKey() const
{ {
return sk_LDR_arr[0]; return sk_LDR_arr[0];
} }
SELF_KEY KeyVault::GetSelfLV1Key(u64 version) SELF_KEY KeyVault::GetSelfLV1Key(u64 version) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);
@ -619,7 +619,7 @@ SELF_KEY KeyVault::GetSelfLV1Key(u64 version)
return key; return key;
} }
SELF_KEY KeyVault::GetSelfLV2Key(u64 version) SELF_KEY KeyVault::GetSelfLV2Key(u64 version) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);
@ -635,7 +635,7 @@ SELF_KEY KeyVault::GetSelfLV2Key(u64 version)
return key; return key;
} }
SELF_KEY KeyVault::GetSelfISOKey(u16 revision, u64 version) SELF_KEY KeyVault::GetSelfISOKey(u16 revision, u64 version) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);
@ -652,7 +652,7 @@ SELF_KEY KeyVault::GetSelfISOKey(u16 revision, u64 version)
return key; return key;
} }
SELF_KEY KeyVault::GetSelfAPPKey(u16 revision) SELF_KEY KeyVault::GetSelfAPPKey(u16 revision) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);
@ -668,7 +668,7 @@ SELF_KEY KeyVault::GetSelfAPPKey(u16 revision)
return key; return key;
} }
SELF_KEY KeyVault::GetSelfUNK7Key(u64 version) SELF_KEY KeyVault::GetSelfUNK7Key(u64 version) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);
@ -684,7 +684,7 @@ SELF_KEY KeyVault::GetSelfUNK7Key(u64 version)
return key; return key;
} }
SELF_KEY KeyVault::GetSelfNPDRMKey(u16 revision) SELF_KEY KeyVault::GetSelfNPDRMKey(u16 revision) const
{ {
SELF_KEY key(0, 0, 0, "", "", "", "", 0); SELF_KEY key(0, 0, 0, "", "", "", "", 0);

View file

@ -131,14 +131,14 @@ private:
void LoadSelfAPPKeys(); void LoadSelfAPPKeys();
void LoadSelfUNK7Keys(); void LoadSelfUNK7Keys();
void LoadSelfNPDRMKeys(); void LoadSelfNPDRMKeys();
SELF_KEY GetSelfLV0Key(); SELF_KEY GetSelfLV0Key() const;
SELF_KEY GetSelfLDRKey(); SELF_KEY GetSelfLDRKey() const;
SELF_KEY GetSelfLV1Key(u64 version); SELF_KEY GetSelfLV1Key(u64 version) const;
SELF_KEY GetSelfLV2Key(u64 version); SELF_KEY GetSelfLV2Key(u64 version) const;
SELF_KEY GetSelfISOKey(u16 revision, u64 version); SELF_KEY GetSelfISOKey(u16 revision, u64 version) const;
SELF_KEY GetSelfAPPKey(u16 revision); SELF_KEY GetSelfAPPKey(u16 revision) const;
SELF_KEY GetSelfUNK7Key(u64 version); SELF_KEY GetSelfUNK7Key(u64 version) const;
SELF_KEY GetSelfNPDRMKey(u16 revision); SELF_KEY GetSelfNPDRMKey(u16 revision) const;
}; };
// RAP to RIF function. // RAP to RIF function.

View file

@ -233,7 +233,7 @@ public:
return result; return result;
} }
bool ConditionPassed(u8 cond) bool ConditionPassed(u8 cond) const
{ {
bool result = false; bool result = false;

View file

@ -528,7 +528,7 @@ void CompilePPUProgram::LoadArgs()
m_end_args = m_args.size() > 0; m_end_args = m_args.size() > 0;
} }
u32 CompilePPUProgram::GetBranchValue(const std::string& branch_name) u32 CompilePPUProgram::GetBranchValue(const std::string& branch_name) const
{ {
for(const Branch& branch : m_branches) for(const Branch& branch : m_branches)
{ {

View file

@ -147,7 +147,7 @@ protected:
void DetectArgInfo(Arg& arg); void DetectArgInfo(Arg& arg);
void LoadArgs(); void LoadArgs();
u32 GetBranchValue(const std::string& branch); u32 GetBranchValue(const std::string& branch) const;
bool SetNextArgType(u32 types, bool show_err = true); bool SetNextArgType(u32 types, bool show_err = true);
bool SetNextArgBranch(u8 aa, bool show_err = true); bool SetNextArgBranch(u8 aa, bool show_err = true);

View file

@ -29,12 +29,12 @@ class SPURSManagerEventFlag
public: public:
SPURSManagerEventFlag(u32 flagClearMode, u32 flagDirection); SPURSManagerEventFlag(u32 flagClearMode, u32 flagDirection);
u32 _getDirection() u32 _getDirection() const
{ {
return this->flagDirection; return this->flagDirection;
} }
u32 _getClearMode () u32 _getClearMode() const
{ {
return this->flagClearMode; return this->flagClearMode;
} }

View file

@ -145,7 +145,7 @@ public:
this->low = this->low & mask; this->low = this->low & mask;
} }
//Slice 0 or 1 //Slice 0 or 1
u8 checkSliceRounding(u8 slice) u8 checkSliceRounding(u8 slice) const
{ {
switch(slice) switch(slice)
{ {

View file

@ -316,7 +316,7 @@ ModuleManager::~ModuleManager()
UnloadModules(); UnloadModules();
} }
bool ModuleManager::IsLoadedFunc(u32 id) bool ModuleManager::IsLoadedFunc(u32 id) const
{ {
for (u32 i = 0; i<m_modules_funcs_list.size(); ++i) for (u32 i = 0; i<m_modules_funcs_list.size(); ++i)
{ {

View file

@ -17,7 +17,7 @@ public:
void init(); void init();
void AddFunc(ModuleFunc *func); void AddFunc(ModuleFunc *func);
void SetModule(int id, Module* module, bool with_data); void SetModule(int id, Module* module, bool with_data);
bool IsLoadedFunc(u32 id); bool IsLoadedFunc(u32 id) const;
bool CallFunc(u32 num); bool CallFunc(u32 num);
bool UnloadFunc(u32 id); bool UnloadFunc(u32 id);
void UnloadModules(); void UnloadModules();

View file

@ -43,7 +43,8 @@ public:
return GetIdManager().CheckID(id) && GetIdManager().GetID(id).m_name == GetName(); return GetIdManager().CheckID(id) && GetIdManager().GetID(id).m_name == GetName();
} }
template<typename T> bool CheckId(u32 id, T*& data) template<typename T>
bool CheckId(u32 id, T*& data) const
{ {
return detail::CheckId(id,data,GetName()); return detail::CheckId(id,data,GetName());
} }

View file

@ -64,7 +64,7 @@ template<typename T> struct IniEntry : public Ini
m_value = value; m_value = value;
} }
T GetValue() T GetValue() const
{ {
return m_value; return m_value;
} }