More warning fixes

git-svn-id: https://svn.eduke32.com/eduke32@349 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-19 03:02:36 +00:00
parent 643f4d1e44
commit 65dc97d55b
7 changed files with 99 additions and 105 deletions

View file

@ -17,6 +17,7 @@
#define _WIN32_IE 0x0400
#include <windows.h>
#include <shlobj.h>
#include <direct.h>
#endif
#include <stdio.h>

View file

@ -314,7 +314,7 @@ __asm__ __volatile__ ("bswap %0" : "+r" (a) : : "cc" );
static inline long bitrev (long b, long c)
{
long a;
long a = 0;
__asm__ __volatile__ (
"xorl %%eax, %%eax\n\t0:\n\tshrl $1, %%ebx\n\tadcl %%eax, %%eax\n\tsubl $1, %%ecx\n\tjnz 0b"
: "+a" (a), "+b" (b), "+c" (c) : : "cc");
@ -1523,11 +1523,11 @@ static long kpegrend (const char *kfilebuf, long kfilength,
long daframeplace, long dabytesperline, long daxres, long dayres,
long daglobxoffs, long daglobyoffs)
{
long i, j, p, v, leng, xdim, ydim, index, prec, restartcnt, restartinterval;
long x, y, z, xx, yy, zz, *dc, *dc2, num, curbits, c, daval, dabits, *hqval, *hqbits, hqcnt, *quanptr;
long passcnt = 0, ghsampmax, gvsampmax, glhsampmax, glvsampmax, glhstep, glvstep;
long i, j, p, v, leng, xdim = 0, ydim = 0, index, prec, restartcnt, restartinterval;
long x, y, z, xx, yy, zz, *dc = 0, *dc2, num, curbits, c, daval, dabits, *hqval, *hqbits, hqcnt, *quanptr = 0;
long passcnt = 0, ghsampmax = 0, gvsampmax = 0, glhsampmax = 0, glvsampmax = 0, glhstep, glvstep;
long eobrun, Ss, Se, Ah, Al, Alut[2], dctx[12], dcty[12], ldctx[12], ldcty[12], lshx[4], lshy[4];
short *dctbuf = 0, *dctptr[12], *ldctptr[12], *dcs;
short *dctbuf = 0, *dctptr[12], *ldctptr[12], *dcs = 0;
unsigned char ch, marker, dcflag;
const unsigned char *kfileptr;
@ -1932,7 +1932,7 @@ static long kgifrend (const char *kfilebuf, long kfilelength,
long i, x, y, xsiz, ysiz, yinc, xend, xspan, yspan, currstr, numbitgoal;
long lzcols, dat, blocklen, bitcnt, xoff, yoff, transcol, backcol, *lptr;
char numbits, startnumbits, chunkind, ilacefirst;
const unsigned char *ptr, *cptr;
const unsigned char *ptr, *cptr = 0;
coltype = 3; bitdepth = 8; //For PNGOUT
@ -2114,8 +2114,8 @@ static long ktgarend (const char *header, long fleng,
long daframeplace, long dabytesperline, long daxres, long dayres,
long daglobxoffs, long daglobyoffs)
{
long i, p, x, y, pi, xi, yi, x0, x1, y0, y1, xsiz, ysiz, rlestat, colbyte, pixbyte;
const unsigned char *fptr, *cptr, *nptr;
long i = 0, p, x, y, pi, xi, yi, x0, x1, y0, y1, xsiz, ysiz, rlestat, colbyte, pixbyte;
const unsigned char *fptr = 0, *cptr = 0, *nptr = 0;
//Ugly and unreliable identification for .TGA!
if ((fleng < 20) || (header[1]&0xfe)) return(-1);
@ -2417,7 +2417,7 @@ static long kpcxrend (const char *buf, long fleng,
static long kddsrend (const char *buf, long leng,
long frameptr, long bpl, long xdim, long ydim, long xoff, long yoff)
{
long x, y, z, xx, yy, xsiz, ysiz, dxt, al[2], ai, j, k, v, c0, c1, stride;
long x = 0, y = 0, z = 0, xx, yy, xsiz, ysiz, dxt, al[2], ai, j, k, v, c0, c1, stride;
unsigned long lut[256], r[4], g[4], b[4], a[8], rr, gg, bb;
unsigned char *uptr, *wptr;
@ -2425,11 +2425,11 @@ static long kddsrend (const char *buf, long leng,
ysiz = LSWAPIB(*(long *)&buf[12]);
if ((*(long *)&buf[80])&LSWAPIB(64)) //Uncompressed supports only A8R8G8B8 for now
{
if ((*(long *)&buf[88]) != LSWAPIB(32)) return(-1);
if ((*(long *)&buf[92]) != LSWAPIB(0x00ff0000)) return(-1);
if ((*(long *)&buf[96]) != LSWAPIB(0x0000ff00)) return(-1);
if ((*(long *)&buf[100]) != LSWAPIB(0x000000ff)) return(-1);
if ((*(long *)&buf[104]) != LSWAPIB(0xff000000)) return(-1);
if ((*(long *)&buf[88]) != (signed)LSWAPIB(32)) return(-1);
if ((*(long *)&buf[92]) != (signed)LSWAPIB(0x00ff0000)) return(-1);
if ((*(long *)&buf[96]) != (signed)LSWAPIB(0x0000ff00)) return(-1);
if ((*(long *)&buf[100]) != (signed)LSWAPIB(0x000000ff)) return(-1);
if ((*(long *)&buf[104]) != (signed)LSWAPIB(0xff000000)) return(-1);
buf += 128;
j = yoff*bpl + (xoff<<2) + frameptr; xx = (xsiz<<2);

View file

@ -218,7 +218,7 @@ extern short spawn(short j,short pn);
extern void animatesprites(long x,long y,short a,long smoothratio);
extern void cheats(void);
extern void nonsharedkeys(void);
extern void comlinehelp(char **argv);
extern void comlinehelp(void);
extern void checkcommandline(int argc,char **argv);
extern void printstr(short x,short y,char string[],char attribute);
extern void Logo(void);

View file

@ -7352,6 +7352,7 @@ FOUNDCHEAT:
hittype[ps[myconnectindex].i].extra = 0;
ps[myconnectindex].cheat_phase = 0;
KB_FlushKeyBoardQueue();
Bstrcpy(terminx,terminx);
return;
case CHEAT_STUFF:
@ -8161,7 +8162,7 @@ FAKE_F3:
}
}
void comlinehelp(char **argv)
void comlinehelp(void)
{
char *s = "Command line help.\n"
"?, -?\t\tThis help message\n"
@ -8563,7 +8564,7 @@ void checkcommandline(int argc,char **argv)
switch (*c)
{
case '?':
comlinehelp(argv);
comlinehelp();
exit(0);
break;
case 'a':
@ -8719,7 +8720,7 @@ void checkcommandline(int argc,char **argv)
}
else
{
comlinehelp(argv);
comlinehelp();
exit(-1);
}
break;

View file

@ -48,12 +48,6 @@ int MUSIC_ErrorCode = MUSIC_Ok;
static midifuncs MUSIC_MidiFunctions;
static int MUSIC_FadeLength;
static int MUSIC_FadeRate;
static unsigned MUSIC_CurrentFadeVolume;
static unsigned MUSIC_LastFadeVolume;
static int MUSIC_EndingFadeVolume;
int MUSIC_InitMidi(int card, midifuncs *Funcs, int Address);
#define MUSIC_SetErrorCode( status ) \
@ -483,8 +477,6 @@ int MUSIC_InitMidi
)
{
int status;
Funcs->NoteOff = MPU_NoteOff;
Funcs->NoteOn = MPU_NoteOn;
Funcs->PolyAftertouch = MPU_PolyAftertouch;
@ -517,8 +509,6 @@ int MUSIC_FadeVolume
)
{
int fromvolume;
MIDI_SetVolume(tovolume);
return(MUSIC_Ok);
}

View file

@ -38,7 +38,9 @@ extern "C" {
#endif
#ifdef __GNUC__
# ifndef PACKED
# define PACKED __attribute__ ((packed))
# endif
#else
# define PACKED
# ifdef _MSC_VER

View file

@ -224,7 +224,7 @@ void playmusic(char *fn)
kread(fp, MusicPtr, l);
kclose(fp);
MUSIC_PlaySong(MusicPtr, MUSIC_LoopSong);
MUSIC_PlaySong((unsigned char *)MusicPtr, MUSIC_LoopSong);
#else
void PlayMusic(char *_filename);
if(MusicToggle == 0) return;