diff --git a/src/Components/Modules/AssetHandler.cpp b/src/Components/Modules/AssetHandler.cpp index 67b67118..012c7008 100644 --- a/src/Components/Modules/AssetHandler.cpp +++ b/src/Components/Modules/AssetHandler.cpp @@ -30,7 +30,7 @@ namespace Components void AssetHandler::ClearTemporaryAssets() { - for (int i = 0; i < Game::XAssetType::ASSET_TYPE_COUNT; i++) + for (int i = 0; i < Game::XAssetType::ASSET_TYPE_COUNT; ++i) { AssetHandler::TemporaryAssets[i].clear(); } @@ -269,7 +269,7 @@ namespace Components { ClearTemporaryAssets(); - for (auto i = AssetHandler::AssetInterfaces.begin(); i != AssetHandler::AssetInterfaces.end(); i++) + for (auto i = AssetHandler::AssetInterfaces.begin(); i != AssetHandler::AssetInterfaces.end(); ++i) { delete i->second; } diff --git a/src/Components/Modules/AssetInterfaces/IMaterial.cpp b/src/Components/Modules/AssetInterfaces/IMaterial.cpp index 8cb23ffa..fc9f7899 100644 --- a/src/Components/Modules/AssetInterfaces/IMaterial.cpp +++ b/src/Components/Modules/AssetInterfaces/IMaterial.cpp @@ -138,7 +138,7 @@ namespace Assets if (asset->textureTable) { - for (char i = 0; i < asset->textureCount; i++) + for (char i = 0; i < asset->textureCount; ++i) { if (asset->textureTable[i].info.image) { @@ -197,7 +197,7 @@ namespace Assets Game::MaterialTextureDef* destTextureTable = buffer->Dest(); buffer->SaveArray(asset->textureTable, asset->textureCount); - for (char i = 0; i < asset->textureCount; i++) + for (char i = 0; i < asset->textureCount; ++i) { Game::MaterialTextureDef* destTextureDef = &destTextureTable[i]; Game::MaterialTextureDef* textureDef = &asset->textureTable[i]; diff --git a/src/Components/Modules/AssetInterfaces/IMaterialTechniqueSet.cpp b/src/Components/Modules/AssetInterfaces/IMaterialTechniqueSet.cpp index 9ad63581..91682311 100644 --- a/src/Components/Modules/AssetInterfaces/IMaterialTechniqueSet.cpp +++ b/src/Components/Modules/AssetInterfaces/IMaterialTechniqueSet.cpp @@ -6,13 +6,13 @@ namespace Assets { Game::MaterialTechniqueSet* asset = header.materialTechset; - for (int i = 0; i < ARR_SIZE(Game::MaterialTechniqueSet::techniques); i++) + for (int i = 0; i < ARR_SIZE(Game::MaterialTechniqueSet::techniques); ++i) { Game::MaterialTechnique* technique = asset->techniques[i]; if (!technique) continue; - for (short j = 0; j < technique->numPasses; j++) + for (short j = 0; j < technique->numPasses; ++j) { Game::MaterialPass* pass = &technique->passes[j]; @@ -54,7 +54,7 @@ namespace Assets // Save_MaterialTechniquePtrArray static_assert(ARR_SIZE(Game::MaterialTechniqueSet::techniques) == 48, "Techniques array invalid!"); - for (int i = 0; i < ARR_SIZE(Game::MaterialTechniqueSet::techniques); i++) + for (int i = 0; i < ARR_SIZE(Game::MaterialTechniqueSet::techniques); ++i) { Game::MaterialTechnique* technique = asset->techniques[i]; @@ -74,7 +74,7 @@ namespace Assets buffer->Save(technique, 8); // Save_MaterialPassArray - for (short j = 0; j < technique->numPasses; j++) + for (short j = 0; j < technique->numPasses; ++j) { Assert_Size(Game::MaterialPass, 20); diff --git a/src/Components/Modules/Console.cpp b/src/Components/Modules/Console.cpp index b68c3c13..14f0367c 100644 --- a/src/Components/Modules/Console.cpp +++ b/src/Components/Modules/Console.cpp @@ -48,7 +48,7 @@ namespace Components if (maxclientCount) { - for (int i = 0; i < maxclientCount; i++) + for (int i = 0; i < maxclientCount; ++i) { if (Game::svs_clients[i].state >= 3) { diff --git a/src/Components/Modules/Dedicated.cpp b/src/Components/Modules/Dedicated.cpp index 85d3639d..8a5da2fd 100644 --- a/src/Components/Modules/Dedicated.cpp +++ b/src/Components/Modules/Dedicated.cpp @@ -109,7 +109,7 @@ namespace Components { // Rebuild map rotation string rotation.clear(); - for (unsigned int j = (i + 2); j < tokens.size(); j++) + for (unsigned int j = (i + 2); j < tokens.size(); ++j) { if (j != (i + 2)) rotation += " "; rotation += tokens[j]; diff --git a/src/Components/Modules/Download.cpp b/src/Components/Modules/Download.cpp index fcb718ba..4de984b3 100644 --- a/src/Components/Modules/Download.cpp +++ b/src/Components/Modules/Download.cpp @@ -32,7 +32,7 @@ namespace Components void Download::RemoveClientDownload(int id) { - for (auto i = Download::DataContainer.ClientDownloads.begin(); i != Download::DataContainer.ClientDownloads.end(); i++) + for (auto i = Download::DataContainer.ClientDownloads.begin(); i != Download::DataContainer.ClientDownloads.end(); ++i) { if (i->id == id) { @@ -44,7 +44,7 @@ namespace Components void Download::RemoveServerDownload(int id) { - for (auto i = Download::DataContainer.ServerDownloads.begin(); i != Download::DataContainer.ServerDownloads.end(); i++) + for (auto i = Download::DataContainer.ServerDownloads.begin(); i != Download::DataContainer.ServerDownloads.end(); ++i) { if (i->id == id) { @@ -71,7 +71,7 @@ namespace Components { if (download->parts.size()) { - for (auto i = download->parts.begin(); i != download->parts.end(); i++) + for (auto i = download->parts.begin(); i != download->parts.end(); ++i) { if (i->first == packet) { @@ -85,7 +85,7 @@ namespace Components bool Download::HasReceivedAllPackets(Download::Container::DownloadCL* download) { - for (int i = 0; i < download->maxParts; i++) + for (int i = 0; i < download->maxParts; ++i) { if (!Download::HasReceivedPacket(download, i)) { @@ -216,7 +216,7 @@ namespace Components download.lastPing = Game::Com_Milliseconds(); download.maxParts = 0; - for (int i = 0; i < 1000000; i++) + for (int i = 0; i < 1000000; ++i) { download.buffer.append("1234567890"); } @@ -245,7 +245,7 @@ namespace Components { std::string buffer; - for (int i = 0; i < download->maxParts; i++) + for (int i = 0; i < download->maxParts; ++i) { if (!Download::HasReceivedPacket(download, i)) return ""; buffer.append(download->parts[i]); @@ -276,7 +276,7 @@ namespace Components { if (download->sentParts.size()) { - for (auto i = download->sentParts.begin(); i != download->sentParts.end(); i++) + for (auto i = download->sentParts.begin(); i != download->sentParts.end(); ++i) { if (*i == packet) { @@ -315,7 +315,7 @@ namespace Components { if (Download::DataContainer.ClientDownloads.size()) { - for (auto i = Download::DataContainer.ClientDownloads.begin(); i != Download::DataContainer.ClientDownloads.end(); i++) + for (auto i = Download::DataContainer.ClientDownloads.begin(); i != Download::DataContainer.ClientDownloads.end(); ++i) { if ((Game::Com_Milliseconds() - i->lastPing) > (DOWNLOAD_TIMEOUT * 2)) { @@ -328,7 +328,7 @@ namespace Components if (i->acknowledged && (Game::Com_Milliseconds() - i->lastPing) > DOWNLOAD_TIMEOUT) { std::vector missingPackets; - for (int j = 0; j < i->maxParts; j++) + for (int j = 0; j < i->maxParts; ++j) { if (!Download::HasReceivedPacket(&*i, j)) { @@ -343,7 +343,7 @@ namespace Components if (Download::DataContainer.ServerDownloads.size()) { - for (auto i = Download::DataContainer.ServerDownloads.begin(); i != Download::DataContainer.ServerDownloads.end(); i++) + for (auto i = Download::DataContainer.ServerDownloads.begin(); i != Download::DataContainer.ServerDownloads.end(); ++i) { if ((Game::Com_Milliseconds() - i->lastPing) > (DOWNLOAD_TIMEOUT * 3)) { @@ -352,7 +352,7 @@ namespace Components } int packets = 0; - for (int j = 0; j < i->maxParts && packets <= FRAME_PACKET_LIMIT && i->acknowledged; j++) + for (int j = 0; j < i->maxParts && packets <= FRAME_PACKET_LIMIT && i->acknowledged; ++j) { if (!Download::HasSentPacket(&*i, j)) { diff --git a/src/Components/Modules/FileSystem.cpp b/src/Components/Modules/FileSystem.cpp index f44583dd..9314e754 100644 --- a/src/Components/Modules/FileSystem.cpp +++ b/src/Components/Modules/FileSystem.cpp @@ -53,7 +53,7 @@ namespace Components if (files) { - for (int i = 0; i < numFiles; i++) + for (int i = 0; i < numFiles; ++i) { if (files[i]) { diff --git a/src/Components/Modules/Flags.cpp b/src/Components/Modules/Flags.cpp index 1d644550..0aa26341 100644 --- a/src/Components/Modules/Flags.cpp +++ b/src/Components/Modules/Flags.cpp @@ -23,7 +23,7 @@ namespace Components LPCWSTR commandLine = GetCommandLineW(); LPWSTR* argv = CommandLineToArgvW(commandLine, &numArgs); - for (int i = 0; i < numArgs;i++) + for (int i = 0; i < numArgs; ++i) { std::wstring wFlag = argv[i]; if (wFlag[0] == L'-') diff --git a/src/Components/Modules/Localization.cpp b/src/Components/Modules/Localization.cpp index 9ddd1f6e..204a8c4e 100644 --- a/src/Components/Modules/Localization.cpp +++ b/src/Components/Modules/Localization.cpp @@ -88,7 +88,7 @@ namespace Components void Localization::ClearTemp() { - for (auto i = Localization::TempLocalizeMap.begin(); i != Localization::TempLocalizeMap.end(); i++) + for (auto i = Localization::TempLocalizeMap.begin(); i != Localization::TempLocalizeMap.end(); ++i) { if (i->second) { @@ -175,7 +175,7 @@ namespace Components { Localization::ClearTemp(); - for (auto i = Localization::LocalizeMap.begin(); i != Localization::LocalizeMap.end(); i++) + for (auto i = Localization::LocalizeMap.begin(); i != Localization::LocalizeMap.end(); ++i) { if (i->second) { diff --git a/src/Components/Modules/Logger.cpp b/src/Components/Modules/Logger.cpp index 8eb657f0..51457d0a 100644 --- a/src/Components/Modules/Logger.cpp +++ b/src/Components/Modules/Logger.cpp @@ -64,7 +64,7 @@ namespace Components { Logger::MessageMutex.lock(); - for (unsigned int i = 0; i < Logger::MessageQueue.size(); i++) + for (unsigned int i = 0; i < Logger::MessageQueue.size(); ++i) { if (Logger::IsConsoleReady()) { diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 6f856996..eb3b7ccf 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -15,7 +15,7 @@ namespace Components if (!zoneInfo) return; Maps::CurrentDependencies.clear(); - for (auto i = Maps::DependencyList.begin(); i != Maps::DependencyList.end(); i++) + for (auto i = Maps::DependencyList.begin(); i != Maps::DependencyList.end(); ++i) { if (std::regex_match(zoneInfo->name, std::regex(i->first))) { @@ -29,7 +29,7 @@ namespace Components std::vector data; Utils::Merge(&data, zoneInfo, zoneCount); - for (unsigned int i = 0; i < Maps::CurrentDependencies.size(); i++) + for (unsigned int i = 0; i < Maps::CurrentDependencies.size(); ++i) { Game::XZoneInfo info; diff --git a/src/Components/Modules/Menus.cpp b/src/Components/Modules/Menus.cpp index f44acf24..9d463dc9 100644 --- a/src/Components/Modules/Menus.cpp +++ b/src/Components/Modules/Menus.cpp @@ -10,7 +10,7 @@ namespace Components { // Check if a free slot is available int i = 1; - for (; i < MAX_SOURCEFILES; i++) + for (; i < MAX_SOURCEFILES; ++i) { if (!Game::sourceFiles[i]) break; @@ -273,7 +273,7 @@ namespace Components { std::vector menus; - for (int i = 0; i < menuList->menuCount; i++) + for (int i = 0; i < menuList->menuCount; ++i) { if (!menuList->menus[i]) { @@ -372,7 +372,7 @@ namespace Components // Seems like this is obsolete as well, // as the game handles the memory - //for (int i = 0; i < menudef->itemCount; i++) + //for (int i = 0; i < menudef->itemCount; ++i) //{ // Game::Menu_FreeItemMemory(menudef->items[i]); //} @@ -415,7 +415,7 @@ namespace Components void Menus::RemoveMenu(Game::menuDef_t* menudef) { - for (auto i = Menus::MenuList.begin(); i != Menus::MenuList.end(); i++) + for (auto i = Menus::MenuList.begin(); i != Menus::MenuList.end(); ++i) { if (i->second == menudef) { @@ -433,7 +433,7 @@ namespace Components { if (i->second) { - for (auto j = 0; j < i->second->menuCount; j++) + for (auto j = 0; j < i->second->menuCount; ++j) { Menus::RemoveMenu(i->second->menus[j]); } @@ -465,7 +465,7 @@ namespace Components Game::menuDef_t* oldMenu = i->second; // Replace every old instance with our new one in the ui context - for (int j = 0; j < Game::uiContext->menuCount; j++) + for (int j = 0; j < Game::uiContext->menuCount; ++j) { if (Game::uiContext->menus[j] == oldMenu) { @@ -474,13 +474,13 @@ namespace Components } // Replace every old instance with our new one in our menu lists - for (auto j = Menus::MenuListList.begin(); j != Menus::MenuListList.end(); j++) + for (auto j = Menus::MenuListList.begin(); j != Menus::MenuListList.end(); ++j) { Game::MenuList* list = j->second; if (list && list->menus) { - for (int k = 0; k < list->menuCount; k++) + for (int k = 0; k < list->menuCount; ++k) { if (list->menus[k] == oldMenu) { @@ -500,14 +500,14 @@ namespace Components void Menus::FreeEverything() { - for (auto i = Menus::MenuListList.begin(); i != Menus::MenuListList.end(); i++) + for (auto i = Menus::MenuListList.begin(); i != Menus::MenuListList.end(); ++i) { Menus::FreeMenuList(i->second); } Menus::MenuListList.clear(); - for (auto i = Menus::MenuList.begin(); i != Menus::MenuList.end(); i++) + for (auto i = Menus::MenuList.begin(); i != Menus::MenuList.end(); ++i) { Menus::FreeMenu(i->second); } @@ -532,7 +532,7 @@ namespace Components { Game::MenuList* list = Menus::MenuListList[filename]; - for (int i = 0; list && list->menus && i < list->menuCount; i++) + for (int i = 0; list && list->menus && i < list->menuCount; ++i) { Menus::RemoveMenuFromContext(Game::uiContext, list->menus[i]); } @@ -592,7 +592,7 @@ namespace Components { // Search menu in context int i = 0; - for (; i < dc->menuCount; i++) + for (; i < dc->menuCount; ++i) { if (dc->menus[i] == menu) { @@ -603,7 +603,7 @@ namespace Components // Remove from stack if (i < dc->menuCount) { - for (; i < dc->menuCount - 1; i++) + for (; i < dc->menuCount - 1; ++i) { dc->menus[i] = dc->menus[i + 1]; } diff --git a/src/Components/Modules/Network.cpp b/src/Components/Modules/Network.cpp index a4b2d8eb..c0627daa 100644 --- a/src/Components/Modules/Network.cpp +++ b/src/Components/Modules/Network.cpp @@ -71,7 +71,7 @@ namespace Components if (Game::NET_IsLocalAddress(this->address)) return true; // Loopback if (this->GetPort() != (Dvar::Var("net_port").Get() & 0xFFFF)) return false; // Port not equal - for (int i = 0; i < *Game::numIP; i++) + for (int i = 0; i < *Game::numIP; ++i) { if (this->GetIP().full == Game::localIP[i].full) { @@ -129,7 +129,7 @@ namespace Components void Network::BroadcastRange(unsigned int min, unsigned int max, std::string data) { - for (unsigned int i = min; i < max; i++) + for (unsigned int i = min; i < max; ++i) { Network::Broadcast(static_cast(i & 0xFFFF), data); } @@ -152,7 +152,7 @@ namespace Components packetCommand = Utils::StrToLower(packetCommand); // Check if custom handler exists - for (auto i = Network::PacketHandlers.begin(); i != Network::PacketHandlers.end(); i++) + for (auto i = Network::PacketHandlers.begin(); i != Network::PacketHandlers.end(); ++i) { if (Utils::StrToLower(i->first) == packetCommand) { diff --git a/src/Components/Modules/Party.cpp b/src/Components/Modules/Party.cpp index 0b16ae4b..66bd8ab0 100644 --- a/src/Components/Modules/Party.cpp +++ b/src/Components/Modules/Party.cpp @@ -249,7 +249,7 @@ namespace Components if (maxclientCount) { - for (int i = 0; i < maxclientCount; i++) + for (int i = 0; i < maxclientCount; ++i) { if (Game::svs_clients[i].state >= 3) { diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 428b6bf7..8a822f5a 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -19,7 +19,7 @@ namespace Components if (challengeTable) { - for (int i = 0; i < challengeTable->rowCount; i++) + for (int i = 0; i < challengeTable->rowCount; ++i) { // Find challenge const char* challenge = Game::TabeLookup(challengeTable, i, 0); @@ -28,7 +28,7 @@ namespace Components int maxProgress = 0; // Find correct tier and progress - for (int j = 0; j < 10; j++) + for (int j = 0; j < 10; ++j) { int progress = atoi(Game::TabeLookup(challengeTable, i, 6 + j * 2)); if (!progress )break; diff --git a/src/Components/Modules/ServerInfo.cpp b/src/Components/Modules/ServerInfo.cpp index 352c71c6..6cd4031f 100644 --- a/src/Components/Modules/ServerInfo.cpp +++ b/src/Components/Modules/ServerInfo.cpp @@ -131,7 +131,7 @@ namespace Components std::string playerList; - for (int i = 0; i < maxclientCount; i++) // Maybe choose 18 here? + for (int i = 0; i < maxclientCount; ++i) // Maybe choose 18 here? { int score = 0; int ping = 0; @@ -205,7 +205,7 @@ namespace Components if (lines.size() <= 1) return; - for (unsigned int i = 1; i < lines.size(); i++) + for (unsigned int i = 1; i < lines.size(); ++i) { ServerInfo::Container::Player player; diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index b63af564..d15d79f3 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -159,7 +159,7 @@ namespace Components int ui_browserMod = Dvar::Var("ui_browserMod").Get(); int ui_joinGametype = Dvar::Var("ui_joinGametype").Get(); - for (unsigned int i = 0; i < list->size(); i++) + for (unsigned int i = 0; i < list->size(); ++i) { ServerList::ServerInfo* info = &(*list)[i]; @@ -251,7 +251,7 @@ namespace Components auto storedServers = object.array_items(); - for (unsigned int i = 0; i < storedServers.size(); i++) + for (unsigned int i = 0; i < storedServers.size(); ++i) { if (!storedServers[i].is_string()) continue; if (storedServers[i].string_value() == server) @@ -290,7 +290,7 @@ namespace Components auto servers = object.array_items(); - for (unsigned int i = 0; i < servers.size(); i++) + for (unsigned int i = 0; i < servers.size(); ++i) { if(!servers[i].is_string()) continue; ServerList::InsertRequest(servers[i].string_value(), true); @@ -329,7 +329,7 @@ namespace Components { ServerList::RefreshContainer.Mutex.lock(); - for (auto i = ServerList::RefreshContainer.Servers.begin(); i != ServerList::RefreshContainer.Servers.end(); i++) + for (auto i = ServerList::RefreshContainer.Servers.begin(); i != ServerList::RefreshContainer.Servers.end(); ++i) { // Our desired server if (i->Target == address && i->Sent) @@ -365,7 +365,7 @@ namespace Components if (!list) return; unsigned int k = 0; - for (auto j = list->begin(); j != list->end(); j++, k++) + for (auto j = list->begin(); j != list->end(); ++j, ++k) { if (j->Addr == address) { @@ -375,7 +375,7 @@ namespace Components } // Also remove from visible list - for (auto j = ServerList::VisibleList.begin(); j != ServerList::VisibleList.end(); j++) + for (auto j = ServerList::VisibleList.begin(); j != ServerList::VisibleList.end(); ++j) { if (*j == k) { @@ -477,7 +477,7 @@ namespace Components // Send requests to 10 servers each frame int SendServers = 10; - for (unsigned int i = 0; i < ServerList::RefreshContainer.Servers.size(); i++) + for (unsigned int i = 0; i < ServerList::RefreshContainer.Servers.size(); ++i) { ServerList::Container::ServerContainer* server = &ServerList::RefreshContainer.Servers[i]; if (server->Sent) continue; @@ -566,7 +566,7 @@ namespace Components } while (!entry->HasSeparator() && !entry->IsEndToken()); - for (int i = 0; !entry[i].IsEndToken() && entry[i].HasSeparator(); i++) + for (int i = 0; !entry[i].IsEndToken() && entry[i].HasSeparator(); ++i) { Network::Address serverAddr = address; serverAddr.SetIP(entry[i].IP); diff --git a/src/Components/Modules/StringTable.cpp b/src/Components/Modules/StringTable.cpp index ff632e53..8fdfb5c6 100644 --- a/src/Components/Modules/StringTable.cpp +++ b/src/Components/Modules/StringTable.cpp @@ -43,9 +43,9 @@ namespace Components return nullptr; } - for (int i = 0; i < table->rowCount; i++) + for (int i = 0; i < table->rowCount; ++i) { - for (int j = 0; j < table->columnCount; j++) + for (int j = 0; j < table->columnCount; ++j) { Game::StringTableCell* cell = &table->values[i * table->columnCount + j]; cell->hash = StringTable::Hash(parsedTable.GetElementAt(i, j).data()); @@ -90,14 +90,14 @@ namespace Components StringTable::~StringTable() { - for (auto i = StringTable::StringTableMap.begin(); i != StringTable::StringTableMap.end(); i++) + for (auto i = StringTable::StringTableMap.begin(); i != StringTable::StringTableMap.end(); ++i) { Game::StringTable* table = i->second; if (table) { if (table->values) { - for (int j = 0; j < table->rowCount * table->columnCount; j++) + for (int j = 0; j < table->rowCount * table->columnCount; ++j) { if (table->values[j].string) { diff --git a/src/Components/Modules/Theatre.cpp b/src/Components/Modules/Theatre.cpp index c265a690..d645f127 100644 --- a/src/Components/Modules/Theatre.cpp +++ b/src/Components/Modules/Theatre.cpp @@ -297,7 +297,7 @@ namespace Components int numDel = files.size() - Dvar::Var("cl_demosKeep").Get(); - for (int i = 0; i < numDel; i++) + for (int i = 0; i < numDel; ++i) { Logger::Print("Deleting old demo %s\n", files[i].data()); FileSystem::DeleteFile("demos", files[i].data()); diff --git a/src/Components/Modules/UIScript.cpp b/src/Components/Modules/UIScript.cpp index 27314be3..18479378 100644 --- a/src/Components/Modules/UIScript.cpp +++ b/src/Components/Modules/UIScript.cpp @@ -78,7 +78,7 @@ namespace Components { if (key == 200 || key == 201) //mouse buttons { - for (auto i = UIScript::UIOwnerDraws.begin(); i != UIScript::UIOwnerDraws.end(); i++) + for (auto i = UIScript::UIOwnerDraws.begin(); i != UIScript::UIOwnerDraws.end(); ++i) { if (i->first == ownerDraw) { diff --git a/src/Components/Modules/ZoneBuilder.cpp b/src/Components/Modules/ZoneBuilder.cpp index a09e3982..f70106ae 100644 --- a/src/Components/Modules/ZoneBuilder.cpp +++ b/src/Components/Modules/ZoneBuilder.cpp @@ -52,7 +52,7 @@ namespace Components void ZoneBuilder::Zone::LoadFastFiles() { Logger::Print("Loading required FastFiles...\n"); - for (int i = 0; i < DataMap.GetRows(); i++) + for (int i = 0; i < DataMap.GetRows(); ++i) { if (DataMap.GetElementAt(i, 0) == "require") { @@ -81,7 +81,7 @@ namespace Components bool ZoneBuilder::Zone::LoadAssets() { - for (int i = 0; i < DataMap.GetRows(); i++) + for (int i = 0; i < DataMap.GetRows(); ++i) { if (DataMap.GetElementAt(i, 0) != "require") { @@ -145,7 +145,7 @@ namespace Components int ZoneBuilder::Zone::FindAsset(Game::XAssetType type, std::string name) { - for (unsigned int i = 0; i < ZoneBuilder::Zone::LoadedAssets.size(); i++) + for (unsigned int i = 0; i < ZoneBuilder::Zone::LoadedAssets.size(); ++i) { Game::XAsset* asset = &ZoneBuilder::Zone::LoadedAssets[i]; @@ -247,7 +247,7 @@ namespace Components // That's the reason why the count is incremented by 1, if scriptStrings are available. // Write ScriptString pointer table - for (size_t i = 0; i < ZoneBuilder::Zone::ScriptStrings.size(); i++) + for (size_t i = 0; i < ZoneBuilder::Zone::ScriptStrings.size(); ++i) { ZoneBuilder::Zone::Buffer.SaveMax(4); } @@ -293,7 +293,7 @@ namespace Components header->externalSize = 0; // ? // Write stream sizes - for (int i = 0; i < Game::MAX_XFILE_COUNT; i++) + for (int i = 0; i < Game::MAX_XFILE_COUNT; ++i) { header->blockSize[i] = ZoneBuilder::Zone::Buffer.GetBlockSize((Game::XFILE_BLOCK_TYPES)i); } diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index f7b748b4..d83c491d 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -207,7 +207,7 @@ namespace Game const char* UI_LocalizeMapName(const char* mapName) { - for (int i = 0; i < *arenaCount; i++) + for (int i = 0; i < *arenaCount; ++i) { if (!_stricmp(arenas[i].mapName, mapName)) { @@ -232,7 +232,7 @@ namespace Game return ""; } - for (int i = 0; i < *gameTypeCount; i++) + for (int i = 0; i < *gameTypeCount; ++i) { if (!_stricmp(gameTypes[i].gameType, gameType)) { @@ -252,7 +252,7 @@ namespace Game XAssetType DB_GetXAssetNameType(const char* name) { - for (int i = 0; i < ASSET_TYPE_COUNT; i++) + for (int i = 0; i < ASSET_TYPE_COUNT; ++i) { XAssetType type = static_cast(i); if (!_stricmp(DB_GetXAssetTypeName(type), name)) diff --git a/src/Utils/CSV.cpp b/src/Utils/CSV.cpp index f674e533..2c5cca7b 100644 --- a/src/Utils/CSV.cpp +++ b/src/Utils/CSV.cpp @@ -41,7 +41,7 @@ namespace Utils { int count = 0; - for (int i = 0; i < CSV::GetRows(); i++) + for (int i = 0; i < CSV::GetRows(); ++i) { count = max(CSV::GetColumns(i), count); } @@ -96,7 +96,7 @@ namespace Utils std::vector _row; char tempStr = 0; - for (unsigned int i = 0; i < row.size(); i++) + for (unsigned int i = 0; i < row.size(); ++i) { if (row[i] == ',' && !isString) // FLush entry { diff --git a/src/Utils/Memory.hpp b/src/Utils/Memory.hpp index 3ccb091d..ebe34333 100644 --- a/src/Utils/Memory.hpp +++ b/src/Utils/Memory.hpp @@ -15,7 +15,7 @@ namespace Utils } ~Allocator() { - for (auto i = this->RefMemory.begin(); i != this->RefMemory.end(); i++) + for (auto i = this->RefMemory.begin(); i != this->RefMemory.end(); ++i) { if (i->first && i->second) { diff --git a/src/Utils/Stream.cpp b/src/Utils/Stream.cpp index 980d5a36..5f465135 100644 --- a/src/Utils/Stream.cpp +++ b/src/Utils/Stream.cpp @@ -67,7 +67,7 @@ namespace Utils { auto ret = Stream::Length(); - for (size_t i = 0; i < count; i++) + for (size_t i = 0; i < count; ++i) { Stream::Save(stream, &value, 4, 1); } @@ -108,7 +108,7 @@ namespace Utils { auto ret = Stream::Length(); - for (size_t i = 0; i < count; i++) + for (size_t i = 0; i < count; ++i) { Stream::Save(&byte, 1); } diff --git a/src/Utils/Utils.cpp b/src/Utils/Utils.cpp index 6c2661de..e62bf029 100644 --- a/src/Utils/Utils.cpp +++ b/src/Utils/Utils.cpp @@ -191,7 +191,7 @@ namespace Utils bool first = true; - for (auto i = this->KeyValuePairs.begin(); i != this->KeyValuePairs.end(); i++) + for (auto i = this->KeyValuePairs.begin(); i != this->KeyValuePairs.end(); ++i) { if (first) first = false; else infoString.append("\\"); @@ -206,7 +206,7 @@ namespace Utils void InfoString::Dump() { - for (auto i = this->KeyValuePairs.begin(); i != this->KeyValuePairs.end(); i++) + for (auto i = this->KeyValuePairs.begin(); i != this->KeyValuePairs.end(); ++i) { OutputDebugStringA(Utils::VA("%s: %s", i->first.data(), i->second.data())); } diff --git a/src/Utils/Utils.hpp b/src/Utils/Utils.hpp index d4f1b1ed..88e4d421 100644 --- a/src/Utils/Utils.hpp +++ b/src/Utils/Utils.hpp @@ -43,7 +43,7 @@ namespace Utils { if (source) { - for (size_t i = 0; i < length; i++) + for (size_t i = 0; i < length; ++i) { target->push_back(source[i]); } diff --git a/src/Utils/WebIO.cpp b/src/Utils/WebIO.cpp index bae201f9..e71f953c 100644 --- a/src/Utils/WebIO.cpp +++ b/src/Utils/WebIO.cpp @@ -61,7 +61,7 @@ namespace Utils // Parse protocol if (pURL.cchProtocol && pURL.cchProtocol != 0xCCCCCCCC && pURL.pszProtocol) { - for (UINT i = 0; i < pURL.cchProtocol; i++) + for (UINT i = 0; i < pURL.cchProtocol; ++i) { char lChar = static_cast(tolower(pURL.pszProtocol[i])); WebIO::m_sUrl.protocol.append(&lChar, 1); @@ -116,7 +116,7 @@ namespace Utils { std::string body; - for (auto param = params.begin(); param != params.end(); param++) + for (auto param = params.begin(); param != params.end(); ++param) { std::string key = param->first; std::string value = param->second;