From 59686129bb1f884d6214dff6eeb41500ea27591b Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 19 May 2015 22:08:48 +0000 Subject: [PATCH] SW: Fix warning: passing argument 1 of 'allocache' from incompatible pointer type [enabled by default] and warning: pointer targets in passing argument 3 of 'allocache' differ in signedness [-Wpointer-sign] git-svn-id: https://svn.eduke32.com/eduke32@5222 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sw/src/draw.c | 2 +- polymer/eduke32/source/sw/src/game.c | 33 -------------------------- polymer/eduke32/source/sw/src/sounds.c | 2 +- polymer/eduke32/source/sw/src/sounds.h | 2 +- 4 files changed, 3 insertions(+), 36 deletions(-) diff --git a/polymer/eduke32/source/sw/src/draw.c b/polymer/eduke32/source/sw/src/draw.c index a003e288c..017f1a63b 100644 --- a/polymer/eduke32/source/sw/src/draw.c +++ b/polymer/eduke32/source/sw/src/draw.c @@ -2696,7 +2696,7 @@ ScreenLoadSaveSetup(PLAYERp pp) ScreenTileLock(); if (!waloff[SAVE_SCREEN_TILE]) - allocache((void **)&waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, &walock[SAVE_SCREEN_TILE]); + allocache((intptr_t*)&waloff[SAVE_SCREEN_TILE], SAVE_SCREEN_XSIZE * SAVE_SCREEN_YSIZE, &walock[SAVE_SCREEN_TILE]); tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_XSIZE; tilesiz[SAVE_SCREEN_TILE].x = SAVE_SCREEN_YSIZE; diff --git a/polymer/eduke32/source/sw/src/game.c b/polymer/eduke32/source/sw/src/game.c index 40d5db99d..dad4006ed 100644 --- a/polymer/eduke32/source/sw/src/game.c +++ b/polymer/eduke32/source/sw/src/game.c @@ -377,39 +377,6 @@ int krand1(void) #endif -void * -CacheAlloc(void **ptr, int size, unsigned char *lock_byte) -{ - if (*ptr == NULL) - { - *lock_byte = CACHE_LOCK_START; - allocache(ptr, size, lock_byte); - } - else - { - if (*lock_byte < CACHE_LOCK_START) - *lock_byte = CACHE_LOCK_START; - else - (*lock_byte)++; - } - - return *ptr; -} - -void -CacheFree(void **ptr, unsigned char *lock_byte) -{ - if (*ptr == NULL) - { - ASSERT(*lock_byte == NULL); - } - else - { - if (*lock_byte < CACHE_LOCK_START) - *lock_byte = CACHE_UNLOCK_START; - } -} - /* void HeapCheck(char *file, int line) { diff --git a/polymer/eduke32/source/sw/src/sounds.c b/polymer/eduke32/source/sw/src/sounds.c index 309886961..a8083d743 100644 --- a/polymer/eduke32/source/sw/src/sounds.c +++ b/polymer/eduke32/source/sw/src/sounds.c @@ -778,7 +778,7 @@ SWBOOL CacheSound(int num, int type) */ vp->lock = CACHE_UNLOCK_MAX; - allocache((void **)&vp->data, length, &vp->lock); + allocache((intptr_t*)&vp->data, length, &vp->lock); #if 0 // DEBUG diff --git a/polymer/eduke32/source/sw/src/sounds.h b/polymer/eduke32/source/sw/src/sounds.h index e3fb73b24..a5a07dd35 100644 --- a/polymer/eduke32/source/sw/src/sounds.h +++ b/polymer/eduke32/source/sw/src/sounds.h @@ -145,7 +145,7 @@ struct VOCstruct int16_t voc_num; // Backward reference to parent sound int voc_distance; // Sound's distance effectiveness Voc_Flags voc_flags; // Various allowable flag settings for voc - uint8_t lock; // locking byte for caching + char lock; // locking byte for caching uint8_t playing; // number of this type of sound currently playing };