Fix some gcc4 warnings

git-svn-id: https://svn.eduke32.com/eduke32@344 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-18 08:13:33 +00:00
parent 453c1f9649
commit 80c51ac2de
11 changed files with 57 additions and 71 deletions

View file

@ -28,7 +28,7 @@ ifneq (0,$(RELEASE))
debug=-fomit-frame-pointer -O2
else
# debugging enabled
debug=-ggdb -O0
debug=-ggdb -O0 -DDEBUGGINGAIDS
endif
CC=gcc

View file

@ -57,7 +57,7 @@ $(OBJ)/pitch.$o: $(SRC)/jaudiolib/pitch.c $(SRC)/jaudiolib/pitch.h
$(OBJ)/multivoc.$o: $(SRC)/jaudiolib/multivoc.c $(SRC)/jaudiolib/usrhooks.h $(SRC)/jaudiolib/linklist.h $(SRC)/jaudiolib/pitch.h $(SRC)/jaudiolib/multivoc.h $(SRC)/jaudiolib/_multivc.h
$(OBJ)/fx_man.$o: $(SRC)/jaudiolib/fx_man.c $(SRC)/jaudiolib/multivoc.h $(SRC)/jaudiolib/ll_man.h $(SRC)/jaudiolib/fx_man.h
$(OBJ)/dsoundout.$o: $(SRC)/jaudiolib/dsoundout.c $(SRC)/jaudiolib/dsoundout.h
$(OBJ)/dsl.$o: $(SRC)/jaudiolib/dsl.c $(SRC)/jaudiolib/util.h
$(OBJ)/dsl.$o: $(SRC)/jaudiolib/dsl.c $(EINC)/compat.h
$(OBJ)/midi.$o: $(SRC)/jaudiolib/midi.c $(SRC)/jaudiolib/standard.h $(SRC)/jaudiolib/usrhooks.h $(SRC)/jaudiolib/music.h $(SRC)/jaudiolib/_midi.h $(SRC)/jaudiolib/midi.h
$(OBJ)/mpu401.$o: $(SRC)/jaudiolib/mpu401.c $(SRC)/jaudiolib/mpu401.h

View file

