mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 08:58:54 +02:00
Handle enumerations with the full range of signed and unsigned values
The C compiler will pick an enumeration type that accomodates the specified values for the enumeration, so ignoring 64-bit enumerations, we can have enumeration values from MININT32 to MAXUINT32. To handle this properly: - Use gint64 for holding eumeration values when scanning - Add a 'unsigned_value' bit to ValueBlob so we can distinguish the int32 vs. uint32 cases in the typelib - Change the return value of g_value_info_get_value() to gint64. https://bugzilla.gnome.org/show_bug.cgi?id=629704
This commit is contained in:
@@ -632,6 +632,7 @@ typedef struct {
|
||||
/**
|
||||
* ValueBlob:
|
||||
* @deprecated: Whether this value is deprecated
|
||||
* @unsigned_value: if set, value is a 32-bit unsigned integer cast to gint32
|
||||
* @value: The numerical value
|
||||
* @name: Name of blob
|
||||
*
|
||||
@@ -639,8 +640,9 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
guint32 deprecated : 1;
|
||||
guint32 unsigned_value : 1;
|
||||
/* <private> */
|
||||
guint32 reserved :31;
|
||||
guint32 reserved :30;
|
||||
/* <public> */
|
||||
guint32 name;
|
||||
gint32 value;
|
||||
|
Reference in New Issue
Block a user