Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Silence some compiler warnings on heretic/hexen code.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1228
  • Loading branch information...
commit 609dca9fdf9a03500c0f4023da7bcc4389f36c52 1 parent 7019bf0
Simon Howard fragglet authored
8 src/heretic/am_map.c
View
@@ -796,8 +796,8 @@ boolean AM_clipMline(mline_t * ml, fline_t * fl)
{
enum
{ LEFT = 1, RIGHT = 2, BOTTOM = 4, TOP = 8 };
- register outcode1 = 0, outcode2 = 0, outside;
- fpoint_t tmp;
+ int outcode1 = 0, outcode2 = 0, outside;
+ fpoint_t tmp = { 0, 0 };
int dx, dy;
#define DOOUTCODE(oc, mx, my) \
@@ -902,7 +902,7 @@ void AM_drawFline(fline_t * fl, int color)
{
register int x, y, dx, dy, sx, sy, ax, ay, d;
- static fuck = 0;
+ static int fuck = 0;
switch (color)
{
@@ -1448,8 +1448,6 @@ void AM_drawCrosshair(int color)
void AM_Drawer(void)
{
- int highestEpisode;
-
if (!automapactive)
return;
2  src/heretic/ct_chat.c
View
@@ -387,7 +387,7 @@ void CT_Drawer(void)
void CT_queueChatChar(char ch)
{
- if ((tail + 1) & (QUEUESIZE - 1) == head)
+ if (((tail + 1) & (QUEUESIZE - 1)) == head)
{ // the queue is full
return;
}
4 src/heretic/d_main.c
View
@@ -107,7 +107,7 @@ int eventtail;
void D_PostEvent(event_t * ev)
{
events[eventhead] = *ev;
- eventhead = (++eventhead) & (MAXEVENTS - 1);
+ eventhead = (eventhead + 1) & (MAXEVENTS - 1);
}
//---------------------------------------------------------------------------
@@ -123,7 +123,7 @@ void D_ProcessEvents(void)
event_t *ev;
for (; eventtail != eventhead;
- eventtail = (++eventtail) & (MAXEVENTS - 1))
+ eventtail = (eventtail + 1) & (MAXEVENTS - 1))
{
ev = &events[eventtail];
if (F_Responder(ev))
2  src/heretic/d_net.c
View
@@ -479,7 +479,7 @@ void CheckAbort(void)
I_StartTic();
for (; eventtail != eventhead;
- eventtail = (++eventtail) & (MAXEVENTS - 1))
+ eventtail = (eventtail + 1) & (MAXEVENTS - 1))
{
ev = &events[eventtail];
if (ev->type == ev_keydown && ev->data1 == KEY_ESCAPE)
37 src/heretic/g_game.c
View
@@ -62,23 +62,22 @@ struct
{
mobjtype_t type;
int speed[2];
-} MonsterMissileInfo[] =
-{
- { MT_IMPBALL, 10, 20},
- { MT_MUMMYFX1, 9, 18},
- { MT_KNIGHTAXE, 9, 18},
- { MT_REDAXE, 9, 18},
- { MT_BEASTBALL, 12, 20},
- { MT_WIZFX1, 18, 24},
- { MT_SNAKEPRO_A, 14, 20},
- { MT_SNAKEPRO_B, 14, 20},
- { MT_HEADFX1, 13, 20},
- { MT_HEADFX3, 10, 18},
- { MT_MNTRFX1, 20, 26},
- { MT_MNTRFX2, 14, 20},
- { MT_SRCRFX1, 20, 28},
- { MT_SOR2FX1, 20, 28},
- { -1, -1, -1} // Terminator
+} MonsterMissileInfo[] = {
+ { MT_IMPBALL, { 10, 20 } },
+ { MT_MUMMYFX1, { 9, 18 } },
+ { MT_KNIGHTAXE, { 9, 18 } },
+ { MT_REDAXE, { 9, 18 } },
+ { MT_BEASTBALL, { 12, 20 } },
+ { MT_WIZFX1, { 18, 24 } },
+ { MT_SNAKEPRO_A, { 14, 20 } },
+ { MT_SNAKEPRO_B, { 14, 20 } },
+ { MT_HEADFX1, { 13, 20 } },
+ { MT_HEADFX3, { 10, 18 } },
+ { MT_MNTRFX1, { 20, 26 } },
+ { MT_MNTRFX2, { 14, 20 } },
+ { MT_SRCRFX1, { 20, 28 } },
+ { MT_SOR2FX1, { 20, 28 } },
+ { -1, { -1, -1 } } // Terminator
};
FILE *SaveGameFP;
@@ -930,7 +929,7 @@ boolean G_Responder(event_t * ev)
void G_Ticker(void)
{
int i, buf;
- ticcmd_t *cmd;
+ ticcmd_t *cmd = NULL;
//
// do player reborns if needed
@@ -1499,7 +1498,7 @@ void G_DoLoadGame(void)
// Skip the description field
memset(vcheck, 0, sizeof(vcheck));
sprintf(vcheck, "version %i", VERSION);
- if (strcmp(save_p, vcheck))
+ if (strcmp((char *) save_p, vcheck) != 0)
{ // Bad version
return;
}
1  src/heretic/in_lude.c
View
@@ -815,7 +815,6 @@ void IN_DrawDMStats(void)
int ypos;
int xpos;
int kpos;
- int x;
static int sounds;
5 src/heretic/p_enemy.c
View
@@ -23,6 +23,7 @@
// P_enemy.c
+#include <stdlib.h>
#include "doomdef.h"
#include "p_local.h"
#include "soundst.h"
@@ -2375,7 +2376,7 @@ void A_BossDeath(mobj_t * actor)
void A_ESound(mobj_t * mo)
{
- int sound;
+ int sound = sfx_None;
switch (mo->type)
{
@@ -2446,7 +2447,7 @@ void A_AccTeleGlitter(mobj_t * actor)
void A_InitKeyGizmo(mobj_t * gizmo)
{
mobj_t *mo;
- statenum_t state;
+ statenum_t state = S_NULL;
switch (gizmo->type)
{
6 src/heretic/p_inter.c
View
@@ -1162,7 +1162,11 @@ void P_AutoUseHealth(player_t * player, int saveHealth)
int superCount;
int superSlot;
- normalCount = superCount = 0;
+ normalCount = 0;
+ superCount = 0;
+ normalSlot = 0;
+ superSlot = 0;
+
for (i = 0; i < player->inventorySlotNum; i++)
{
if (player->inventory[i].type == arti_health)
49 src/heretic/p_map.c
View
@@ -22,6 +22,8 @@
//-----------------------------------------------------------------------------
// P_map.c
+#include <stdlib.h>
+
#include "doomdef.h"
#include "p_local.h"
#include "soundst.h"
@@ -40,21 +42,48 @@
mobj_t NOTES
-mobj_ts are used to tell the refresh where to draw an image, tell the world simulation when objects are contacted, and tell the sound driver how to position a sound.
-
-The refresh uses the next and prev links to follow lists of things in sectors as they are being drawn. The sprite, frame, and angle elements determine which patch_t is used to draw the sprite if it is visible. The sprite and frame values are allmost allways set from state_t structures. The statescr.exe utility generates the states.h and states.c files that contain the sprite/frame numbers from the statescr.txt source file. The xyz origin point represents a point at the bottom middle of the sprite (between the feet of a biped). This is the default origin position for patch_ts grabbed with lumpy.exe. A walking creature will have its z equal to the floor it is standing on.
+mobj_ts are used to tell the refresh where to draw an image, tell the world
+simulation when objects are contacted, and tell the sound driver how to
+position a sound.
+
+The refresh uses the next and prev links to follow lists of things in sectors
+as they are being drawn. The sprite, frame, and angle elements determine which
+patch_t is used to draw the sprite if it is visible. The sprite and frame
+values are allmost allways set from state_t structures. The statescr.exe
+utility generates the states.h and states.c files that contain the sprite/frame
+numbers from the statescr.txt source file. The xyz origin point represents a
+point at the bottom middle of the sprite (between the feet of a biped). This
+is the default origin position for patch_ts grabbed with lumpy.exe. A walking
+creature will have its z equal to the floor it is standing on.
-The sound code uses the x,y, and subsector fields to do stereo positioning of any sound effited by the mobj_t.
+The sound code uses the x,y, and subsector fields to do stereo positioning of
+any sound effited by the mobj_t.
-The play simulation uses the blocklinks, x,y,z, radius, height to determine when mobj_ts are touching each other, touching lines in the map, or hit by trace lines (gunshots, lines of sight, etc). The mobj_t->flags element has various bit flags used by the simulation.
+The play simulation uses the blocklinks, x,y,z, radius, height to determine
+when mobj_ts are touching each other, touching lines in the map, or hit by
+trace lines (gunshots, lines of sight, etc). The mobj_t->flags element has
+various bit flags used by the simulation.
Every mobj_t is linked into a single sector based on it's origin coordinates.
-The subsector_t is found with R_PointInSubsector(x,y), and the sector_t can be found with subsector->sector. The sector links are only used by the rendering code, the play simulation does not care about them at all.
-
-Any mobj_t that needs to be acted upon be something else in the play world (block movement, be shot, etc) will also need to be linked into the blockmap. If the thing has the MF_NOBLOCK flag set, it will not use the block links. It can still interact with other things, but only as the instigator (missiles will run into other things, but nothing can run into a missile). Each block in the grid is 128*128 units, and knows about every line_t that it contains a piece of, and every interactable mobj_t that has it's origin contained.
-
-A valid mobj_t is a mobj_t that has the proper subsector_t filled in for it's xy coordinates and is linked into the subsector's sector or has the MF_NOSECTOR flag set (the subsector_t needs to be valid even if MF_NOSECTOR is set), and is linked into a blockmap block or has the MF_NOBLOCKMAP flag set. Links should only be modified by the P_[Un]SetThingPosition () functions. Do not change the MF_NO? flags while a thing is valid.
+The subsector_t is found with R_PointInSubsector(x,y), and the sector_t can be
+found with subsector->sector. The sector links are only used by the rendering
+code, the play simulation does not care about them at all.
+
+Any mobj_t that needs to be acted upon be something else in the play world
+(block movement, be shot, etc) will also need to be linked into the blockmap.
+If the thing has the MF_NOBLOCK flag set, it will not use the block links. It
+can still interact with other things, but only as the instigator (missiles will
+run into other things, but nothing can run into a missile). Each block in
+the grid is 128*128 units, and knows about every line_t that it contains a
+piece of, and every interactable mobj_t that has it's origin contained.
+
+A valid mobj_t is a mobj_t that has the proper subsector_t filled in for it's
+xy coordinates and is linked into the subsector's sector or has the MF_NOSECTOR
+flag set (the subsector_t needs to be valid even if MF_NOSECTOR is set), and is
+linked into a blockmap block or has the MF_NOBLOCKMAP flag set. Links should
+only be modified by the P_[Un]SetThingPosition () functions. Do not change
+the MF_NO? flags while a thing is valid.
===============================================================================
4 src/heretic/p_maputl.c
View
@@ -23,6 +23,8 @@
// P_maputl.c
+#include <stdlib.h>
+
#include "doomdef.h"
#include "p_local.h"
@@ -98,7 +100,7 @@ int P_PointOnLineSide(fixed_t x, fixed_t y, line_t * line)
int P_BoxOnLineSide(fixed_t * tmbox, line_t * ld)
{
- int p1, p2;
+ int p1 = 0, p2 = 0;
switch (ld->slopetype)
{
2  src/heretic/p_pspr.c
View
@@ -1068,7 +1068,7 @@ void A_FireMacePL1B(player_t * player, pspdef_t * psp)
player->ammo[am_mace] -= USE_MACE_AMMO_1;
pmo = player->mo;
ball = P_SpawnMobj(pmo->x, pmo->y, pmo->z + 28 * FRACUNIT
- - FOOTCLIPSIZE * (pmo->flags2 & MF2_FEETARECLIPPED !=
+ - FOOTCLIPSIZE * ((pmo->flags2 & MF2_FEETARECLIPPED) !=
0), MT_MACEFX2);
ball->momz = 2 * FRACUNIT + ((player->lookdir) << (FRACBITS - 5));
angle = pmo->angle;
2  src/heretic/p_sight.c
View
@@ -22,6 +22,8 @@
//-----------------------------------------------------------------------------
// P_sight.c
+#include <stdlib.h>
+
#include "doomdef.h"
#include "p_local.h"
4 src/heretic/p_user.c
View
@@ -23,6 +23,8 @@
// P_user.c
+#include <stdlib.h>
+
#include "doomdef.h"
#include "p_local.h"
#include "soundst.h"
@@ -1001,7 +1003,7 @@ boolean P_UseArtifact(player_t * player, artitype_t arti)
player->mo->y + 24 * finesine[angle],
player->mo->z -
15 * FRACUNIT *
- (player->mo->flags2 & MF2_FEETARECLIPPED != 0),
+ (player->mo->flags2 & MF2_FEETARECLIPPED) != 0,
MT_FIREBOMB);
mo->target = player->mo;
break;
1  src/heretic/r_main.c
View
@@ -22,6 +22,7 @@
//-----------------------------------------------------------------------------
// R_main.c
+#include <stdlib.h>
#include <math.h>
#include "doomdef.h"
#include "r_local.h"
1  src/heretic/r_plane.c
View
@@ -22,6 +22,7 @@
//-----------------------------------------------------------------------------
// R_planes.c
+#include <stdlib.h>
#include "doomdef.h"
#include "r_local.h"
4 src/heretic/r_segs.c
View
@@ -29,6 +29,8 @@
//**
//**************************************************************************
+#include <stdlib.h>
+
#include "doomdef.h"
#include "r_local.h"
@@ -189,7 +191,7 @@ void R_RenderSegLoop(void)
fixed_t texturecolumn;
int top, bottom;
-// texturecolumn = 0; // shut up compiler warning
+ texturecolumn = 0; // shut up compiler warning
for (; rw_x < rw_stopx; rw_x++)
{
4 src/hexen/am_map.c
View
@@ -703,8 +703,8 @@ boolean AM_clipMline(mline_t * ml, fline_t * fl)
{
enum
{ LEFT = 1, RIGHT = 2, BOTTOM = 4, TOP = 8 };
- register outcode1 = 0, outcode2 = 0, outside;
- fpoint_t tmp;
+ int outcode1 = 0, outcode2 = 0, outside;
+ fpoint_t tmp = { 0, 0 };
int dx, dy;
#define DOOUTCODE(oc, mx, my) \
2  src/hexen/ct_chat.c
View
@@ -412,7 +412,7 @@ void CT_Drawer(void)
void CT_queueChatChar(char ch)
{
- if ((tail + 1) & (QUEUESIZE - 1) == head)
+ if (((tail + 1) & (QUEUESIZE - 1)) == head)
{ // the queue is full
return;
}
6 src/hexen/d_net.c
View
@@ -517,7 +517,7 @@ void CheckAbort(void)
I_StartTic();
for (; eventtail != eventhead;
- eventtail = (++eventtail) & (MAXEVENTS - 1))
+ eventtail = (eventtail + 1) & (MAXEVENTS - 1))
{
ev = &events[eventtail];
if (ev->type == ev_keydown && ev->data1 == KEY_ESCAPE)
@@ -722,7 +722,9 @@ void D_CheckNetGame(void)
netbuffer = &doomcom->data;
consoleplayer = displayplayer = doomcom->consoleplayer;
pClass = PCLASS_FIGHTER;
- if (i = M_CheckParm("-class"))
+ i = M_CheckParm("-class");
+
+ if (i > 0)
{
pClass = atoi(myargv[i + 1]);
if (pClass > PCLASS_MAGE || pClass < PCLASS_FIGHTER)
4 src/hexen/h2_main.c
View
@@ -536,7 +536,7 @@ void H2_ProcessEvents(void)
event_t *ev;
for (; eventtail != eventhead;
- eventtail = (++eventtail) & (MAXEVENTS - 1))
+ eventtail = (eventtail + 1) & (MAXEVENTS - 1))
{
ev = &events[eventtail];
if (F_Responder(ev))
@@ -562,7 +562,7 @@ void H2_ProcessEvents(void)
void H2_PostEvent(event_t * ev)
{
events[eventhead] = *ev;
- eventhead = (++eventhead) & (MAXEVENTS - 1);
+ eventhead = (eventhead + 1) & (MAXEVENTS - 1);
}
//==========================================================================
Please sign in to comment.
Something went wrong with that request. Please try again.