mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 03:09:17 -05:00
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.
This commit is contained in:
@ -315,7 +315,7 @@
|
|||||||
typedef struct GuiStyleProp {
|
typedef struct GuiStyleProp {
|
||||||
unsigned short controlId;
|
unsigned short controlId;
|
||||||
unsigned short propertyId;
|
unsigned short propertyId;
|
||||||
int propertyValue;
|
unsigned int propertyValue;
|
||||||
} GuiStyleProp;
|
} GuiStyleProp;
|
||||||
|
|
||||||
// Gui control state
|
// Gui control state
|
||||||
@ -3355,13 +3355,13 @@ void GuiLoadStyle(const char *fileName)
|
|||||||
{
|
{
|
||||||
short controlId = 0;
|
short controlId = 0;
|
||||||
short propertyId = 0;
|
short propertyId = 0;
|
||||||
int propertyValue = 0;
|
unsigned int propertyValue = 0;
|
||||||
|
|
||||||
for (int i = 0; i < propertyCount; i++)
|
for (int i = 0; i < propertyCount; i++)
|
||||||
{
|
{
|
||||||
fread(&controlId, 1, sizeof(short), rgsFile);
|
fread(&controlId, 1, sizeof(short), rgsFile);
|
||||||
fread(&propertyId, 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
|
if (controlId == 0) // DEFAULT control
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user