diff --git a/client/includes/raygui.h b/client/includes/raygui.h index aa28a8d..fd5f72c 100644 --- a/client/includes/raygui.h +++ b/client/includes/raygui.h @@ -1,5 +1,9 @@ /******************************************************************************************* * +* CUSTOM MODIFICATIONS: +* - Added pragma directives to suppress compilation warnings +* - IMPORTANT: Keep these pragmas when updating the library! +* * raygui v4.5-dev - A simple and easy-to-use immediate-mode gui library * * DESCRIPTION: @@ -338,6 +342,14 @@ #ifndef RAYGUI_H #define RAYGUI_H +// Suppress GCC warnings for this header +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + #define RAYGUI_VERSION_MAJOR 4 #define RAYGUI_VERSION_MINOR 5 #define RAYGUI_VERSION_PATCH 0 @@ -5991,3 +6003,8 @@ static int GetCodepointNext(const char *text, int *codepointSize) #endif // RAYGUI_STANDALONE #endif // RAYGUI_IMPLEMENTATION + +// Restore GCC diagnostic settings +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif diff --git a/client/net/NetworkManager.cpp b/client/net/NetworkManager.cpp index 7175ef1..fd1d27d 100644 --- a/client/net/NetworkManager.cpp +++ b/client/net/NetworkManager.cpp @@ -73,7 +73,7 @@ void NetworkManager::handleSpawn(const uint8_t* data, std::size_t size) { std::memcpy(&z, &data[13], sizeof(z)); uint8_t colorLen = data[17]; - if (size >= 18 + colorLen) { + if (size >= 18u + colorLen) { playerColor = std::string(reinterpret_cast(&data[18]), colorLen); } @@ -121,7 +121,7 @@ void NetworkManager::handlePlayerJoined(const uint8_t* data, std::size_t size) { uint8_t colorLen = data[17]; std::string color = "red"; - if (size >= 18 + colorLen) { + if (size >= 18u + colorLen) { color = std::string(reinterpret_cast(&data[18]), colorLen); } @@ -273,7 +273,7 @@ void NetworkManager::handleColorChanged(const uint8_t* data, std::size_t size) { std::memcpy(&id, &data[1], sizeof(id)); uint8_t colorLen = data[5]; - if (size >= 6 + colorLen) { + if (size >= 6u + colorLen) { std::string newColor(reinterpret_cast(&data[6]), colorLen); if (id == playerID) { @@ -301,7 +301,7 @@ void NetworkManager::handleLoginResponse(const uint8_t* data, std::size_t size) uint8_t success = data[1]; uint8_t msgLen = data[2]; - if (size >= 3 + msgLen) { + if (size >= 3u + msgLen) { std::string message(reinterpret_cast(&data[3]), msgLen); if (success == 0) {