diff --git a/gobject/tests/ifaceproperties.c b/gobject/tests/ifaceproperties.c index 3356da0b3..9ee09cbfa 100644 --- a/gobject/tests/ifaceproperties.c +++ b/gobject/tests/ifaceproperties.c @@ -396,9 +396,9 @@ static DEFINE_TYPE (DerivedObject, derived_object, static void assert_in_properties (GParamSpec *param_spec, GParamSpec **properties, - gint n_properties) + size_t n_properties) { - gint i; + size_t i; gboolean found = FALSE; for (i = 0; i < n_properties; i++) diff --git a/gobject/tests/param.c b/gobject/tests/param.c index 9d49c3648..22375f4d5 100644 --- a/gobject/tests/param.c +++ b/gobject/tests/param.c @@ -1376,10 +1376,10 @@ static void test_implementation_class_init (TestImplementationClass *class) } typedef struct { - gint change_this_flag; - gint change_this_type; - gint use_this_flag; - gint use_this_type; + guint change_this_flag; + guint change_this_type; + guint use_this_flag; + guint use_this_type; } TestParamImplementData; static void @@ -1433,7 +1433,7 @@ test_param_implement (void) continue; } - test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d", + test_path = g_strdup_printf ("/param/implement/subprocess/%u-%u-%u-%u", change_this_flag, change_this_type, use_this_flag, use_this_type); g_test_trap_subprocess (test_path, G_TIME_SPAN_SECOND, @@ -1545,8 +1545,8 @@ param_int_init (GParamSpec *pspec) { GParamSpecInt *ispec = (GParamSpecInt *)pspec; - ispec->minimum = 0x7fffffff; - ispec->maximum = 0x80000000; + ispec->minimum = (int) 0x7fffffff; + ispec->maximum = (int) 0x80000000; ispec->default_value = 0; } @@ -1686,7 +1686,7 @@ main (int argc, char *argv[]) for (data.use_this_flag = 0; data.use_this_flag < 16; data.use_this_flag++) for (data.use_this_type = 0; data.use_this_type < 4; data.use_this_type++) { - test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d", + test_path = g_strdup_printf ("/param/implement/subprocess/%u-%u-%u-%u", data.change_this_flag, data.change_this_type, data.use_this_flag, data.use_this_type); test_data = g_memdup2 (&data, sizeof (TestParamImplementData)); diff --git a/gobject/tests/properties-refcount1.c b/gobject/tests/properties-refcount1.c index 5a96518dc..532e15048 100644 --- a/gobject/tests/properties-refcount1.c +++ b/gobject/tests/properties-refcount1.c @@ -23,7 +23,7 @@ typedef struct _GTestClass GTestClass; struct _GTest { GObject object; - gint id; + unsigned int id; gint dummy; gint count; diff --git a/gobject/tests/properties-refcount3.c b/gobject/tests/properties-refcount3.c index 802689283..fd55f0c0d 100644 --- a/gobject/tests/properties-refcount3.c +++ b/gobject/tests/properties-refcount3.c @@ -19,7 +19,7 @@ typedef struct _GTestClass GTestClass; struct _GTest { GObject object; - gint id; + unsigned int id; gint dummy; gint count; diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c index b91046eea..a11e92038 100644 --- a/gobject/tests/signals.c +++ b/gobject/tests/signals.c @@ -1705,7 +1705,7 @@ test_clear_signal_handler (void) if (g_test_undefined ()) { - handler = g_random_int_range (0x01, 0xFF); + handler = (gulong) g_random_int_range (0x01, 0xFF); g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, "*instance '* has no handler with id *'"); g_clear_signal_handler (&handler, test_obj); diff --git a/gobject/tests/threadtests.c b/gobject/tests/threadtests.c index 9b923f3fd..2ae257859 100644 --- a/gobject/tests/threadtests.c +++ b/gobject/tests/threadtests.c @@ -220,8 +220,8 @@ test_threaded_object_init (void) } typedef struct { - MyTester0 *strong; - guint unref_delay; + MyTester0 *strong; + gulong unref_delay; } UnrefInThreadData; static gpointer @@ -269,7 +269,7 @@ test_threaded_weak_ref (void) gpointer weak; #endif MyTester0 *strengthened; - guint get_delay; + gulong get_delay; GThread *thread; GError *error = NULL; @@ -290,8 +290,8 @@ test_threaded_weak_ref (void) * timing. Ideally, we want each side to win half the races; on * smcv's laptop, these timings are about right. */ - data.unref_delay = g_random_int_range (SLEEP_MIN_USEC / 2, SLEEP_MAX_USEC / 2); - get_delay = g_random_int_range (SLEEP_MIN_USEC, SLEEP_MAX_USEC); + data.unref_delay = (gulong) g_random_int_range (SLEEP_MIN_USEC / 2, SLEEP_MAX_USEC / 2); + get_delay = (gulong) g_random_int_range (SLEEP_MIN_USEC, SLEEP_MAX_USEC); /* One half of the race is to unref the shared object */ thread = g_thread_create (unref_in_thread, &data, TRUE, &error); diff --git a/gobject/tests/type.c b/gobject/tests/type.c index 9cecf3bf2..372596e39 100644 --- a/gobject/tests/type.c +++ b/gobject/tests/type.c @@ -3,7 +3,7 @@ static void test_registration_serial (void) { - gint serial1, serial2, serial3; + guint serial1, serial2, serial3; serial1 = g_type_get_type_registration_serial (); g_pointer_type_register_static ("my+pointer"); diff --git a/gobject/tests/value.c b/gobject/tests/value.c index 105a20d84..e1c647d71 100644 --- a/gobject/tests/value.c +++ b/gobject/tests/value.c @@ -633,9 +633,9 @@ test_valuearray_basic (void) a = g_value_array_new (20); g_value_init (&v, G_TYPE_INT); - for (i = 0; i < 100; i++) + for (int j = 0; j < 100; j++) { - g_value_set_int (&v, i); + g_value_set_int (&v, j); g_value_array_append (a, &v); } @@ -646,9 +646,9 @@ test_valuearray_basic (void) for (i = 20; i < 100; i+= 5) g_value_array_remove (a, 100 - i); - for (i = 100; i < 150; i++) + for (int j = 100; j < 150; j++) { - g_value_set_int (&v, i); + g_value_set_int (&v, j); g_value_array_prepend (a, &v); } @@ -692,7 +692,7 @@ test_value_array_sort_with_data (void) /* Add some values and try sorting them. */ g_value_init (&v, G_TYPE_INT); - for (unsigned int i = 0; i < 100; i++) + for (int i = 0; i < 100; i++) { g_value_set_int (&v, 100 - i); g_value_array_append (a, &v);