gthread-win32: Fix conversion error from pointer to integer

glib/gthread-win32.c:359:16: error: incompatible integer to pointer conversion passing 'DWORD' (aka 'unsigned long') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
          if (!g_atomic_pointer_compare_and_exchange (&key->p, NULL, impl))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/gatomic.h:257:73: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
    __atomic_compare_exchange_n ((atomic), (void *) (&(gapcae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                                                        ^~~~~~~~
This commit is contained in:
Biswapriyo Nath 2022-09-20 11:52:48 +05:30
parent 51cf76ebb0
commit 4f72d3bce7

View File

@ -356,7 +356,7 @@ g_private_get_impl (GPrivate *key)
} }
/* Ditto, due to the unlocked access on the fast path */ /* Ditto, due to the unlocked access on the fast path */
if (!g_atomic_pointer_compare_and_exchange (&key->p, NULL, impl)) if (!g_atomic_pointer_compare_and_exchange (&key->p, NULL, GUINT_TO_POINTER (impl)))
g_thread_abort (0, "g_private_get_impl(2)"); g_thread_abort (0, "g_private_get_impl(2)");
} }
LeaveCriticalSection (&g_private_lock); LeaveCriticalSection (&g_private_lock);