[glib: 6/7] Fix incompatible pointer to integer conversion warning in glib/tests/atomic.c




commit bf536a5ce27ace53e3d747740b9cd9f25d9dc0e8
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Tue May 4 09:34:16 2021 +0200

    Fix incompatible pointer to integer conversion warning in glib/tests/atomic.c
    
    lib/tests/atomic.c:115:9: warning: incompatible pointer to integer conversion passing 'void *' to 
parameter of type 'gsize' (aka 'unsigned long')
      res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    glib/gatomic.h:225:34: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
                                     (newval), FALSE,                            \
                                     ^~~~~~~~

 glib/tests/atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/tests/atomic.c b/glib/tests/atomic.c
index 82d98b2db..fb8cdcd46 100644
--- a/glib/tests/atomic.c
+++ b/glib/tests/atomic.c
@@ -112,7 +112,7 @@ test_types (void)
   vp2 = (gpointer) g_atomic_pointer_get (&gs);
   gs2 = (gsize) vp2;
   g_assert_cmpuint (gs2, ==, 0);
-  res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL);
+  res = g_atomic_pointer_compare_and_exchange (&gs, NULL, (gsize) NULL);
   g_assert_true (res);
   g_assert_cmpuint (gs, ==, 0);
   gs2 = (gsize) g_atomic_pointer_add (&gs, 5);


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