From 81332ab9033d9f606c642c5127f4220aecdc6f8d Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 14 Dec 2022 23:55:19 +0000 Subject: [PATCH] array-test: Don't assume sizeof(void*)==sizeof(gsize) Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842 --- glib/tests/array-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c index da6cb2977..70f56e8a1 100644 --- a/glib/tests/array-test.c +++ b/glib/tests/array-test.c @@ -2202,7 +2202,7 @@ pointer_array_extend_and_steal (void) GPtrArray *ptr_array, *ptr_array2, *ptr_array3; gsize i; const gsize array_size = 100; - gsize *array_test = g_malloc (array_size * sizeof (gsize)); + guintptr *array_test = g_malloc (array_size * sizeof (guintptr)); /* Initializing array_test */ for (i = 0; i < array_size; i++) @@ -2221,7 +2221,7 @@ pointer_array_extend_and_steal (void) g_ptr_array_extend_and_steal (ptr_array, ptr_array2); for (i = 0; i < array_size; i++) - g_assert_cmpuint (*((gsize *) g_ptr_array_index (ptr_array, i)), ==, i); + g_assert_cmpuint (*((guintptr *) g_ptr_array_index (ptr_array, i)), ==, i); g_ptr_array_free (ptr_array, TRUE); @@ -2240,7 +2240,7 @@ pointer_array_extend_and_steal (void) g_ptr_array_extend_and_steal (ptr_array, ptr_array2); for (i = 0; i < array_size; i++) - g_assert_cmpuint (*((gsize *) g_ptr_array_index (ptr_array, i)), ==, i); + g_assert_cmpuint (*((guintptr *) g_ptr_array_index (ptr_array, i)), ==, i); g_assert_cmpuint (ptr_array3->len, ==, 0); g_assert_null (ptr_array3->pdata);