diff options
author | Colin Walters <walters@verbum.org> | 2012-11-06 11:48:36 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-11-12 11:43:09 -0500 |
commit | ac7376e0b2671ac6cb12c69b0289e029a3c2302b (patch) | |
tree | dde072db0d69568ab9d027b35599ff28fcaaa20f /tests/scanner/regress.h | |
parent | 75148f33bbff9eed6164c0c02c584916fd127396 (diff) | |
download | gobject-introspection-ac7376e0b2671ac6cb12c69b0289e029a3c2302b.tar.gz |
scanner: Correctly handle large 64 bit integer constants
In C, positive integer constants are by default unsigned. This means
an expression like 0x8000000000000000 will be "unsigned long long".
In the actual scanner code, we were parsing them as "gint64", and
storing them as gint64. This was incorrect; we need to parse them
as guint64, and store the bits we get from that. This gives us
an equivalent result to what the C compiler does.
However, when we actually return the value as a Python "long"
(arbitrary length integer), we need to treat the value as unsigned if
the result indicated it was.
https://bugzilla.gnome.org/show_bug.cgi?id=685022
Conflicts:
tests/scanner/Regress-1.0-expected.gir
tests/scanner/regress.h
Diffstat (limited to 'tests/scanner/regress.h')
-rw-r--r-- | tests/scanner/regress.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index 635ea7bd..e1024b04 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -255,6 +255,7 @@ GQuark regress_atest_error_quark (void); /* constants */ +#define REGRESS_NEGATIVE_INT_CONSTANT -42 #define REGRESS_INT_CONSTANT 4422 #define REGRESS_DOUBLE_CONSTANT 44.22 #define REGRESS_STRING_CONSTANT "Some String" @@ -899,4 +900,8 @@ typedef struct { double dummy2; } RegressLikeGnomeKeyringPasswordSchema; +/* https://bugzilla.gnome.org/show_bug.cgi?id=685022 */ +#define REGRESS_MININT64 ((gint64) G_GINT64_CONSTANT(0x8000000000000000)) +#define REGRESS_MAXUINT64 (G_GINT64_CONSTANT(0xffffffffffffffffU)) + #endif /* __GITESTTYPES_H__ */ |