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

@ -31,13 +31,13 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
struct player_struct; // JBF: duke3d.h defines this later
extern void sendscore(char *s);
extern void SoundStartup(void );
extern void SoundShutdown(void );
extern void MusicStartup(void );
extern void MusicShutdown(void );
extern void SoundStartup(void);
extern void SoundShutdown(void);
extern void MusicStartup(void);
extern void MusicShutdown(void);
extern int USRHOOKS_GetMem(char **ptr,unsigned long size);
extern int USRHOOKS_FreeMem(char *ptr);
extern void intomenusounds(void );
extern void intomenusounds(void);
extern void playmusic(char *fn);
extern char loadsound(unsigned short num);
extern int xyzsound(short num,short i,long x,long y,long z);
@ -45,7 +45,7 @@ extern void sound(short num);
extern int spritesound(unsigned short num,short i);
extern void stopsound(short num);
extern void stopenvsound(short num,short i);
extern void pan3dsound(void );
extern void pan3dsound(void);
extern void testcallback(unsigned long num);
extern void clearsoundlocks(void);
extern short callsound(short sn,short whatsprite);
@ -58,11 +58,11 @@ extern long ldist(spritetype *s1,spritetype *s2);
extern long dist(spritetype *s1,spritetype *s2);
extern short findplayer(spritetype *s,long *d);
extern short findotherplayer(short p,long *d);
extern void doanimations(void );
extern void doanimations(void);
extern int getanimationgoal(long *animptr);
extern int setanimation(short animsect,long *animptr,long thegoal,long thevel);
extern void animatecamsprite(void );
extern void animatewalls(void );
extern void animatecamsprite(void);
extern void animatewalls(void);
extern char activatewarpelevators(short s,short d);
extern void operatesectors(short sn,short ii);
extern void operaterespawns(short low);
@ -75,19 +75,19 @@ extern void checkhitwall(short spr,short dawallnum,long x,long y,long z,short at
extern void checkplayerhurt(struct player_struct *p,short j);
extern char checkhitceiling(short sn);
extern void checkhitsprite(short i,short sn);
extern void allignwarpelevators(void );
extern void allignwarpelevators(void);
extern void cheatkeys(short snum);
extern void checksectors(short snum);
extern int32 RTS_AddFile(char *filename);
extern void RTS_Init(char *filename);
extern int32 RTS_NumSounds(void );
extern int32 RTS_NumSounds(void);
extern int32 RTS_SoundLength(int32 lump);
extern char *RTS_GetSoundName(int32 i);
extern void RTS_ReadLump(int32 lump,void *dest);
extern void *RTS_GetSound(int32 lump);
extern void docacheit(void);
extern void xyzmirror(short i,short wn);
extern void vscrn(void );
extern void vscrn(void);
extern void pickrandomspot(short snum);
extern void resetplayerstats(short snum);
extern void resetweapons(short snum);
@ -95,17 +95,17 @@ extern void resetinventory(short snum);
extern void resetprestat(short snum,char g);
extern void setupbackdrop(short backpicnum);
extern void cachespritenum(short i);
extern void cachegoodsprites(void );
extern void cachegoodsprites(void);
extern void prelevel(char g);
extern void newgame(char vn,char ln,char sk);
extern void resetpspritevars(char g);
extern void resettimevars(void );
extern void genspriteremaps(void );
extern void resettimevars(void);
extern void genspriteremaps(void);
extern void waitforeverybody(void);
extern char checksum(long sum);
extern char getsound(unsigned short num);
extern void precachenecessarysounds(void );
extern void cacheit(void );
extern void precachenecessarysounds(void);
extern void cacheit(void);
extern void dofrontscreens(char *);
extern void clearfifo(void);
extern void resetmys(void);
@ -139,15 +139,15 @@ extern void getangplayers(short snum);
// extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
extern int loadplayer(signed char spot);
extern int saveplayer(signed char spot);
extern void sendgameinfo(void );
extern void sendgameinfo(void);
extern int probe(int x,int y,int i,int n);
extern int menutext(int x,int y,short s,short p,char *t);
extern void bar(int x,int y,short *p,short dainc,char damodify,short s,short pa);
extern void barsm(int x,int y,short *p,short dainc,char damodify,short s,short pa);
extern void dispnames(void );
extern void dispnames(void);
extern int getfilenames(char *path, char kind[]);
extern void sortfilenames(void);
extern void menus(void );
extern void menus(void);
extern void palto(char r,char g,char b,long e);
extern void drawoverheadmap(long cposx,long cposy,long czoom,short cang);
extern void playanm(char *fn,char);
@ -156,12 +156,12 @@ extern char ispecial(char c);
extern char isaltok(char c);
extern void getglobalz(short sActor);
extern void makeitfall(short sActor);
extern void getlabel(void );
extern long keyword(void );
extern long transword(void );
extern void getlabel(void);
extern long keyword(void);
extern long transword(void);
extern long transnum(long type);
extern char parsecommand(void );
extern void passone(void );
extern char parsecommand(void);
extern void passone(void);
extern void loadefs(char *fn);
extern char dodge(spritetype *s);
extern short furthestangle(short sActor,short angs);
@ -169,7 +169,7 @@ extern short furthestcanseepoint(short sActor,spritetype *ts,long *dax,long *day
extern void alterang(short a);
extern void move(void);
extern void parseifelse(long condition);
extern char parse(void );
extern char parse(void);
extern void execute(short sActor,short sPlayer,long lDist);
extern void overwritesprite(long thex,long they,short tilenum,signed char shade,char stat,char dapalnum);
extern void timerhandler(void);
@ -177,11 +177,11 @@ extern int gametext(int x,int y,char *t,char s,short dabits);
extern int gametextpal(int x,int y,char *t,char s,char p);
extern int minitext(int x,int y,char *t,char p,short sb);
extern void gamenumber(long x,long y,long n,char s);
extern void Shutdown(void );
extern void allowtimetocorrecterrorswhenquitting(void );
extern void getpackets(void );
extern void Shutdown(void);
extern void allowtimetocorrecterrorswhenquitting(void);
extern void getpackets(void);
extern void faketimerhandler(void);
extern void checksync(void );
extern void checksync(void);
extern void check_fta_sounds(short i);
extern inline short inventory(spritetype *s);
extern short badguy(spritetype *s);
@ -195,49 +195,49 @@ extern void weapon_amounts(struct player_struct *p,long x,long y,long u);
extern void digitalnumber(long x,long y,long n,char s,char cs);
extern void scratchmarks(long x,long y,long n,char s,char p);
extern void displayinventory(struct player_struct *p);
extern void displayfragbar(void );
extern void displayfragbar(void);
extern void coolgaugetext(short snum);
extern void tics(void );
extern void clocks(void );
extern void tics(void);
extern void clocks(void);
extern void coords(short snum);
extern void operatefta(void);
extern void FTA(short q,struct player_struct *p);
extern void showtwoscreens(void );
extern void binscreen(void );
extern void showtwoscreens(void);
extern void binscreen(void);
extern void gameexit(char *t);
extern short strget(short x,short y,char *t,short dalen,short c);
extern void displayrest(long smoothratio);
extern void updatesectorz(long x,long y,long z,short *sectnum);
extern void view(struct player_struct *pp,long *vx,long *vy,long *vz,short *vsectnum,short ang,short horiz);
extern void drawbackground(void );
extern void drawbackground(void);
extern void displayrooms(short snum,long smoothratio);
extern short LocateTheLocator(short n,short sn);
extern short EGS(short whatsect,long s_x,long s_y,long s_z,short s_pn,signed char s_s,signed char s_xr,signed char s_yr,short s_a,short s_ve,long s_zv,short s_ow,signed char s_ss);
extern char wallswitchcheck(short i);
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 cheats(void);
extern void nonsharedkeys(void);
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 );
extern void loadtmb(void );
extern void compilecons(void );
extern void Startup(void );
extern void getnames(void );
extern void Logo(void);
extern void loadtmb(void);
extern void compilecons(void);
extern void Startup(void);
extern void getnames(void);
extern int main(int argc,char **argv);
extern char opendemoread(char which_demo);
extern void opendemowrite(void );
extern void record(void );
extern void closedemowrite(void );
extern long playback(void );
extern void opendemowrite(void);
extern void record(void);
extern void closedemowrite(void);
extern long playback(void);
extern char moveloop(void);
extern void fakedomovethingscorrect(void);
extern void fakedomovethings(void );
extern char domovethings(void );
extern void fakedomovethings(void);
extern char domovethings(void);
extern void displaybonuspics(short x,short y,short p);
extern void doorders(void );
extern void doorders(void);
extern void dobonus(char bonusonly);
extern void cameratext(short i);
extern void vglass(long x,long y,short a,short wn,short n);
@ -245,23 +245,23 @@ extern void lotsofglass(short i,short wallnum,short n);
extern void spriteglass(short i,short n);
extern void ceilingglass(short i,short sectnum,short n);
extern void lotsofcolourglass(short i,short wallnum,short n);
extern void SetupGameButtons(void );
extern long GetTime(void );
extern void CenterCenter(void );
extern void UpperLeft(void );
extern void LowerRight(void );
extern void CenterThrottle(void );
extern void CenterRudder(void );
extern void CONFIG_GetSetupFilename(void );
extern void SetupGameButtons(void);
extern long GetTime(void);
extern void CenterCenter(void);
extern void UpperLeft(void);
extern void LowerRight(void);
extern void CenterThrottle(void);
extern void CenterRudder(void);
extern void CONFIG_GetSetupFilename(void);
extern int32 CONFIG_FunctionNameToNum(char *func);
extern char *CONFIG_FunctionNumToName(int32 func);
extern int32 CONFIG_AnalogNameToNum(char *func);
extern char *CONFIG_AnalogNumToName(int32 func);
extern void CONFIG_SetDefaults(void );
extern void CONFIG_ReadKeys(void );
extern void readsavenames(void );
extern int32 CONFIG_ReadSetup(void );
extern void CONFIG_WriteSetup(void );
extern void CONFIG_SetDefaults(void);
extern void CONFIG_ReadKeys(void);
extern void readsavenames(void);
extern int32 CONFIG_ReadSetup(void);
extern void CONFIG_WriteSetup(void);
extern void CheckAnimStarted(char *funcname);
extern uint16 findpage(uint16 framenumber);
extern void loadpage(uint16 pagenumber,uint16 *pagepointer);
@ -292,21 +292,21 @@ extern void guts(spritetype *s,short gtype,short n,short p);
extern void setsectinterpolate(short i);
extern void clearsectinterpolate(short i);
extern void ms(short i);
extern void movefta(void );
extern void movefta(void);
extern short ifhitsectors(short sectnum);
extern short ifhitbyweapon(short sn);
extern void movecyclers(void );
extern void movedummyplayers(void );
extern void moveplayers(void );
extern void movefx(void );
extern void movefallers(void );
extern void movestandables(void );
extern void movecyclers(void);
extern void movedummyplayers(void);
extern void moveplayers(void);
extern void movefx(void);
extern void movefallers(void);
extern void movestandables(void);
extern void bounce(short i);
extern void moveweapons(void );
extern void movetransports(void );
extern void moveeffectors(void );
extern void moveactors(void );
extern void moveexplosions(void );
extern void moveweapons(void);
extern void movetransports(void);
extern void moveeffectors(void);
extern void moveactors(void);
extern void moveexplosions(void);
// game.c
extern void setstatusbarscale(long sc);

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__
# define PACKED __attribute__ ((packed))
# 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;