Some cosmetic code cleanup.

This commit is contained in:
Leon Styhre 2021-01-19 22:29:13 +01:00
parent e4f440ca9a
commit 735ce39812
10 changed files with 33 additions and 33 deletions

View file

@ -61,7 +61,7 @@ CollectionSystemsManager::CollectionSystemsManager(Window* window) : mWindow(win
(systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0]));
for (std::vector<CollectionSystemDecl>::const_iterator it = tempSystemDecl.cbegin();
it != tempSystemDecl.cend(); ++it )
it != tempSystemDecl.cend(); it++)
mCollectionSystemDeclsIndex[(*it).name] = (*it);
// Setup the standard environment.
@ -171,8 +171,8 @@ void CollectionSystemsManager::saveCustomCollection(SystemData* sys)
configFileIn.close();
for (std::unordered_map<std::string, FileData*>::const_iterator
iter = games.cbegin(); iter != games.cend(); ++iter) {
std::string path = iter->first;
it = games.cbegin(); it != games.cend(); it++) {
std::string path = it->first;
// If the ROM path of the game begins with the path from the setting
// ROMDirectory (or the default ROM directory), then replace it with %ROMPATH%.
if (path.find(rompath) == 0)
@ -1303,7 +1303,7 @@ std::vector<std::string> CollectionSystemsManager::getSystemsFromTheme()
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(themePath);
for (Utils::FileSystem::stringList::const_iterator
it = dirContent.cbegin(); it != dirContent.cend(); ++it) {
it = dirContent.cbegin(); it != dirContent.cend(); it++) {
if (Utils::FileSystem::isDirectory(*it)) {
// ... here you have a directory.
std::string folder = *it;
@ -1328,7 +1328,7 @@ std::vector<std::string> CollectionSystemsManager::getCollectionsFromConfigFolde
Utils::FileSystem::stringList dirContent =
Utils::FileSystem::getDirContent(configPath);
for (Utils::FileSystem::stringList::const_iterator
it = dirContent.cbegin(); it != dirContent.cend(); ++it) {
it = dirContent.cbegin(); it != dirContent.cend(); it++) {
if (Utils::FileSystem::isRegularFile(*it)) {
// It's a file.
std::string filename = Utils::FileSystem::getFileName(*it);

View file

@ -138,7 +138,7 @@ bool SystemData::populateFolder(FileData* folder)
return false;
for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin();
it != dirContent.cend(); ++it) {
it != dirContent.cend(); it++) {
filePath = *it;
// Skip hidden files and folders.
@ -190,7 +190,7 @@ void SystemData::indexAllGameFilters(const FileData* folder)
const std::vector<FileData*>& children = folder->getChildren();
for (std::vector<FileData*>::const_iterator it = children.cbegin();
it != children.cend(); ++it) {
it != children.cend(); it++) {
switch ((*it)->getType()) {
case GAME: {
mFilterIndex->addToIndex(*it);

View file

@ -441,7 +441,7 @@ void SystemScreensaver::update(int deltaTime)
void SystemScreensaver::generateImageList()
{
for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); ++it) {
it != SystemData::sSystemVector.cend(); it++) {
// We only want nodes from game systems that are not collections.
if (!(*it)->isGameSystem() || (*it)->isCollection())
continue;
@ -458,7 +458,7 @@ void SystemScreensaver::generateImageList()
void SystemScreensaver::generateVideoList()
{
for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); ++it) {
it != SystemData::sSystemVector.cend(); it++) {
// We only want nodes from game systems that are not collections.
if (!(*it)->isGameSystem() || (*it)->isCollection())
continue;

View file

@ -55,7 +55,7 @@ void GuiGamelistFilter::resetAllFilters()
{
mFilterIndex->resetFilters();
for (std::map<FilterIndexType, std::shared_ptr< OptionListComponent<std::string>>>::
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); it++) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
optionList->selectNone();
}
@ -138,7 +138,7 @@ void GuiGamelistFilter::applyFilters()
{
std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls();
for (std::map<FilterIndexType, std::shared_ptr<OptionListComponent<std::string>>>::
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); it++) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
std::vector<std::string> filters = optionList->getSelectedObjects();
mFilterIndex->setFilter(it->first, &filters);

View file

@ -173,7 +173,7 @@ bool parseArgs(int argc, char* argv[])
int width = atoi(argv[i + 1]);
int height = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("WindowWidth", width);
Settings::getInstance()->setInt("WindowHeight", height);
}
@ -185,7 +185,7 @@ bool parseArgs(int argc, char* argv[])
int width = atoi(argv[i + 1]);
int height = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("ScreenWidth", width);
Settings::getInstance()->setInt("ScreenHeight", height);
}
@ -197,7 +197,7 @@ bool parseArgs(int argc, char* argv[])
int x = atoi(argv[i + 1]);
int y = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("ScreenOffsetX", x);
Settings::getInstance()->setInt("ScreenOffsetY", y);
}
@ -208,7 +208,7 @@ bool parseArgs(int argc, char* argv[])
}
int rotate = atoi(argv[i + 1]);
++i; // skip the argument value
i++; // Skip the argument value.
Settings::getInstance()->setInt("ScreenRotate", rotate);
}
else if (strcmp(argv[i], "--max-vram") == 0) {
@ -218,7 +218,7 @@ bool parseArgs(int argc, char* argv[])
}
int maxVRAM = atoi(argv[i + 1]);
Settings::getInstance()->setInt("MaxVRAM", maxVRAM);
++i; // skip the argument value
i++; // Skip the argument value.
}
else if (strcmp(argv[i], "--gamelist-only") == 0) {
Settings::getInstance()->setBool("ParseGamelistOnly", true);

View file

@ -232,7 +232,7 @@ std::string getDeveloperString(const Value& v)
std::string out = "";
bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
for (int i = 0; i < static_cast<int>(v.Size()); i++) {
auto mapIt = resources.gamesdb_new_developers_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_developers_map.cend())
@ -254,7 +254,7 @@ std::string getPublisherString(const Value& v)
std::string out = "";
bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
for (int i = 0; i < static_cast<int>(v.Size()); i++) {
auto mapIt = resources.gamesdb_new_publishers_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_publishers_map.cend())
@ -276,7 +276,7 @@ std::string getGenreString(const Value& v)
std::string out = "";
bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
for (int i = 0; i < static_cast<int>(v.Size()); i++) {
auto mapIt = resources.gamesdb_new_genres_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_genres_map.cend())
@ -448,7 +448,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr<HttpReq>& req,
const Value& games = doc["data"]["games"];
resources.ensureResources();
for (int i = 0; i < static_cast<int>(games.Size()); ++i) {
for (int i = 0; i < static_cast<int>(games.Size()); i++) {
auto& v = games[i];
try {
processGame(v, results);

View file

@ -88,7 +88,7 @@ void TheGamesDBJSONRequestResources::ensureResources()
if (checkLoaded())
return;
for (int i = 0; i < MAX_WAIT_ITER; ++i) {
for (int i = 0; i < MAX_WAIT_ITER; i++) {
if (gamesdb_developers_resource_request &&
saveResource(gamesdb_developers_resource_request.get(),
@ -187,7 +187,7 @@ int TheGamesDBJSONRequestResources::loadResource(
}
auto& data = doc["data"][resource_name.c_str()];
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); ++itr) {
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); itr++) {
auto& entry = itr->value;
if (!entry.IsObject() || !entry.HasMember("id") || !entry["id"].IsInt() ||
!entry.HasMember("name") || !entry["name"].IsString())