summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SysConf.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2014-02-12 16:00:34 +0100
committerTillmann Karras <tilkax@gmail.com>2014-02-13 09:05:50 +0100
commit404624bf0b0125e5a408021c616ee9b9e2dde382 (patch)
treed2c3cd6256b09ebdc04b8c913b21c2e56d30c2e1 /Source/Core/Common/SysConf.cpp
parent2ff794d299b0426d1f2a523523260efad84a9837 (diff)
Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
Diffstat (limited to 'Source/Core/Common/SysConf.cpp')
-rw-r--r--Source/Core/Common/SysConf.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp
index acfb11b0ed..6948e7db31 100644
--- a/Source/Core/Common/SysConf.cpp
+++ b/Source/Core/Common/SysConf.cpp
@@ -25,8 +25,7 @@ SysConf::~SysConf()
void SysConf::Clear()
{
- for (std::vector<SSysConfEntry>::const_iterator i = m_Entries.begin();
- i < m_Entries.end() - 1; i++)
+ for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i)
delete [] i->data;
m_Entries.clear();
}
@@ -85,8 +84,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh)
}
// Last offset is an invalid entry. We ignore it throughout this class
- for (std::vector<SSysConfEntry>::iterator i = m_Entries.begin();
- i < m_Entries.end() - 1; i++)
+ for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i)
{
SSysConfEntry& curEntry = *i;
f.Seek(curEntry.offset, SEEK_SET);
@@ -300,7 +298,7 @@ void SysConf::GenerateSysConf()
items[26].data[0] = 0x01;
- for (auto& item : items)
+ for (const SSysConfEntry& item : items)
m_Entries.push_back(item);
File::CreateFullPath(m_FilenameDefault);
@@ -362,8 +360,7 @@ bool SysConf::SaveToFile(const char *filename)
{
File::IOFile f(filename, "r+b");
- for (std::vector<SSysConfEntry>::iterator i = m_Entries.begin();
- i < m_Entries.end() - 1; i++)
+ for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i)
{
// Seek to after the name of this entry
f.Seek(i->offset + i->nameLength + 1, SEEK_SET);