scanner: Emit correct type for unsigned integer constants
authorColin Walters <walters@verbum.org>
Tue, 6 Nov 2012 16:48:36 +0000 (11:48 -0500)
committerColin Walters <walters@verbum.org>
Wed, 7 Nov 2012 11:39:44 +0000 (06:39 -0500)
Otherwise bindings will break.

https://bugzilla.gnome.org/show_bug.cgi?id=685022

giscanner/scannerparser.y
tests/scanner/Regress-1.0-expected.gir

index 82ee1d7..773e961 100644 (file)
@@ -386,7 +386,7 @@ unary_expression
          {
                $$ = $3;
                if ($$->const_int_set) {
-                       $$->base_type = gi_source_basic_type_new ("gint64");
+                       $$->base_type = gi_source_basic_type_new ($$->const_int_is_unsigned ? "guint64" : "gint64");
                }
          }
        | INTUL_CONST '(' unary_expression ')'
index 17d9d78..a895a76 100644 (file)
@@ -93,7 +93,7 @@ and/or use gtk-doc annotations.  -->
     <constant name="MAXUINT64"
               value="18446744073709551615"
               c:type="REGRESS_MAXUINT64">
-      <type name="gint64" c:type="gint64"/>
+      <type name="guint64" c:type="guint64"/>
     </constant>
     <constant name="MININT64"
               value="-9223372036854775808"