mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
gthread: Fix "zero as null pointer" warning
When compiling a program using glib with -Wzero-as-null-pointer-constant warnings enabled, the compiler warns about this type check in the g_once_init_enter macro. Fix by replacing "0" with "NULL".
This commit is contained in:
parent
d8c5bcbb7d
commit
be15a60bda
@ -247,7 +247,7 @@ void g_once_init_leave (volatile void *location,
|
|||||||
# define g_once_init_enter(location) \
|
# define g_once_init_enter(location) \
|
||||||
(G_GNUC_EXTENSION ({ \
|
(G_GNUC_EXTENSION ({ \
|
||||||
G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer)); \
|
G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer)); \
|
||||||
(void) (0 ? (gpointer) *(location) : 0); \
|
(void) (0 ? (gpointer) *(location) : NULL); \
|
||||||
(!g_atomic_pointer_get (location) && \
|
(!g_atomic_pointer_get (location) && \
|
||||||
g_once_init_enter (location)); \
|
g_once_init_enter (location)); \
|
||||||
}))
|
}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user