1
0

clean up compilation errors

This commit is contained in:
Sky Johnson 2025-09-09 13:26:12 -05:00
parent ed939adbfc
commit 90730990ca
2 changed files with 21 additions and 4 deletions

View File

@ -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 * raygui v4.5-dev - A simple and easy-to-use immediate-mode gui library
* *
* DESCRIPTION: * DESCRIPTION:
@ -338,6 +342,14 @@
#ifndef RAYGUI_H #ifndef RAYGUI_H
#define 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_MAJOR 4
#define RAYGUI_VERSION_MINOR 5 #define RAYGUI_VERSION_MINOR 5
#define RAYGUI_VERSION_PATCH 0 #define RAYGUI_VERSION_PATCH 0
@ -5991,3 +6003,8 @@ static int GetCodepointNext(const char *text, int *codepointSize)
#endif // RAYGUI_STANDALONE #endif // RAYGUI_STANDALONE
#endif // RAYGUI_IMPLEMENTATION #endif // RAYGUI_IMPLEMENTATION
// Restore GCC diagnostic settings
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

View File

@ -73,7 +73,7 @@ void NetworkManager::handleSpawn(const uint8_t* data, std::size_t size) {
std::memcpy(&z, &data[13], sizeof(z)); std::memcpy(&z, &data[13], sizeof(z));
uint8_t colorLen = data[17]; uint8_t colorLen = data[17];
if (size >= 18 + colorLen) { if (size >= 18u + colorLen) {
playerColor = std::string(reinterpret_cast<const char*>(&data[18]), colorLen); playerColor = std::string(reinterpret_cast<const char*>(&data[18]), colorLen);
} }
@ -121,7 +121,7 @@ void NetworkManager::handlePlayerJoined(const uint8_t* data, std::size_t size) {
uint8_t colorLen = data[17]; uint8_t colorLen = data[17];
std::string color = "red"; std::string color = "red";
if (size >= 18 + colorLen) { if (size >= 18u + colorLen) {
color = std::string(reinterpret_cast<const char*>(&data[18]), colorLen); color = std::string(reinterpret_cast<const char*>(&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)); std::memcpy(&id, &data[1], sizeof(id));
uint8_t colorLen = data[5]; uint8_t colorLen = data[5];
if (size >= 6 + colorLen) { if (size >= 6u + colorLen) {
std::string newColor(reinterpret_cast<const char*>(&data[6]), colorLen); std::string newColor(reinterpret_cast<const char*>(&data[6]), colorLen);
if (id == playerID) { 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 success = data[1];
uint8_t msgLen = data[2]; uint8_t msgLen = data[2];
if (size >= 3 + msgLen) { if (size >= 3u + msgLen) {
std::string message(reinterpret_cast<const char*>(&data[3]), msgLen); std::string message(reinterpret_cast<const char*>(&data[3]), msgLen);
if (success == 0) { if (success == 0) {