@ -285,67 +285,67 @@ const char *ExtGetSectorCaption(short sectnum)
{
switch (sector[sectnum].lotag)
{
case 1 :
case 1:
Bsprintf(lo,"1 WATER (SE 7)");
break;
case 2 :
case 2:
Bsprintf(lo,"2 UNDERWATER (SE 7)");
break;
case 9 :
case 9:
Bsprintf(lo,"9 STAR TREK DOORS");
break;
case 15 :
case 15:
Bsprintf(lo,"15 ELEVATOR TRANSPORT (SE 17)");
break;
case 16 :
case 16:
Bsprintf(lo,"16 ELEVATOR PLATFORM DOWN");
break;
case 17 :
case 17:
Bsprintf(lo,"17 ELEVATOR PLATFORM UP");
break;
case 18 :
case 18:
Bsprintf(lo,"18 ELEVATOR DOWN");
break;
case 19 :
case 19:
Bsprintf(lo,"19 ELEVATOR UP");
break;
case 20 :
case 20:
Bsprintf(lo,"20 CEILING DOOR");
break;
case 21 :
case 21:
Bsprintf(lo,"21 FLOOR DOOR");
break;
case 22 :
case 22:
Bsprintf(lo,"22 SPLIT DOOR");
break;
case 23 :
case 23:
Bsprintf(lo,"23 SWING DOOR (SE 11)");
break;
case 25 :
case 25:
Bsprintf(lo,"25 SLIDE DOOR (SE 15)");
break;
case 26 :
case 26:
Bsprintf(lo,"26 SPLIT STAR TREK DOOR");
break;
case 27 :
case 27:
Bsprintf(lo,"27 BRIDGE (SE 20)");
break;
case 28 :
case 28:
Bsprintf(lo,"28 DROP FLOOR (SE 21)");
break;
case 29 :
case 29:
Bsprintf(lo,"29 TEETH DOOR (SE 22)");
break;
case 30 :
case 30:
Bsprintf(lo,"30 ROTATE RISE BRIDGE");
break;
case 31 :
case 31:
Bsprintf(lo,"31 2 WAY TRAIN (SE=30)");
break;
case 32767 :
case 32767:
Bsprintf(lo,"32767 SECRET ROOM");
break;
case 65535 :
case -1:
Bsprintf(lo,"65535 END OF LEVEL");
break;
default :

View file

@ -8205,8 +8205,7 @@ char rancid_ip_strings[MAXPLAYERS][32], rancid_local_port_string[8];
static tokenlist rancidtokens[] =
{
{ "interface", T_INTERFACE
},
{ "interface", T_INTERFACE },
{ "mode", T_MODE },
{ "allow", T_ALLOW },
};
@ -8277,8 +8276,7 @@ static int stringsort(const char *p1, const char *p2)
static tokenlist grptokens[] =
{
{ "loadgrp", T_LOADGRP
},
{ "loadgrp", T_LOADGRP },
};
int loadgroupfiles(char *fn)

View file

@ -142,7 +142,7 @@ int ScanGroups(void)
do
{
b = read(fh, buf, sizeof(buf));
if (b > 0) crc32block((unsigned long *)&crcval, buf, b);
if (b > 0) crc32block((unsigned long *)&crcval, (unsigned char *)buf, b);
}
while (b == sizeof(buf));
crc32finish((unsigned long *)&crcval);

View file

@ -213,8 +213,8 @@ static playbackstatus MV_GetNextVOCBlock( VoiceNode *voice );
static playbackstatus MV_GetNextDemandFeedBlock( VoiceNode *voice );
static playbackstatus MV_GetNextRawBlock( VoiceNode *voice );
static playbackstatus MV_GetNextWAVBlock( VoiceNode *voice );
static void MV_ServiceRecord( void );
// static void MV_ServiceRecord( void );
static VoiceNode *MV_GetVoice( int handle );
static VoiceNode *MV_AllocVoice( int priority );

View file

@ -38,9 +38,10 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
#ifdef _WIN32
#include "dsoundout.h"
#else
#include "util.h"
#include "compat.h"
#include "dsl.h"
#endif
#include "baselayer.h"
#include "usrhooks.h"
#include "linklist.h"
#include "pitch.h"
@ -464,11 +465,11 @@ int MV_ServiceVoc( int buffer)
{
if (MV_ReverbTable != NULL)
{
MV_8BitReverb(source, dest, MV_ReverbTable, count);
MV_8BitReverb((signed char *)source, (signed char *)dest, MV_ReverbTable, count);
}
else
{
MV_8BitReverbFast(source, dest, count, MV_ReverbLevel);
MV_8BitReverbFast((signed char *)source, (signed char *)dest, count, MV_ReverbLevel);
}
}
@ -522,9 +523,9 @@ playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
unsigned char *ptr;
int blocktype;
int lastblocktype;
unsigned long blocklength;
unsigned long samplespeed;
unsigned int tc;
unsigned long blocklength = 0;
unsigned long samplespeed = 0;
unsigned int tc = 0;
int packtype;
int voicemode;
int done;
@ -585,8 +586,7 @@ playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
{
case 0 :
// End of data
if ((voice->LoopStart == NULL) ||
(voice->LoopStart >= (ptr - 4)))
if ((voice->LoopStart == NULL) || ((unsigned long *)voice->LoopStart >= (unsigned long *)(ptr - 4)))
{
voice->Playing = FALSE;
done = TRUE;
@ -658,7 +658,7 @@ playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
if (voice->LoopEnd == NULL)
{
voice->LoopCount = *(unsigned short *)ptr;
voice->LoopStart = ptr + blocklength;
voice->LoopStart = (char *)(ptr + blocklength);
}
ptr += blocklength;
break;
@ -674,7 +674,7 @@ playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
{
if ((voice->LoopCount > 0) && (voice->LoopStart != NULL))
{
ptr = voice->LoopStart;
ptr = (unsigned char *)voice->LoopStart;
if (voice->LoopCount < 0xffff)
{
voice->LoopCount--;
@ -737,8 +737,8 @@ playbackstatus MV_GetNextVOCBlock( VoiceNode *voice)
if (voice->Playing)
{
voice->NextBlock = ptr + blocklength;
voice->sound = ptr;
voice->NextBlock = (char *)(ptr + blocklength);
voice->sound = (char *)ptr;
voice->SamplingRate = samplespeed;
voice->RateScale = (voice->SamplingRate * voice->PitchScale) / MV_MixRate;
@ -902,7 +902,7 @@ playbackstatus MV_GetNextWAVBlock( VoiceNode *voice)
Starts recording of the waiting buffer.
---------------------------------------------------------------------*/
#if 0
static void MV_ServiceRecord( void)
{
@ -919,7 +919,7 @@ static void MV_ServiceRecord( void)
MV_MixPage = 0;
}
}
#endif
/*---------------------------------------------------------------------
Function: MV_GetVoice
@ -1639,7 +1639,7 @@ void MV_SetReverbDelay( int delay)
int maxdelay;
maxdelay = MV_GetMaxReverbDelay();
MV_ReverbDelay = max(MixBufferSize, min(delay, maxdelay));
MV_ReverbDelay = max((signed)MixBufferSize, min(delay, maxdelay));
MV_ReverbDelay *= MV_SampleSize;
}
@ -1751,7 +1751,7 @@ int MV_StartPlayback( void)
#else
status = DSL_BeginBufferedPlayback(MV_MixBuffer[ 0 ],
TotalBufferSize, MV_NumberOfBuffers,
MV_RequestedMixRate, MV_MixMode, MV_ServiceVoc);
MV_RequestedMixRate, MV_MixMode, (void *)MV_ServiceVoc);
if (status != DSL_Ok)
{
@ -2173,7 +2173,7 @@ int MV_PlayLoopedWAV( char *ptr,
return(MV_Error);
}
if (strncmp(data->DATA, "data", 4) != 0)
if (strncmp((char *)data->DATA, "data", 4) != 0)
{
MV_SetErrorCode(MV_InvalidWAVFile);
return(MV_Error);
@ -2202,7 +2202,7 @@ int MV_PlayLoopedWAV( char *ptr,
length /= 2;
}
loopend = min(loopend, data->size);
loopend = min(loopend, (signed)data->size);
absloopend = min(absloopend, length);
voice->Playing = TRUE;
@ -2221,7 +2221,7 @@ int MV_PlayLoopedWAV( char *ptr,
voice->LoopEnd = voice->NextBlock + loopend;
voice->LoopSize = absloopend - absloopstart;
if ((loopstart >= data->size) || (loopstart < 0))
if ((loopstart >= (signed)data->size) || (loopstart < 0))
{
voice->LoopStart = NULL;
voice->LoopEnd = NULL;

View file

@ -1,12 +0,0 @@
#ifndef AUDIOLIB__UTIL_H
#define AUDIOLIB__UTIL_H
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
#endif

View file

@ -229,7 +229,7 @@ void renderframe (uint16 framenumber, uint16 *pagepointer)
ppointer+=4;
}
CPlayRunSkipDump (ppointer, anim->imagebuffer);
CPlayRunSkipDump ((char *)ppointer, (char *)anim->imagebuffer);
}
@ -264,7 +264,7 @@ void ANIM_LoadAnim (char * buffer)
Anim_Started = true;
}
anim->buffer = buffer;
anim->buffer = (unsigned char *)buffer;
anim->curlpnum = 0xffff;
anim->currentframe = -1;
size = sizeof(lpfileheader);

View file

@ -3122,13 +3122,13 @@ cheat_for_port_credits:
minitextshade(70,34+l*8,tempbuf,(m+l == probey)?0:16,1,10+16);
//strcpy(tempbuf, KB_ScanCodeToString(KeyboardKeys[m+l][0]));
strcpy(tempbuf, getkeyname(KeyboardKeys[m+l][0]));
strcpy(tempbuf, (char *)getkeyname(KeyboardKeys[m+l][0]));
if (!tempbuf[0]) strcpy(tempbuf, " -");
minitextshade(70+100,34+l*8,tempbuf,
(m+l == probey && !currentlist?0:16),2,10+16);
//strcpy(tempbuf, KB_ScanCodeToString(KeyboardKeys[m+l][1]));
strcpy(tempbuf, getkeyname(KeyboardKeys[m+l][1]));
strcpy(tempbuf, (char *)getkeyname(KeyboardKeys[m+l][1]));
if (!tempbuf[0]) strcpy(tempbuf, " -");
minitextshade(70+120+34,34+l*8,tempbuf,
(m+l == probey && currentlist?0:16),2,10+16);
@ -3771,11 +3771,11 @@ cheat_for_port_credits:
break;
}
Bsprintf(tempbuf,getjoyname(0,thispage*2));
Bsprintf(tempbuf,(char *)getjoyname(0,thispage*2));
menutext(42,32,0,0,tempbuf);
if (twothispage)
{
Bsprintf(tempbuf,getjoyname(0,thispage*2+1));
Bsprintf(tempbuf,(char *)getjoyname(0,thispage*2+1));
menutext(42,32+64,0,0,tempbuf);
}
gametext(76,38,"SCALE",0,2+8+16);
@ -3899,7 +3899,7 @@ cheat_for_port_credits:
for (m=first;m<last;m++)
{
unsigned short odx,dx,ody,dy;
Bsprintf(tempbuf,getjoyname(0,m));
Bsprintf(tempbuf,(char *)getjoyname(0,m));
menutext(32,48+30*(m-first),0,0,tempbuf);
gametext(128,48+30*(m-first)-8,"DEAD",0,2+8+16);
@ -3908,8 +3908,8 @@ cheat_for_port_credits:
dx = odx = min(64,64l*JoystickAnalogueDead[m]/10000l);
dy = ody = min(64,64l*JoystickAnalogueSaturate[m]/10000l);
bar(217,48+30*(m-first),&dx,4,x==((m-first)*2),0,0);
bar(217,48+30*(m-first)+15,&dy,4,x==((m-first)*2+1),0,0);
bar(217,48+30*(m-first),(short *)&dx,4,x==((m-first)*2),0,0);
bar(217,48+30*(m-first)+15,(short *)&dy,4,x==((m-first)*2+1),0,0);
Bsprintf(tempbuf,"%3d%%",100*dx/64);
gametext(217-49,48+30*(m-first)-8,tempbuf,0,2+8+16);

View file

@ -223,7 +223,7 @@ int osdcmd_fileinfo(const osdfuncparm_t *parm)
do
{
j = kread(i,buf,256);
crc32block(&crc,buf,j);
crc32block(&crc,(unsigned char *)buf,j);
}
while (j == 256);
crc32finish(&crc);