mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
girparser: Use INTEGER_ALIAS to reduce repetition
As a special case, keep the historical behaviour of treating gchar as being signed, both on platforms where it is genuinely signed (for example x86 Linux) and where it is unsigned (for example ARM, s390x and PowerPC Linux). Changing gchar to use INTEGER_ALIAS would have a regression risk, so if we want to do that, it should be as a separate change. No functional change intended. Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
parent
d02f5816bf
commit
7c41a6529b
@ -462,19 +462,23 @@ G_STATIC_ASSERT (signedness (int) == 1);
|
|||||||
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
||||||
|
|
||||||
static IntegerAliasInfo integer_aliases[] = {
|
static IntegerAliasInfo integer_aliases[] = {
|
||||||
{ "gchar", sizeof (gchar), 1 },
|
/* It is platform-dependent whether gchar is signed or unsigned, but
|
||||||
{ "guchar", sizeof (guchar), 0 },
|
* GObject-Introspection has traditionally treated it as signed,
|
||||||
{ "gshort", sizeof (gshort), 1 },
|
* so continue to hard-code that instead of using INTEGER_ALIAS */
|
||||||
{ "gushort", sizeof (gushort), 0 },
|
{ "gchar", sizeof (gchar), 1 },
|
||||||
{ "gint", sizeof (gint), 1 },
|
|
||||||
{ "guint", sizeof (guint), 0 },
|
|
||||||
{ "glong", sizeof (glong), 1 },
|
|
||||||
{ "gulong", sizeof (gulong), 0 },
|
|
||||||
{ "gssize", sizeof (gssize), 1 },
|
|
||||||
{ "gsize", sizeof (gsize), 0 },
|
|
||||||
{ "gintptr", sizeof (gintptr), 1 },
|
|
||||||
{ "guintptr", sizeof (guintptr), 0 },
|
|
||||||
#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
|
#define INTEGER_ALIAS(T) { #T, sizeof (T), signedness (T) }
|
||||||
|
INTEGER_ALIAS (guchar),
|
||||||
|
INTEGER_ALIAS (gshort),
|
||||||
|
INTEGER_ALIAS (gushort),
|
||||||
|
INTEGER_ALIAS (gint),
|
||||||
|
INTEGER_ALIAS (guint),
|
||||||
|
INTEGER_ALIAS (glong),
|
||||||
|
INTEGER_ALIAS (gulong),
|
||||||
|
INTEGER_ALIAS (gssize),
|
||||||
|
INTEGER_ALIAS (gsize),
|
||||||
|
INTEGER_ALIAS (gintptr),
|
||||||
|
INTEGER_ALIAS (guintptr),
|
||||||
INTEGER_ALIAS (off_t),
|
INTEGER_ALIAS (off_t),
|
||||||
INTEGER_ALIAS (time_t),
|
INTEGER_ALIAS (time_t),
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
|
Loading…
Reference in New Issue
Block a user