raysan5 / raygui

A simple and easy-to-use immediate-mode gui library
zlib License
3.36k stars 289 forks source link

Change GuiStyleProp propertyValue from int to unsigned int #360

Closed tyqualters closed 8 months ago

tyqualters commented 8 months ago

VERSION raylib 5.0 / raygui 4.0

raygui.h line 450

typedef struct GuiStyleProp {
    unsigned short controlId;   // Control identifier
    unsigned short propertyId;  // Property identifier
    int propertyValue;          // Property value
} GuiStyleProp;

Requesting change int propertyValue; to unsigned int propertyValue;

typedef struct GuiStyleProp {
    unsigned short controlId;   // Control identifier
    unsigned short propertyId;  // Property identifier
    unsigned int propertyValue;          // Property value
} GuiStyleProp;

Reason being that there is a possible narrowing conversion to MAXINT, and C++ (unlike C) will throw a lot of errors when trying to use any of the default styles (e.g. /styles/cyber/stylecyber.h) because of this narrowing conversion. This change fixes that issue and allows C++ to build.

raysan5 commented 8 months ago

@tyqualters I'm afraid it's not possible to change this type because some properties could have negative values, for example TEXT_SPACING.