Kill off some usages of the ArraySize macro.

This required the use of std::array in some cases.
This commit is contained in:
Lioncash 2014-02-15 01:12:13 -05:00
commit 655d22512b
8 changed files with 44 additions and 45 deletions

View file

@ -111,7 +111,7 @@ bool CompareValues(const u32 val1, const u32 val2, const int type);
// ----------------------
// AR Remote Functions
void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
void LoadCodes(const IniFile& globalIni, const IniFile& localIni, bool forceLoad)
{
// Parses the Action Replay section of a game ini file.
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats
@ -132,22 +132,17 @@ void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
}
}
IniFile* inis[] = {&globalIni, &localIni};
for (size_t i = 0; i < ArraySize(inis); ++i)
const IniFile* inis[2] = {&globalIni, &localIni};
for (const IniFile* ini : inis)
{
std::vector<std::string> lines;
std::vector<std::string> encryptedLines;
ARCode currentCode;
inis[i]->GetLines("ActionReplay", lines);
ini->GetLines("ActionReplay", lines);
std::vector<std::string>::const_iterator
it = lines.begin(),
lines_end = lines.end();
for (; it != lines_end; ++it)
for (std::string line : lines)
{
const std::string line = *it;
if (line.empty())
continue;
@ -171,7 +166,7 @@ void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
currentCode.name = line.substr(1, line.size() - 1);
currentCode.active = enabledNames.find(currentCode.name) != enabledNames.end();
currentCode.user_defined = (i == 1);
currentCode.user_defined = (ini == &localIni);
}
else
{