From 57def3e26476589a4b2f49d64619125a9e30f5bd Mon Sep 17 00:00:00 2001 From: Nelson Rush Date: Fri, 31 Dec 1999 02:31:14 +0000 Subject: [PATCH] Added Marcus's patch to align surfcache_t structs for 64-bit platforms. --- uquake/d_surf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uquake/d_surf.c b/uquake/d_surf.c index b09c5f8..7f222ab 100644 --- a/uquake/d_surf.c +++ b/uquake/d_surf.c @@ -139,7 +139,9 @@ surfcache_t *D_SCAlloc (int width, int size) Sys_Error ("D_SCAlloc: bad cache size %d\n", size); size = (int)&((surfcache_t *)0)->data[size]; - size = (size + 3) & ~3; +#define SIZE_ALIGN (sizeof(surfcache_t*)-1) + size = (size + SIZE_ALIGN) & ~SIZE_ALIGN; +#undef SIZE_ALIGN if (size > sc_size) Sys_Error ("D_SCAlloc: %i > cache size",size);