]> git.sesse.net Git - vlc/commitdiff
Fix VLC_OBJECT expansion
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 10 Apr 2011 18:22:43 +0000 (21:22 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 10 Apr 2011 18:32:15 +0000 (21:32 +0300)
include/vlc_common.h

index 9cfd1a3eb6f44145a872fb9e4a18a5e898e2db9b..a922430f022663d0216caf05de836aa3f4df34b5 100644 (file)
@@ -533,12 +533,14 @@ typedef union
 #if defined( __GNUC__ ) && __GNUC__ > 3
 # ifndef __cplusplus
 #  define VLC_OBJECT( x ) \
-    __builtin_choose_expr(__builtin_offsetof(__typeof__(*x), psz_object_type), \
-                          (void)0 /* screw you */, (vlc_object_t *)(x))
+    __builtin_choose_expr( \
+        __builtin_offsetof(__typeof__(*(x)), psz_object_type), \
+        (void)0 /* screw you */, \
+        (vlc_object_t *)(x))
 # else
 #  define VLC_OBJECT( x ) \
     ((vlc_object_t *)(x) \
-      + 0 * __builtin_offsetof(__typeof__(*x), psz_object_type))
+      + 0 * __builtin_offsetof(__typeof__(*(x)), psz_object_type))
 # endif
 #else
 # define VLC_OBJECT( x ) ((vlc_object_t *)(x))