From 19466db77813385693cf78b8bc7d97b58dd2b14c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 24 Mar 2014 00:18:33 -0400 Subject: Fix various Clang compiler warnings. --- src/hexen/a_action.c | 2 -- src/hexen/g_game.c | 4 ++-- src/hexen/p_enemy.c | 11 ++++++++++- src/hexen/p_inter.c | 2 +- src/hexen/p_spec.c | 3 ++- 5 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/a_action.c b/src/hexen/a_action.c index af727480..19b1543b 100644 --- a/src/hexen/a_action.c +++ b/src/hexen/a_action.c @@ -860,8 +860,6 @@ boolean A_LocalQuake(byte * args, mobj_t * actor) int lastfound = 0; int success = false; - actor = actor; // suppress warning - // Find all quake foci do { diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index bc58b128..17ec04b9 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -662,8 +662,8 @@ void G_DoLoadLevel(void) joyxmove = joyymove = 0; mousex = mousey = 0; sendpause = sendsave = paused = false; - memset(mousebuttons, 0, sizeof(mousebuttons)); - memset(joybuttons, 0, sizeof(joybuttons)); + memset(mousearray, 0, sizeof(mousearray)); + memset(joyarray, 0, sizeof(joyarray)); if (testcontrols) { diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c index da987f16..6c9ca194 100644 --- a/src/hexen/p_enemy.c +++ b/src/hexen/p_enemy.c @@ -430,7 +430,9 @@ void P_NewChaseDir(mobj_t * actor) } else { - for (tdir = DI_SOUTHEAST; tdir != DI_EAST-1; tdir--) + tdir = DI_SOUTHEAST; + + for (;;) { if (tdir != turnaround) { @@ -438,6 +440,13 @@ void P_NewChaseDir(mobj_t * actor) if (P_TryWalk(actor)) return; } + + if (tdir == DI_EAST) + { + break; + } + + --tdir; } } diff --git a/src/hexen/p_inter.c b/src/hexen/p_inter.c index 9e196c79..063e3c64 100644 --- a/src/hexen/p_inter.c +++ b/src/hexen/p_inter.c @@ -177,7 +177,7 @@ boolean P_GiveMana(player_t * player, manatype_t mana, int count) { return (false); } - if (mana < 0 || mana > NUMMANA) + if ((unsigned int) mana > NUMMANA) { I_Error("P_GiveMana: bad type %i", mana); } diff --git a/src/hexen/p_spec.c b/src/hexen/p_spec.c index 03c98cbc..99ae73ae 100644 --- a/src/hexen/p_spec.c +++ b/src/hexen/p_spec.c @@ -447,7 +447,8 @@ boolean EV_LineSearchForPuzzleItem(line_t * line, byte * args, mobj_t * mo) { player_t *player; int i; - artitype_t type, arti; + int type; + artitype_t arti; if (!mo) return false; -- cgit v1.2.3