diff --git a/src/Components/Modules/Auth.cpp b/src/Components/Modules/Auth.cpp index 600b7a88..0b83ea97 100644 --- a/src/Components/Modules/Auth.cpp +++ b/src/Components/Modules/Auth.cpp @@ -240,7 +240,7 @@ namespace Components return bits; } - bits++; + ++bits; } } diff --git a/src/Components/Modules/Colors.cpp b/src/Components/Modules/Colors.cpp index e0f01b8c..f6acfd7f 100644 --- a/src/Components/Modules/Colors.cpp +++ b/src/Components/Modules/Colors.cpp @@ -65,15 +65,16 @@ namespace Components char index = *(in + 1); if (*in == '^' && (Colors::ColorIndex(index) != 7 || index == '7')) { - in++; + ++in; } else { *out = *in; - out++; - current++; + ++out; + ++current; } - in++; + + ++in; } *out = '\0'; } diff --git a/src/Components/Modules/Console.cpp b/src/Components/Modules/Console.cpp index 4eae4161..2d3b585f 100644 --- a/src/Components/Modules/Console.cpp +++ b/src/Components/Modules/Console.cpp @@ -56,7 +56,7 @@ namespace Components { if (Game::svs_clients[i].state >= 3) { - clientCount++; + ++clientCount; } } } @@ -344,21 +344,21 @@ namespace Components if (*p == '^') { char color; - p++; + ++p; color = (*p - '0'); if (color < 9 && color > 0) { wattron(Console::OutputWindow, COLOR_PAIR(color + 2)); - p++; + ++p; continue; } } waddch(Console::OutputWindow, *p); - p++; + ++p; } wattron(Console::OutputWindow, COLOR_PAIR(9)); diff --git a/src/Components/Modules/Exception.cpp b/src/Components/Modules/Exception.cpp index f8f076a5..232bbe86 100644 --- a/src/Components/Modules/Exception.cpp +++ b/src/Components/Modules/Exception.cpp @@ -90,7 +90,7 @@ namespace Components else command.append(Utils::VA("wait 500;", mapname)); // Test direct map switch command.append(Utils::VA("map %s;", mapname)); - i++, current++; + ++i, ++current; if (current >= max) break; } diff --git a/src/Components/Modules/IPCPipe.cpp b/src/Components/Modules/IPCPipe.cpp index eabfcde7..fea00597 100644 --- a/src/Components/Modules/IPCPipe.cpp +++ b/src/Components/Modules/IPCPipe.cpp @@ -33,7 +33,7 @@ namespace Components if (this->ReconnectAttempt < IPC_MAX_RECONNECTS) { Logger::Print("Attempting to reconnect to the pipe.\n"); - this->ReconnectAttempt++; + ++this->ReconnectAttempt; std::this_thread::sleep_for(500ms); return this->Connect(name); diff --git a/src/Components/Modules/Node.cpp b/src/Components/Modules/Node.cpp index 5eb5ef5b..ef064dab 100644 --- a/src/Components/Modules/Node.cpp +++ b/src/Components/Modules/Node.cpp @@ -269,7 +269,7 @@ namespace Components // Register when unregistered and in UNKNOWN state (I doubt it's possible to be unregistered and in VALID state) if (!node.registered && (node.state != Node::STATE_NEGOTIATING && node.state != Node::STATE_INVALID)) { - registerCount++; + ++registerCount; node.state = Node::STATE_NEGOTIATING; Node::PerformRegistration(node.address); } @@ -284,7 +284,7 @@ namespace Components // Nvm, this is required for clients, as nodes don't send registration requests to clients. else if (node.state == STATE_INVALID && (Game::Com_Milliseconds() - node.lastTime) > NODE_QUERY_INTERVAL) { - registerCount++; + ++registerCount; Node::PerformRegistration(node.address); } } @@ -293,7 +293,7 @@ namespace Components { if (node.registered && node.state == Node::STATE_VALID && (!node.lastListQuery || (Game::Com_Milliseconds() - node.lastListQuery) > NODE_QUERY_INTERVAL)) { - listQueryCount++; + ++listQueryCount; node.state = Node::STATE_NEGOTIATING; node.lastTime = Game::Com_Milliseconds(); node.lastListQuery = Game::Com_Milliseconds(); @@ -698,7 +698,7 @@ namespace Components Network::Address _addr(list.address(i)); // Version 0 sends port in the wrong byte order! - if (entry->version <= 0) + if (entry->version == 0) { _addr.SetPort(ntohs(_addr.GetPort())); } @@ -845,7 +845,7 @@ namespace Components std::string signature = Utils::Cryptography::ECC::SignMessage(Node::SignatureKey, message); // Invalidate the message... - message[Utils::Cryptography::Rand::GenerateInt() % message.size()]++; + ++message[Utils::Cryptography::Rand::GenerateInt() % message.size()]; if (Utils::Cryptography::ECC::VerifyMessage(Node::SignatureKey, message, signature)) { diff --git a/src/Components/Modules/Party.cpp b/src/Components/Modules/Party.cpp index 62e6f5c7..f8970ec4 100644 --- a/src/Components/Modules/Party.cpp +++ b/src/Components/Modules/Party.cpp @@ -267,7 +267,7 @@ namespace Components { if (Game::svs_clients[i].state >= 3) { - clientCount++; + ++clientCount; } } } diff --git a/src/Components/Modules/RCon.cpp b/src/Components/Modules/RCon.cpp index cf5655f7..1305775e 100644 --- a/src/Components/Modules/RCon.cpp +++ b/src/Components/Modules/RCon.cpp @@ -49,7 +49,7 @@ namespace Components if (!Dedicated::IsDedicated()) return; // Load public key - uint8_t publicKey[] = + static uint8_t publicKey[] = { 0x04, 0x01, 0x9D, 0x18, 0x7F, 0x57, 0xD8, 0x95, 0x4C, 0xEE, 0xD0, 0x21, 0xB5, 0x00, 0x53, 0xEC, 0xEB, 0x54, 0x7C, 0x4C, 0x37, 0x18, 0x53, 0x89, diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index 3d21afb3..3254ce77 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -359,14 +359,14 @@ namespace Components { if (server.Addr == container.Target) { - ServerList::RefreshContainer.SendCount--; - ServerList::RefreshContainer.SentCount--; + --ServerList::RefreshContainer.SendCount; + --ServerList::RefreshContainer.SentCount; break; } } } - ServerList::RefreshContainer.SendCount++; + ++ServerList::RefreshContainer.SendCount; } if (acquireMutex) ServerList::RefreshContainer.Mutex.unlock(); @@ -542,7 +542,7 @@ namespace Components server->SendTime = Game::Com_Milliseconds(); server->Challenge = Utils::VA("%X", Utils::Cryptography::Rand::GenerateInt()); - ServerList::RefreshContainer.SentCount++; + ++ServerList::RefreshContainer.SentCount; Network::SendCommand(server->Target, "getinfo", server->Challenge); diff --git a/src/Components/Modules/StringTable.cpp b/src/Components/Modules/StringTable.cpp index b2c5cbe0..cc6785a4 100644 --- a/src/Components/Modules/StringTable.cpp +++ b/src/Components/Modules/StringTable.cpp @@ -13,7 +13,7 @@ namespace Components { hash = tolower(*data) + (31 * hash); - data++; + ++data; } return hash; diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index cb12a9bb..d0886ed4 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -368,7 +368,7 @@ namespace Game while (*string) { hash = (*string | 0x20) ^ (33 * hash); - string++; + ++string; } return hash; diff --git a/src/Utils/Cryptography.hpp b/src/Utils/Cryptography.hpp index fee89dab..a69843b7 100644 --- a/src/Utils/Cryptography.hpp +++ b/src/Utils/Cryptography.hpp @@ -35,7 +35,7 @@ namespace Utils } else { - this->TokenString[i]++; + ++this->TokenString[i]; break; } } @@ -47,7 +47,7 @@ namespace Utils Token operator++ (int) { Token result = *this; - ++(*this); + this->operator++(); return result; } @@ -149,7 +149,7 @@ namespace Utils public: Key() : KeyStorage(new ecc_key) { - ZeroMemory(this->KeyStorage.get(), sizeof(*this->GetKeyPtr())); + ZeroMemory(this->GetKeyPtr(), sizeof(*this->GetKeyPtr())); }; Key(ecc_key* key) : Key() { if(key) std::memmove(this->GetKeyPtr(), key, sizeof(*key)); }; Key(ecc_key key) : Key(&key) {}; @@ -244,7 +244,7 @@ namespace Utils public: Key() : KeyStorage(new rsa_key) { - ZeroMemory(this->KeyStorage.get(), sizeof(*this->GetKeyPtr())); + ZeroMemory(this->GetKeyPtr(), sizeof(*this->GetKeyPtr())); }; Key(rsa_key* key) : Key() { if (key) std::memmove(this->GetKeyPtr(), key, sizeof(*key)); }; Key(rsa_key key) : Key(&key) {};