mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
Removed pointless #ifdef __alpha__
Fixed alignment of size in D_SCAlloc() for 64-bit platforms.
This commit is contained in:
parent
1e308e0f33
commit
eebb6426aa
1 changed files with 6 additions and 5 deletions
|
@ -146,11 +146,12 @@ surfcache_t *D_SCAlloc (int width, int size)
|
|||
if ((size <= 0) || (size > 0x10000))
|
||||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
||||
|
||||
#ifdef __alpha__
|
||||
size = (int)((long)&((surfcache_t *)0)->data[size]);
|
||||
#else
|
||||
size = (int)&((surfcache_t *)0)->data[size];
|
||||
#endif
|
||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||
size += (int)((surfcache_t *)0)->data;
|
||||
|
||||
#define SIZE_ALIGN (sizeof(surfcache_t*)-1)
|
||||
size = (size + SIZE_ALIGN) & ~SIZE_ALIGN;
|
||||
#undef SIZE_ALIGN
|
||||
size = (size + 3) & ~3;
|
||||
if (size > sc_size)
|
||||
Sys_Error ("D_SCAlloc: %i > cache size",size);
|
||||
|
|
Loading…
Reference in a new issue