diff --git a/glib/ghash.c b/glib/ghash.c index 132e3ac5e..500d503c3 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -251,7 +251,8 @@ #define BIG_ENTRY_SIZE (SIZEOF_VOID_P) #define SMALL_ENTRY_SIZE (SIZEOF_INT) -#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE +/* NB: The USE_SMALL_ARRAYS code assumes pointers are at most 8 bytes. */ +#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE && BIG_ENTRY_SIZE <= 8 # define USE_SMALL_ARRAYS #endif @@ -292,7 +293,7 @@ typedef struct gpointer dummy2; gint position; gboolean dummy3; - gint version; + gintptr version; } RealIter; G_STATIC_ASSERT (sizeof (GHashTableIter) == sizeof (RealIter)); diff --git a/glib/gvariant.c b/glib/gvariant.c index be2ffb860..d7b305188 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -2951,6 +2951,8 @@ struct heap_iter gsize magic; }; +G_STATIC_ASSERT (sizeof (struct heap_iter) <= sizeof (GVariantIter)); + #define GVSI(i) ((struct stack_iter *) (i)) #define GVHI(i) ((struct heap_iter *) (i)) #define GVSI_MAGIC ((gsize) 3579507750u) @@ -3220,7 +3222,7 @@ struct heap_builder /* Just to make sure that by adding a union to GVariantBuilder, we * didn't accidentally change ABI. */ -G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (gsize[16])); +G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (guintptr[16])); static gboolean ensure_valid_builder (GVariantBuilder *builder) @@ -3907,7 +3909,7 @@ struct heap_dict /* Just to make sure that by adding a union to GVariantDict, we didn't * accidentally change ABI. */ -G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (gsize[16])); +G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (guintptr[16])); static gboolean ensure_valid_dict (GVariantDict *dict) diff --git a/glib/gvariant.h b/glib/gvariant.h index e7087a1f6..bdc37951d 100644 --- a/glib/gvariant.h +++ b/glib/gvariant.h @@ -270,7 +270,7 @@ GVariant * g_variant_new_from_data (const G typedef struct _GVariantIter GVariantIter; struct _GVariantIter { /*< private >*/ - gsize x[16]; + guintptr x[16]; }; GLIB_AVAILABLE_IN_ALL @@ -304,9 +304,9 @@ struct _GVariantBuilder { struct { gsize partial_magic; const GVariantType *type; - gsize y[14]; + guintptr y[14]; } s; - gsize x[16]; + guintptr x[16]; } u; }; @@ -453,9 +453,9 @@ struct _GVariantDict { struct { GVariant *asv; gsize partial_magic; - gsize y[14]; + guintptr y[14]; } s; - gsize x[16]; + guintptr x[16]; } u; };