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:
Owen W. Taylor
2010-09-14 11:59:03 -04:00
parent 7fa7162361
commit ec76ea8628
8 changed files with 28 additions and 17 deletions

View File

@@ -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;