Remove some warnings.

git-svn-id: https://svn.eduke32.com/eduke32@1764 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2011-01-16 03:33:48 +00:00
parent 7cef706c7c
commit 8da4e5cc58
4 changed files with 42 additions and 9 deletions

View file

@ -26,6 +26,8 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include "compat.h"
#ifdef _MSC_VER #ifdef _MSC_VER
/* Enable full aliasing on MSVC */ /* Enable full aliasing on MSVC */
/*#pragma optimize("a", on)*/ /*#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; size_t *_mem=(size_t *) mem-3;
if (_mem[0]==*(size_t *) "NEDMALOC") if (_mem[0]==*(size_t *) "NEDMALOC")
{ {
mstate mspace=(mstate) _mem[1]; //mstate mspace=(mstate) _mem[1];
size_t size=_mem[2]; size_t size=_mem[2];
if (isforeign) *isforeign=0; if (isforeign) *isforeign=0;
return size; 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 static NOINLINE void RemoveCacheEntries(nedpool *RESTRICT p, threadcache *RESTRICT tc, unsigned int age) THROWSPEC
{ {
UNREFERENCED_PARAMETER(p);
#ifdef FULLSANITYCHECKS #ifdef FULLSANITYCHECKS
tcfullsanitycheck(tc); tcfullsanitycheck(tc);
#endif #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 static void *threadcache_malloc(nedpool *RESTRICT p, threadcache *RESTRICT tc, size_t *RESTRICT _size) THROWSPEC
{ {
UNREFERENCED_PARAMETER(p);
void *RESTRICT ret=0; void *RESTRICT ret=0;
size_t size=*_size, blksize=0; size_t size=*_size, blksize=0;
unsigned int bestsize; 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 static NOINLINE void ReleaseFreeInCache(nedpool *RESTRICT p, threadcache *RESTRICT tc, int mymspace) THROWSPEC
{ {
UNREFERENCED_PARAMETER(mymspace);
unsigned int age=THREADCACHEMAXFREESPACE/8192; unsigned int age=THREADCACHEMAXFREESPACE/8192;
#if USE_LOCKS #if USE_LOCKS
/*ACQUIRE_LOCK(&p->m[mymspace]->mutex);*/ /*ACQUIRE_LOCK(&p->m[mymspace]->mutex);*/
@ -905,7 +912,7 @@ static void threadcache_free(nedpool *RESTRICT p, threadcache *RESTRICT tc, int
idx<<=1; idx<<=1;
if (size>bestsize) if (size>bestsize)
{ {
unsigned int biggerbestsize=bestsize+bestsize<<1; unsigned int biggerbestsize=bestsize+(bestsize<<1);
if (size>=biggerbestsize) if (size>=biggerbestsize)
{ {
idx++; idx++;
@ -1465,7 +1472,7 @@ NEDMALLOCPTRATTR void *nedpmemalign(nedpool *p, size_t alignment, size_t bytes)
struct nedmallinfo nedpmallinfo(nedpool *p) THROWSPEC struct nedmallinfo nedpmallinfo(nedpool *p) THROWSPEC
{ {
int n; 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); } if (!p) { p=&syspool; if (!syspool.threads) InitPool(&syspool, 0, -1); }
for (n=0; p->m[n]; n++) for (n=0; p->m[n]; n++)
{ {
@ -1484,6 +1491,7 @@ return ret;
} }
int nedpmallopt(nedpool *p, int parno, int value) THROWSPEC int nedpmallopt(nedpool *p, int parno, int value) THROWSPEC
{ {
UNREFERENCED_PARAMETER(p);
#if USE_ALLOCATOR==1 #if USE_ALLOCATOR==1
return mspace_mallopt(parno, value); return mspace_mallopt(parno, value);
#else #else

View file

@ -1648,9 +1648,9 @@ int32_t handleevents(void)
} }
break; break;
*/ */
#warning "Using SDL 1.3" // #print "Using SDL 1.3"
#else // SDL 1.3 ^^^ | vvv SDL 1.2 #else // SDL 1.3 ^^^ | vvv SDL 1.2
#warning "Using SDL 1.2" // #print "Using SDL 1.2"
case SDL_KEYDOWN: case SDL_KEYDOWN:
case SDL_KEYUP: case SDL_KEYUP:
code = keytranslation[ev.key.keysym.sym]; code = keytranslation[ev.key.keysym.sym];

View file

@ -8,6 +8,7 @@
#include "enet/utility.h" #include "enet/utility.h"
#include "enet/time.h" #include "enet/time.h"
#include "enet/enet.h" #include "enet/enet.h"
#include "compat.h"
static size_t commandSizes [ENET_PROTOCOL_COMMAND_COUNT] = static size_t commandSizes [ENET_PROTOCOL_COMMAND_COUNT] =
{ {
@ -82,6 +83,8 @@ enet_protocol_dispatch_incoming_commands (ENetHost * host, ENetEvent * event)
} }
return 1; return 1;
default:
break;
} }
} }
@ -250,6 +253,7 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet
size_t channelCount; size_t channelCount;
ENetPeer * currentPeer; ENetPeer * currentPeer;
ENetProtocol verifyCommand; ENetProtocol verifyCommand;
UNREFERENCED_PARAMETER(header);
channelCount = ENET_NET_TO_HOST_32 (command -> connect.channelCount); 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 static int
enet_protocol_handle_ping (ENetHost * host, ENetPeer * peer, const ENetProtocol * command) enet_protocol_handle_ping (ENetHost * host, ENetPeer * peer, const ENetProtocol * command)
{ {
UNREFERENCED_PARAMETER(host);
UNREFERENCED_PARAMETER(peer);
UNREFERENCED_PARAMETER(command);
return 0; return 0;
} }
@ -631,6 +638,8 @@ enet_protocol_handle_bandwidth_limit (ENetHost * host, ENetPeer * peer, const EN
static int static int
enet_protocol_handle_throttle_configure (ENetHost * host, ENetPeer * peer, const ENetProtocol * command) 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 -> packetThrottleInterval = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleInterval);
peer -> packetThrottleAcceleration = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleAcceleration); peer -> packetThrottleAcceleration = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleAcceleration);
peer -> packetThrottleDeceleration = ENET_NET_TO_HOST_32 (command -> throttleConfigure.packetThrottleDeceleration); 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_list_empty (& peer -> sentReliableCommands))
enet_peer_disconnect (peer, peer -> eventData); enet_peer_disconnect (peer, peer -> eventData);
break; break;
default:
break;
} }
return 0; return 0;

View file

@ -24,19 +24,29 @@
#include "inttypes.h" #include "inttypes.h"
#ifndef UNREFERENCED_PARAMETER
# define UNREFERENCED_PARAMETER(x) x=x
#endif
int32_t NoSoundDrv_GetError(void) int32_t NoSoundDrv_GetError(void)
{ {
return 0; return 0;
} }
const char *NoSoundDrv_ErrorString( int32_t ErrorNumber ) 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) 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) 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 NoSoundDrv_PCM_BeginPlayback(char *BufferStart, int32_t BufferSize,
int32_t NumDivisions, void ( *CallBackFunc )( void ) ) 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) void NoSoundDrv_PCM_StopPlayback(void)