summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2010-09-14 11:59:03 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2010-11-01 17:25:45 -0400
commit8916db0a3831cb5e6c3b714125f7596f43d6aa6a (patch)
treec4d523a925a666be85bfdaea804407ca782778f7 /girepository/girparser.c
parent29ec4294d9232dcfd7cfec4e20c0e302a5ff3e80 (diff)
downloadgobject-introspection-8916db0a3831cb5e6c3b714125f7596f43d6aa6a.tar.gz
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
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 8f8f6f4d..42525ecd 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1440,7 +1440,7 @@ start_property (GMarkupParseContext *context,
return TRUE;
}
-static gint
+static gint64
parse_value (const gchar *str)
{
gchar *shift_op;
@@ -1450,15 +1450,15 @@ parse_value (const gchar *str)
if (shift_op)
{
- gint base, shift;
+ gint64 base, shift;
- base = strtol (str, NULL, 10);
- shift = strtol (shift_op + 3, NULL, 10);
+ base = g_ascii_strtoll (str, NULL, 10);
+ shift = g_ascii_strtoll (shift_op + 3, NULL, 10);
return base << shift;
}
else
- return strtol (str, NULL, 10);
+ return g_ascii_strtoll (str, NULL, 10);
return 0;
}