[gobject-introspection] scanner: Emit correct type for unsigned integer constants



commit db71321a5b23715ac047058e56c1fcb6a5985376
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 6 11:48:36 2012 -0500

    scanner: Emit correct type for unsigned integer constants
    
    Otherwise bindings will break.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685022

 giscanner/scannerparser.y              |    2 +-
 tests/scanner/Regress-1.0-expected.gir |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 82ee1d7..773e961 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -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 ')'
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 17d9d78..a895a76 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -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"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]