summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-05-09 23:39:40 +0000
committerTim Angus <tim@ngus.net>2013-01-09 21:38:39 +0000
commit978c0599002feabd27b18767389182cf77e5a3e6 (patch)
treeaf7ca5fb2f7be3010acfd68e342262f4d9b4b620 /src/qcommon
parent91afb0a90e002901a98139be600a550a34d9eced (diff)
Choose better alignment for heavy-duty rendering structures, patch by Matt Turner (#4981)
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/q_shared.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index cdb96b11..a8da077d 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -170,8 +170,10 @@ typedef int sfxHandle_t;
typedef int fileHandle_t;
typedef int clipHandle_t;
-#define PAD(x,y) (((x)+(y)-1) & ~((y)-1))
-#define PADLEN(x,y) (PAD((x), (y)) - (x))
+#define PAD(base, alignment) (((base)+(alignment)-1) & ~((alignment)-1))
+#define PADLEN(base, alignment) (PAD((base), (alignment)) - (base))
+
+#define PADP(base, alignment) ((void *) PAD((intptr_t) (base), (alignment)))
#ifdef __GNUC__
#define QALIGN(x) __attribute__((aligned(x)))