[glib: 1/8] Fix signedness warning in tests/thread-test.c




commit 3951ccffae110b6fb22436a828f14322cfaa125a
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Fri Nov 20 22:52:46 2020 +0100

    Fix signedness warning in tests/thread-test.c
    
    tests/thread-test.c: In function ‘test_g_static_private’:
    tests/thread-test.c:214:60: error: comparison of integer expressions of different signedness: ‘int’ and 
‘guint’ {aka ‘unsigned int’}
      214 |     g_assert (GPOINTER_TO_INT (g_thread_join (threads[i])) == i * 3);
          |                                                            ^~
    glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’
      941 | #define G_LIKELY(expr) (expr)
          |                         ^~~~
    tests/thread-test.c:214:5: note: in expansion of macro ‘g_assert’
      214 |     g_assert (GPOINTER_TO_INT (g_thread_join (threads[i])) == i * 3);
          |     ^~~~~~~~

 tests/thread-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/tests/thread-test.c b/tests/thread-test.c
index 17ac41f7b..883aa5424 100644
--- a/tests/thread-test.c
+++ b/tests/thread-test.c
@@ -211,7 +211,7 @@ test_g_static_private (void)
   test_g_static_private_ready = 0;
 
   for (i = 0; i < THREADS; i++)
-    g_assert (GPOINTER_TO_INT (g_thread_join (threads[i])) == i * 3);
+    g_assert (GPOINTER_TO_UINT (g_thread_join (threads[i])) == i * 3);
     
   g_assert (test_g_static_private_counter == 0); 
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]