From 8da4e5cc58e52400e1aada10ea6fa4690d5a2a8e Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 16 Jan 2011 03:33:48 +0000 Subject: [PATCH] Remove some warnings. git-svn-id: https://svn.eduke32.com/eduke32@1764 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/nedmalloc.c | 14 +++++++++--- polymer/eduke32/build/src/sdlayer.c | 4 ++-- polymer/eduke32/source/enet/src/protocol.c | 11 ++++++++++ .../source/jaudiolib/src/driver_nosound.c | 22 +++++++++++++++---- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/build/src/nedmalloc.c b/polymer/eduke32/build/src/nedmalloc.c index aedc99222..7931867ae 100644 --- a/polymer/eduke32/build/src/nedmalloc.c +++ b/polymer/eduke32/build/src/nedmalloc.c @@ -26,6 +26,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "compat.h" + #ifdef _MSC_VER /* Enable full aliasing on MSVC */ /*#pragma optimize("a", on)*/ @@ -514,7 +516,7 @@ NEDMALLOCNOALIASATTR size_t nedblksize(int *RESTRICT isforeign, void *RESTRICT m size_t *_mem=(size_t *) mem-3; if (_mem[0]==*(size_t *) "NEDMALOC") { - mstate mspace=(mstate) _mem[1]; + //mstate mspace=(mstate) _mem[1]; size_t size=_mem[2]; if (isforeign) *isforeign=0; return size; @@ -680,6 +682,7 @@ static void tcfullsanitycheck(threadcache *tc) THROWSPEC static NOINLINE void RemoveCacheEntries(nedpool *RESTRICT p, threadcache *RESTRICT tc, unsigned int age) THROWSPEC { + UNREFERENCED_PARAMETER(p); #ifdef FULLSANITYCHECKS tcfullsanitycheck(tc); #endif @@ -783,6 +786,8 @@ static NOINLINE threadcache *AllocCache(nedpool *RESTRICT p) THROWSPEC static void *threadcache_malloc(nedpool *RESTRICT p, threadcache *RESTRICT tc, size_t *RESTRICT _size) THROWSPEC { + UNREFERENCED_PARAMETER(p); + void *RESTRICT ret=0; size_t size=*_size, blksize=0; unsigned int bestsize; @@ -871,6 +876,8 @@ static void *threadcache_malloc(nedpool *RESTRICT p, threadcache *RESTRICT tc, s } static NOINLINE void ReleaseFreeInCache(nedpool *RESTRICT p, threadcache *RESTRICT tc, int mymspace) THROWSPEC { + UNREFERENCED_PARAMETER(mymspace); + unsigned int age=THREADCACHEMAXFREESPACE/8192; #if USE_LOCKS /*ACQUIRE_LOCK(&p->m[mymspace]->mutex);*/ @@ -905,7 +912,7 @@ static void threadcache_free(nedpool *RESTRICT p, threadcache *RESTRICT tc, int idx<<=1; if (size>bestsize) { - unsigned int biggerbestsize=bestsize+bestsize<<1; + unsigned int biggerbestsize=bestsize+(bestsize<<1); if (size>=biggerbestsize) { idx++; @@ -1465,7 +1472,7 @@ NEDMALLOCPTRATTR void *nedpmemalign(nedpool *p, size_t alignment, size_t bytes) struct nedmallinfo nedpmallinfo(nedpool *p) THROWSPEC { int n; - struct nedmallinfo ret= {0}; + struct nedmallinfo ret= {0,0,0,0,0,0,0,0,0,0}; if (!p) { p=&syspool; if (!syspool.threads) InitPool(&syspool, 0, -1); } for (n=0; p->m[n]; n++) { @@ -1484,6 +1491,7 @@ return ret; } int nedpmallopt(nedpool *p, int parno, int value) THROWSPEC { + UNREFERENCED_PARAMETER(p); #if USE_ALLOCATOR==1 return mspace_mallopt(parno, value); #else diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 1ef417d32..00bc29a4f 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -1648,9 +1648,9 @@ int32_t handleevents(void) } break; */ -#warning "Using SDL 1.3" +// #print "Using SDL 1.3" #else // SDL 1.3 ^^^ | vvv SDL 1.2 -#warning "Using SDL 1.2" +// #print "Using SDL 1.2" case SDL_KEYDOWN: case SDL_KEYUP: code = keytranslation[ev.key.keysym.sym]; diff --git a/polymer/eduke32/source/enet/src/protocol.c b/polymer/eduke32/source/enet/src/protocol.c index 8e26dfb24..d090b1d23 100644 --- a/polymer/eduke32/source/enet/src/protocol.c +++ b/polymer/eduke32/source/enet/src/protocol.c @@ -8,6 +8,7 @@ #include "enet/utility.h" #include "enet/time.h" #include "enet/enet.h" +#include "compat.h" static size_t commandSizes [ENET_PROTOCOL_COMMAND_COUNT] = { @@ -82,6 +83,8 @@ enet_protocol_dispatch_incoming_commands (ENetHost * host, ENetEvent * event) } return 1; + default: + break; } } @@ -250,6 +253,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet size_t channelCount; ENetPeer * currentPeer; ENetProtocol verifyCommand; + UNREFERENCED_PARAMETER(header); channelCount = ENET_NET_TO_HOST_32 (command -> connect.channelCount); @@ -604,6 +608,9 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet static int enet_protocol_handle_ping (ENetHost * host, ENetPeer * peer, const ENetProtocol * command) { + UNREFERENCED_PARAMETER(host); + UNREFERENCED_PARAMETER(peer); + UNREFERENCED_PARAMETER(command); return 0; } @@ -631,6 +638,8 @@ enet_protocol_handle_bandwidth_limit (ENetHost * host, ENetPeer * peer, const EN static int enet_protocol_handle_throttle_configure (ENetHost * host, ENetPeer * peer, const ENetProtocol * command) { + UNREFERENCED_PARAMETER(host); + peer -> packetThrottleInterval = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleInterval); peer -> packetThrottleAcceleration = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleAcceleration); peer -> packetThrottleDeceleration = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleDeceleration); @@ -745,6 +754,8 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * enet_list_empty (& peer -> sentReliableCommands)) enet_peer_disconnect (peer, peer -> eventData); break; + default: + break; } return 0; diff --git a/polymer/eduke32/source/jaudiolib/src/driver_nosound.c b/polymer/eduke32/source/jaudiolib/src/driver_nosound.c index da66c5943..638f8d5c5 100644 --- a/polymer/eduke32/source/jaudiolib/src/driver_nosound.c +++ b/polymer/eduke32/source/jaudiolib/src/driver_nosound.c @@ -24,19 +24,29 @@ #include "inttypes.h" +#ifndef UNREFERENCED_PARAMETER +# define UNREFERENCED_PARAMETER(x) x=x +#endif + + int32_t NoSoundDrv_GetError(void) { - return 0; + return 0; } const char *NoSoundDrv_ErrorString( int32_t ErrorNumber ) { - return "No sound, Ok."; + UNREFERENCED_PARAMETER(ErrorNumber); + return "No sound, Ok."; } int32_t NoSoundDrv_PCM_Init(int32_t *mixrate, int32_t *numchannels, int32_t *samplebits, void * initdata) { - return 0; + UNREFERENCED_PARAMETER(mixrate); + UNREFERENCED_PARAMETER(numchannels); + UNREFERENCED_PARAMETER(samplebits); + UNREFERENCED_PARAMETER(initdata); + return 0; } void NoSoundDrv_PCM_Shutdown(void) @@ -46,7 +56,11 @@ void NoSoundDrv_PCM_Shutdown(void) int32_t NoSoundDrv_PCM_BeginPlayback(char *BufferStart, int32_t BufferSize, int32_t NumDivisions, void ( *CallBackFunc )( void ) ) { - return 0; + UNREFERENCED_PARAMETER(BufferStart); + UNREFERENCED_PARAMETER(BufferSize); + UNREFERENCED_PARAMETER(NumDivisions); + UNREFERENCED_PARAMETER(CallBackFunc); + return 0; } void NoSoundDrv_PCM_StopPlayback(void)