From 4f72d3bce7a00aace1126758d499bb7e7517f694 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Tue, 20 Sep 2022 11:52:48 +0530 Subject: [PATCH] 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; \ ^~~~~~~~ --- glib/gthread-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c index 801052050..25fbe54db 100644 --- a/glib/gthread-win32.c +++ b/glib/gthread-win32.c @@ -356,7 +356,7 @@ g_private_get_impl (GPrivate *key) } /* 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)"); } LeaveCriticalSection (&g_private_lock);