mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38: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:
@@ -2201,8 +2201,9 @@ g_ir_node_build_typelib (GIrNode *node,
|
||||
|
||||
blob->deprecated = value->deprecated;
|
||||
blob->reserved = 0;
|
||||
blob->unsigned_value = value->value >= 0 ? 1 : 0;
|
||||
blob->name = write_string (node->name, strings, data, offset2);
|
||||
blob->value = value->value;
|
||||
blob->value = (gint32)value->value;
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user