[cairo-commit] src/cairoint.h

Jeff Muizelaar jrmuizel at kemper.freedesktop.org
Mon May 10 12:07:29 PDT 2010


 src/cairoint.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ee446910aa1db0ca0b54791a2ef3bb24b277c9a4
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date:   Mon May 10 15:06:25 2010 -0400

    Add an additional set parantheses around the container_of macro
    
    The non-__GNUC__ version of the container_of macro would do wrong
    when used like container_of(...)-> because '->' binds tighter
    than the cast in the container_of macro. Adding an additional
    set of parantheses fixes this.

diff --git a/src/cairoint.h b/src/cairoint.h
index 490dfed..805c574 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -132,7 +132,7 @@ _cairo_win32_tmpfile (void);
 })
 #else
 #define cairo_container_of(ptr, type, member) \
-    (type *)((char *) (ptr) - (char *) &((type *)0)->member)
+    ((type *)((char *) (ptr) - (char *) &((type *)0)->member))
 #endif
 
 


More information about the cairo-commit mailing list