From 91e6c10a592f5da9592dd1e905f754531e352b5d Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Jan 2017 11:21:15 +0000 Subject: [PATCH] SW: Fix allocache parameters. git-svn-id: https://svn.eduke32.com/eduke32@6044 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sw/src/anim.c | 2 +- polymer/eduke32/source/sw/src/rts.c | 14 +++++++------- polymer/eduke32/source/sw/src/setup.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/source/sw/src/anim.c b/polymer/eduke32/source/sw/src/anim.c index ddfe945d1..461dbaebd 100644 --- a/polymer/eduke32/source/sw/src/anim.c +++ b/polymer/eduke32/source/sw/src/anim.c @@ -244,7 +244,7 @@ unsigned char *LoadAnm(short anim_num) return NULL; length = kfilelength(handle); - allocache((void **) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]); + allocache((intptr_t *) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]); animbuf = (unsigned char *)((intptr_t)anm_ptr[anim_num] + sizeof(anim_t)); kread(handle, animbuf, length); diff --git a/polymer/eduke32/source/sw/src/rts.c b/polymer/eduke32/source/sw/src/rts.c index 02ce0f74f..6e464e50b 100644 --- a/polymer/eduke32/source/sw/src/rts.c +++ b/polymer/eduke32/source/sw/src/rts.c @@ -43,14 +43,14 @@ void *ReAllocMem(void *ptr, int size); void FreeMem(void *ptr); extern char ds[]; -unsigned char lumplockbyte[11]; +char lumplockbyte[11]; //============= // STATICS //============= static int32_t numlumps = 0; -static void **lumpcache = NULL; +static intptr_t *lumpcache = NULL; static lumpinfo_t *lumpinfo = NULL; // location of each lump on disk /* @@ -269,7 +269,7 @@ char *RTS_GetSoundName(int32_t i) = ==================== */ -void RTS_ReadLump(int32_t lump, void *dest) +void RTS_ReadLump(int32_t lump, intptr_t dest) { lumpinfo_t *l; @@ -279,7 +279,7 @@ void RTS_ReadLump(int32_t lump, void *dest) buildprintf("RTS_ReadLump: %i < 0",lump); l = lumpinfo+lump; klseek(l->handle, l->position, SEEK_SET); - kread(l->handle,dest,l->size); + kread(l->handle,(void *)dest,l->size); } #if 1 @@ -299,7 +299,7 @@ void *RTS_GetSound(int32_t lump) if ((uint16_t)lump >= (uint16_t)numlumps) buildprintf("RTS_GetSound: %i >= %i\n",lump,numlumps); - if (lumpcache[lump] == NULL) + if (lumpcache[lump] == (intptr_t)NULL) { lumplockbyte[lump] = CACHE_LOCK_START; allocache(&lumpcache[lump],(int)RTS_SoundLength(lump-1),&lumplockbyte[lump]); @@ -312,7 +312,7 @@ void *RTS_GetSound(int32_t lump) else lumplockbyte[lump]++; } - return lumpcache[lump]; + return (void *)lumpcache[lump]; } #else /* @@ -337,6 +337,6 @@ void *RTS_GetSound(int32_t lump) lumpcache[lump] = Xmalloc(RTS_SoundLength(lump-1)); RTS_ReadLump(lump, lumpcache[lump]); } - return lumpcache[lump]; + return (void *)lumpcache[lump]; } #endif diff --git a/polymer/eduke32/source/sw/src/setup.c b/polymer/eduke32/source/sw/src/setup.c index 34708288b..3a760d539 100644 --- a/polymer/eduke32/source/sw/src/setup.c +++ b/polymer/eduke32/source/sw/src/setup.c @@ -382,7 +382,7 @@ void main() { uint8_t *ptr; KB_ClearKeyDown(sc_F1+i); - ptr = RTS_GetSound(i); + ptr = (uint8_t *)RTS_GetSound(i); FX_PlayVOC(ptr, 0, 255, 255, 255, 255, 0); } }