--- source/d_scache.cpp 2006-08-11 14:52:55.000000000 +0200 +++ source/d_scache.cpp 2006-08-11 14:53:38.000000000 +0200 @@ -199,7 +199,7 @@ if ((height < 0) || (height > 256)) Sys_Error("D_SCAlloc: bad cache height %d\n", height); - size = (int)&((surfcache_t *)0)->data[size]; + size = &((surfcache_t *)0)->data[size] - (vuint8*)0; size = (size + 3) & ~3; if (size > sc_size) Sys_Error("D_SCAlloc: %i > cache size", size); --- source/sv_acs.cpp 2006-08-11 14:53:01.000000000 +0200 +++ source/sv_acs.cpp 2006-08-11 14:55:46.000000000 +0200 @@ -3380,9 +3380,9 @@ ACSVM_CASE(PCD_CaseGotoSorted) // The count and jump table are 4-byte aligned. - if ((int)ip & 3) + if (ActiveObject->PtrToOffset(ip) & 3) { - ip += 4 - ((int)ip & 3); + ip += 4 - (ActiveObject->PtrToOffset(ip) & 3); } { int numcases = READ_INT32(ip);