summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2005-08-04 18:42:15 +0000
committerSimon Howard2005-08-04 18:42:15 +0000
commit3aeb98b92575dccb70df15c393c95a72891ce205 (patch)
tree63720b4d6abb9f71a603984ea3997554d0e9aa99 /src
parentb500013f80419217013ada4211662e9bea2702e4 (diff)
downloadchocolate-doom-3aeb98b92575dccb70df15c393c95a72891ce205.tar.gz
chocolate-doom-3aeb98b92575dccb70df15c393c95a72891ce205.tar.bz2
chocolate-doom-3aeb98b92575dccb70df15c393c95a72891ce205.zip
Silence compiler warnings
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 37
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/am_map.c17
-rw-r--r--src/d_main.c9
-rw-r--r--src/i_net.c21
-rw-r--r--src/i_system.c9
-rw-r--r--src/i_video.c12
-rw-r--r--src/m_misc.c42
-rw-r--r--src/p_floor.c11
-rw-r--r--src/p_maputl.c11
-rw-r--r--src/r_segs.c15
-rw-r--r--src/r_things.c10
-rw-r--r--src/s_sound.c9
-rw-r--r--src/w_wad.c10
13 files changed, 102 insertions, 76 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c6f81344..da155954 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
bindir = $(prefix)/bin
-CFLAGS = @CFLAGS@ @SDL_CFLAGS@ -DNORMALUNIX
+CFLAGS = @CFLAGS@ @SDL_CFLAGS@ -DNORMALUNIX -Wall
LDFLAGS = @LDFLAGS@ @SDL_LIBS@
chocolate_doom_SOURCES=\
diff --git a/src/am_map.c b/src/am_map.c
index c78015d7..3be51d92 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: am_map.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: am_map.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -23,6 +23,9 @@
//
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -37,7 +40,7 @@
//
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: am_map.c 19 2005-07-23 19:17:11Z fraggle $";
+static const char rcsid[] = "$Id: am_map.c 37 2005-08-04 18:42:15Z fraggle $";
#include <stdio.h>
@@ -799,7 +802,7 @@ void AM_doFollowPlayer(void)
//
void AM_updateLightLev(void)
{
- static nexttic = 0;
+ static int nexttic = 0;
//static int litelevels[] = { 0, 3, 5, 6, 6, 7, 7, 7 };
static int litelevels[] = { 0, 4, 7, 10, 12, 14, 15, 15 };
static int litelevelscnt = 0;
@@ -872,9 +875,9 @@ AM_clipMline
TOP =8
};
- register outcode1 = 0;
- register outcode2 = 0;
- register outside;
+ register int outcode1 = 0;
+ register int outcode2 = 0;
+ register int outside;
fpoint_t tmp;
int dx;
@@ -1005,7 +1008,7 @@ AM_drawFline
register int ay;
register int d;
- static fuck = 0;
+ static int fuck = 0;
// For debugging only
if ( fl->a.x < 0 || fl->a.x >= f_w
diff --git a/src/d_main.c b/src/d_main.c
index ab85e1d0..aaed9a62 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: d_main.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: d_main.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.2 2005/07/23 16:44:55 fraggle
// Update copyright to GNU GPL
//
@@ -38,7 +41,7 @@
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: d_main.c 8 2005-07-23 16:44:57Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 37 2005-08-04 18:42:15Z fraggle $";
#define BGCOLOR 7
#define FGCOLOR 8
@@ -163,7 +166,7 @@ int eventtail;
void D_PostEvent (event_t* ev)
{
events[eventhead] = *ev;
- eventhead = (++eventhead)&(MAXEVENTS-1);
+ eventhead = (eventhead + 1) & (MAXEVENTS-1);
}
diff --git a/src/i_net.c b/src/i_net.c
index 1d072567..e54b7b31 100644
--- a/src/i_net.c
+++ b/src/i_net.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_net.c 18 2005-07-23 18:56:07Z fraggle $
+// $Id: i_net.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 18:56:07 fraggle
// Remove unneccessary pragmas
//
@@ -37,7 +40,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_net.c 18 2005-07-23 18:56:07Z fraggle $";
+rcsid[] = "$Id: i_net.c 37 2005-08-04 18:42:15Z fraggle $";
#include <stdlib.h>
#include <string.h>
@@ -64,20 +67,6 @@ rcsid[] = "$Id: i_net.c 18 2005-07-23 18:56:07Z fraggle $";
-// For some odd reason...
-#define ntohl(x) \
- ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \
- (((unsigned long int)(x) & 0x0000ff00U) << 8) | \
- (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \
- (((unsigned long int)(x) & 0xff000000U) >> 24)))
-
-#define ntohs(x) \
- ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
- (((unsigned short int)(x) & 0xff00) >> 8))) \
-
-#define htonl(x) ntohl(x)
-#define htons(x) ntohs(x)
-
void NetSend (void);
boolean NetListen (void);
diff --git a/src/i_system.c b/src/i_system.c
index 370bba7f..34f46b5e 100644
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_system.c 34 2005-08-04 01:14:37Z fraggle $
+// $Id: i_system.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.7 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.6 2005/08/04 01:14:37 fraggle
// Begin/EndRead now in i_video.c
//
@@ -46,7 +49,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_system.c 34 2005-08-04 01:14:37Z fraggle $";
+rcsid[] = "$Id: i_system.c 37 2005-08-04 18:42:15Z fraggle $";
#include <stdlib.h>
@@ -100,7 +103,7 @@ byte* I_ZoneBase (int* size)
*size = mb_used*1024*1024;
zonemem = malloc (*size);
printf("zone memory: %x, %x allocated for zone\n",
- (long) zonemem, *size);
+ (int) zonemem, *size);
return zonemem;
}
diff --git a/src/i_video.c b/src/i_video.c
index 28ced016..87ccb61b 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 33 2005-08-04 01:13:46Z fraggle $
+// $Id: i_video.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.11 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.10 2005/08/04 01:13:46 fraggle
// Loading disk
//
@@ -62,11 +65,12 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 33 2005-08-04 01:13:46Z fraggle $";
+rcsid[] = "$Id: i_video.c 37 2005-08-04 18:42:15Z fraggle $";
#include <ctype.h>
#include <SDL.h>
+#include "w_wad.h"
#include "z_zone.h"
#include "doomstat.h"
#include "i_system.h"
@@ -181,8 +185,6 @@ static void LoadDiskImage(void)
int xlatekey(SDL_keysym *sym)
{
- int rc;
-
switch(sym->sym)
{
case SDLK_LEFT: return KEY_LEFTARROW;
@@ -289,8 +291,6 @@ static int mousebuttonstate(void)
return result;
}
-static int lastmousex = 0;
-static int lastmousey = 0;
boolean mousemoved = false;
void I_GetEvent(void)
diff --git a/src/m_misc.c b/src/m_misc.c
index 867d548f..8539cf2c 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_misc.c 26 2005-07-24 02:14:04Z fraggle $
+// $Id: m_misc.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -23,6 +23,9 @@
//
//
// $Log$
+// Revision 1.5 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.4 2005/07/24 02:14:04 fraggle
// Move to SDL for graphics.
// Translate key scancodes to correct internal format when reading
@@ -47,7 +50,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: m_misc.c 26 2005-07-24 02:14:04Z fraggle $";
+rcsid[] = "$Id: m_misc.c 37 2005-08-04 18:42:15Z fraggle $";
#include <sys/stat.h>
#include <sys/types.h>
@@ -240,8 +243,8 @@ extern char* chat_macros[];
typedef struct
{
- char* name;
- int* location;
+ char * name;
+ void * location;
int defaultvalue;
int scantranslate; // translate this value to a scancode
int untranslated;
@@ -287,16 +290,16 @@ default_t defaults[] =
{"usegamma",&usegamma, 0},
- {"chatmacro0", (int *) &chat_macros[0], (int) HUSTR_CHATMACRO0 },
- {"chatmacro1", (int *) &chat_macros[1], (int) HUSTR_CHATMACRO1 },
- {"chatmacro2", (int *) &chat_macros[2], (int) HUSTR_CHATMACRO2 },
- {"chatmacro3", (int *) &chat_macros[3], (int) HUSTR_CHATMACRO3 },
- {"chatmacro4", (int *) &chat_macros[4], (int) HUSTR_CHATMACRO4 },
- {"chatmacro5", (int *) &chat_macros[5], (int) HUSTR_CHATMACRO5 },
- {"chatmacro6", (int *) &chat_macros[6], (int) HUSTR_CHATMACRO6 },
- {"chatmacro7", (int *) &chat_macros[7], (int) HUSTR_CHATMACRO7 },
- {"chatmacro8", (int *) &chat_macros[8], (int) HUSTR_CHATMACRO8 },
- {"chatmacro9", (int *) &chat_macros[9], (int) HUSTR_CHATMACRO9 }
+ {"chatmacro0", &chat_macros[0], (int) HUSTR_CHATMACRO0 },
+ {"chatmacro1", &chat_macros[1], (int) HUSTR_CHATMACRO1 },
+ {"chatmacro2", &chat_macros[2], (int) HUSTR_CHATMACRO2 },
+ {"chatmacro3", &chat_macros[3], (int) HUSTR_CHATMACRO3 },
+ {"chatmacro4", &chat_macros[4], (int) HUSTR_CHATMACRO4 },
+ {"chatmacro5", &chat_macros[5], (int) HUSTR_CHATMACRO5 },
+ {"chatmacro6", &chat_macros[6], (int) HUSTR_CHATMACRO6 },
+ {"chatmacro7", &chat_macros[7], (int) HUSTR_CHATMACRO7 },
+ {"chatmacro8", &chat_macros[8], (int) HUSTR_CHATMACRO8 },
+ {"chatmacro9", &chat_macros[9], (int) HUSTR_CHATMACRO9 }
};
@@ -344,7 +347,7 @@ void M_SaveDefaults (void)
if (defaults[i].defaultvalue > -0xfff
&& defaults[i].defaultvalue < 0xfff)
{
- v = *defaults[i].location;
+ v = *((int *)defaults[i].location);
// translate keys back to scancodes
@@ -397,7 +400,7 @@ void M_LoadDefaults (void)
FILE* f;
char def[80];
char strparm[100];
- char* newstring;
+ char* newstring = "";
int parm;
boolean isstring;
@@ -405,7 +408,7 @@ void M_LoadDefaults (void)
numdefaults = sizeof(defaults)/sizeof(defaults[0]);
for (i=0 ; i<numdefaults ; i++)
{
- *defaults[i].location = defaults[i].defaultvalue;
+ *((int *) defaults[i].location) = defaults[i].defaultvalue;
defaults[i].untranslated = 0;
}
// check for a custom default file
@@ -453,10 +456,9 @@ void M_LoadDefaults (void)
}
if (!isstring)
- *defaults[i].location = parm;
+ *((int *) defaults[i].location) = parm;
else
- *defaults[i].location =
- (int) newstring;
+ *((char **) defaults[i].location) = newstring;
break;
}
}
diff --git a/src/p_floor.c b/src/p_floor.c
index ca877a7a..9d316327 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: p_floor.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: p_floor.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -38,7 +41,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: p_floor.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: p_floor.c 37 2005-08-04 18:42:15Z fraggle $";
#include "z_zone.h"
@@ -483,8 +486,8 @@ EV_BuildStairs
floormove_t* floor;
- fixed_t stairsize;
- fixed_t speed;
+ fixed_t stairsize = 0;
+ fixed_t speed = 0;
secnum = -1;
rtn = 0;
diff --git a/src/p_maputl.c b/src/p_maputl.c
index 1566263a..8a7eac1e 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: p_maputl.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: p_maputl.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -41,7 +44,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: p_maputl.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: p_maputl.c 37 2005-08-04 18:42:15Z fraggle $";
#include <stdlib.h>
@@ -127,8 +130,8 @@ P_BoxOnLineSide
( fixed_t* tmbox,
line_t* ld )
{
- int p1;
- int p2;
+ int p1 = 0;
+ int p2 = 0;
switch (ld->slopetype)
{
diff --git a/src/r_segs.c b/src/r_segs.c
index 37acec22..d9e035bb 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: r_segs.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: r_segs.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -39,7 +42,7 @@
static const char
-rcsid[] = "$Id: r_segs.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: r_segs.c 37 2005-08-04 18:42:15Z fraggle $";
@@ -230,8 +233,6 @@ void R_RenderSegLoop (void)
int top;
int bottom;
- //texturecolumn = 0; // shut up compiler warning
-
for ( ; rw_x < rw_stopx ; rw_x++)
{
// mark floor / ceiling areas
@@ -291,6 +292,12 @@ void R_RenderSegLoop (void)
dc_x = rw_x;
dc_iscale = 0xffffffffu / (unsigned)rw_scale;
}
+ else
+ {
+ // purely to shut up the compiler
+
+ texturecolumn = 0;
+ }
// draw the wall tiers
if (midtexture)
diff --git a/src/r_things.c b/src/r_things.c
index aab5ad9e..779354dc 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: r_things.c 19 2005-07-23 19:17:11Z fraggle $
+// $Id: r_things.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.3 2005/07/23 19:17:11 fraggle
// Use ANSI-standard limit constants. Remove LINUX define.
//
@@ -39,7 +42,7 @@
static const char
-rcsid[] = "$Id: r_things.c 19 2005-07-23 19:17:11Z fraggle $";
+rcsid[] = "$Id: r_things.c 37 2005-08-04 18:42:15Z fraggle $";
#include <stdio.h>
@@ -828,11 +831,12 @@ void R_SortVisSprites (void)
unsorted.prev = vissprite_p-1;
// pull the vissprites out by scale
- //best = 0; // shut up the compiler warning
+
vsprsortedhead.next = vsprsortedhead.prev = &vsprsortedhead;
for (i=0 ; i<count ; i++)
{
bestscale = INT_MAX;
+ best = unsorted.next;
for (ds=unsorted.next ; ds!= &unsorted ; ds=ds->next)
{
if (ds->scale < bestscale)
diff --git a/src/s_sound.c b/src/s_sound.c
index 85e43f59..1d3b18ec 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: s_sound.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: s_sound.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.2 2005/07/23 16:44:57 fraggle
// Update copyright to GNU GPL
//
@@ -35,7 +38,7 @@
static const char
-rcsid[] = "$Id: s_sound.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: s_sound.c 37 2005-08-04 18:42:15Z fraggle $";
@@ -664,7 +667,7 @@ S_ChangeMusic
( int musicnum,
int looping )
{
- musicinfo_t* music;
+ musicinfo_t* music = NULL;
char namebuf[9];
if ( (musicnum <= mus_None)
diff --git a/src/w_wad.c b/src/w_wad.c
index 8415fbd5..5fdcf3d0 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: w_wad.c 33 2005-08-04 01:13:46Z fraggle $
+// $Id: w_wad.c 37 2005-08-04 18:42:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2005/08/04 18:42:15 fraggle
+// Silence compiler warnings
+//
// Revision 1.4 2005/08/04 01:13:46 fraggle
// Loading disk
//
@@ -42,15 +45,18 @@
static const char
-rcsid[] = "$Id: w_wad.c 33 2005-08-04 01:13:46Z fraggle $";
+rcsid[] = "$Id: w_wad.c 37 2005-08-04 18:42:15Z fraggle $";
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "doomtype.h"
#include "m_swap.h"
#include "i_system.h"
+#include "i_video.h"
#include "z_zone.h"
#include "w_wad.h"