From cbf06d8fa94672496d170c65ed9c328816e7eee0 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 30 Apr 2012 17:02:06 +0200 Subject: [PATCH] g_clear_pointer: use the same static checks than g_clear_object in glib-2-32 --- glib/gmem.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glib/gmem.h b/glib/gmem.h index cb250dc76..597bfdf60 100644 --- a/glib/gmem.h +++ b/glib/gmem.h @@ -99,11 +99,12 @@ gpointer g_try_realloc_n (gpointer mem, #define g_clear_pointer(pp, destroy) \ G_STMT_START { \ - G_STATIC_ASSERT (sizeof (*(pp)) == sizeof (gpointer)); \ + G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ /* Only one access, please */ \ - gpointer *_pp = (gpointer *) pp; \ + gpointer *_pp = (gpointer *) (pp); \ gpointer _p; \ \ + (void) (0 ? (gpointer) *(pp) : 0); \ do \ _p = g_atomic_pointer_get (_pp); \ while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_pp, _p, NULL)); \ -- 2.34.1