projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19ac408
)
g_clear_pointer: use the same static checks than g_clear_object in glib-2-32
author
Xavier Claessens
<xavier.claessens@collabora.co.uk>
Mon, 30 Apr 2012 15:02:06 +0000
(17:02 +0200)
committer
Xavier Claessens
<xavier.claessens@collabora.co.uk>
Mon, 30 Apr 2012 15:03:31 +0000
(17:03 +0200)
glib/gmem.h
patch
|
blob
|
history
diff --git
a/glib/gmem.h
b/glib/gmem.h
index
cb250dc
..
597bfdf
100644
(file)
--- 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)); \