From df117f84cb9e148630f9f60f692fcc575280bff3 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 1 Jun 2022 20:48:20 +0200 Subject: [PATCH] REVIEWED: Narrowing issue with styles #179 Actually this issue is a bit tricky, C++ (g++ only) complains about narrowing on styles if `propertyValue` is assigned an hexadecimal value because it was not `unsigned int`, making it unsigned it avoids that error but then properties can only be positive... maybe we need some property value to be negative? Maybe this issue will require further review in the future. --- src/raygui.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index b6f80cc..e3f46f5 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -315,7 +315,7 @@ typedef struct GuiStyleProp { unsigned short controlId; unsigned short propertyId; - int propertyValue; + unsigned int propertyValue; } GuiStyleProp; // Gui control state @@ -3355,13 +3355,13 @@ void GuiLoadStyle(const char *fileName) { short controlId = 0; short propertyId = 0; - int propertyValue = 0; + unsigned int propertyValue = 0; for (int i = 0; i < propertyCount; i++) { fread(&controlId, 1, sizeof(short), rgsFile); fread(&propertyId, 1, sizeof(short), rgsFile); - fread(&propertyValue, 1, sizeof(int), rgsFile); + fread(&propertyValue, 1, sizeof(unsigned int), rgsFile); if (controlId == 0) // DEFAULT control {