]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
common: Wrap ContainerOf around parentheses to allow direct struct access
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Sep 2020 13:19:28 +0000 (13:19 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Sep 2020 13:19:28 +0000 (13:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12916 d7cf8633-e32d-0410-b094-e92efae38249

common.h

index 9d73bc548681b248465ccaf2928624305d5ce781..b38f830d1af7e7ccaff53713ae15fcf0bfeff5fb 100644 (file)
--- a/common.h
+++ b/common.h
@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 //============================================================================
 
-#define ContainerOf(ptr, type, member) (type *)((void *)&(ptr) - offsetof(type, member))
+#define ContainerOf(ptr, type, member) ((type *)((void *)&(ptr) - offsetof(type, member)))
 
 typedef struct sizebuf_s
 {