mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-11 23:23:47 +02:00
Bug 612502 - build fails on glib/tests/gvariant.c
Fix two problems caught by Tim Rice. - non-constant expression used as array size - arithmetic on void *
This commit is contained in:
parent
1953b4087f
commit
751feb916a
@ -1251,7 +1251,7 @@ flavoured_malloc (gsize size, gsize flavour)
|
|||||||
if (size == 0)
|
if (size == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return g_malloc (size + flavour) + flavour;
|
return ((gchar *) g_malloc (size + flavour)) + flavour;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3341,8 +3341,7 @@ test_builder_memory (void)
|
|||||||
static void
|
static void
|
||||||
test_hashing (void)
|
test_hashing (void)
|
||||||
{
|
{
|
||||||
const gint n_items = 4096;
|
GVariant *items[4096];
|
||||||
GVariant *items[n_items];
|
|
||||||
GHashTable *table;
|
GHashTable *table;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
@ -3350,7 +3349,7 @@ test_hashing (void)
|
|||||||
(GDestroyNotify ) g_variant_unref,
|
(GDestroyNotify ) g_variant_unref,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
for (i = 0; i < n_items; i++)
|
for (i = 0; i < G_N_ELEMENTS (items); i++)
|
||||||
{
|
{
|
||||||
TreeInstance *tree;
|
TreeInstance *tree;
|
||||||
gint j;
|
gint j;
|
||||||
@ -3372,7 +3371,7 @@ test_hashing (void)
|
|||||||
GINT_TO_POINTER (i));
|
GINT_TO_POINTER (i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < n_items; i++)
|
for (i = 0; i < G_N_ELEMENTS (items); i++)
|
||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user