summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-11-08 19:52:13 +0100
committerEmmanuel Fleury <emmanuel.fleury@gmail.com>2020-11-13 10:13:49 +0100
commit22929606901238f1966217fce0eae358e8bf4391 (patch)
tree9088b228b08ba41c73fa1a58e0c27f1ec34d93df
parent0c81ed309e6069639081845d2ba098abb2100ee2 (diff)
downloadglib-22929606901238f1966217fce0eae358e8bf4391.tar.gz
Fix signedness warning in glib/tests/spawn-multithreaded.c
glib/tests/spawn-multithreaded.c: In function ‘multithreaded_test_run’: glib/tests/spawn-multithreaded.c:41:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 41 | for (i = 0; i < n_threads; i++) | ^ glib/tests/spawn-multithreaded.c:49:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 49 | for (i = 0; i < n_threads; i++) | ^
-rw-r--r--glib/tests/spawn-multithreaded.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/glib/tests/spawn-multithreaded.c b/glib/tests/spawn-multithreaded.c
index 99f99b434..bf2c8a501 100644
--- a/glib/tests/spawn-multithreaded.c
+++ b/glib/tests/spawn-multithreaded.c
@@ -31,7 +31,7 @@ static char *echo_prog_path;
static void
multithreaded_test_run (GThreadFunc function)
{
- int i;
+ guint i;
GPtrArray *threads = g_ptr_array_new ();
guint n_threads;
@@ -42,7 +42,7 @@ multithreaded_test_run (GThreadFunc function)
{
GThread *thread;
- thread = g_thread_new ("test", function, GINT_TO_POINTER (i));
+ thread = g_thread_new ("test", function, GUINT_TO_POINTER (i));
g_ptr_array_add (threads, thread);
}
@@ -50,7 +50,7 @@ multithreaded_test_run (GThreadFunc function)
{
gpointer ret;
ret = g_thread_join (g_ptr_array_index (threads, i));
- g_assert_cmpint (GPOINTER_TO_INT (ret), ==, i);
+ g_assert_cmpint (GPOINTER_TO_UINT (ret), ==, i);
}
g_ptr_array_free (threads, TRUE);
}
@@ -58,14 +58,14 @@ multithreaded_test_run (GThreadFunc function)
static gpointer
test_spawn_sync_multithreaded_instance (gpointer data)
{
- int tnum = GPOINTER_TO_INT (data);
+ guint tnum = GPOINTER_TO_UINT (data);
GError *error = NULL;
GPtrArray *argv;
char *arg;
char *stdout_str;
int estatus;
- arg = g_strdup_printf ("thread %d", tnum);
+ arg = g_strdup_printf ("thread %u", tnum);
argv = g_ptr_array_new ();
g_ptr_array_add (argv, echo_prog_path);
@@ -79,7 +79,7 @@ test_spawn_sync_multithreaded_instance (gpointer data)
g_free (stdout_str);
g_ptr_array_free (argv, TRUE);
- return GINT_TO_POINTER (tnum);
+ return GUINT_TO_POINTER (tnum);
}
static void
@@ -147,7 +147,7 @@ on_child_stdout (GIOChannel *channel,
static gpointer
test_spawn_async_multithreaded_instance (gpointer thread_data)
{
- int tnum = GPOINTER_TO_INT (thread_data);
+ guint tnum = GPOINTER_TO_UINT (thread_data);
GError *error = NULL;
GPtrArray *argv;
char *arg;
@@ -162,7 +162,7 @@ test_spawn_async_multithreaded_instance (gpointer thread_data)
context = g_main_context_new ();
loop = g_main_loop_new (context, TRUE);
- arg = g_strdup_printf ("thread %d", tnum);
+ arg = g_strdup_printf ("thread %u", tnum);
argv = g_ptr_array_new ();
g_ptr_array_add (argv, echo_prog_path);
@@ -203,7 +203,7 @@ test_spawn_async_multithreaded_instance (gpointer thread_data)
g_free (arg);
- return GINT_TO_POINTER (tnum);
+ return GUINT_TO_POINTER (tnum);
}
static void