clear five warnings for "set but not used" variables

Note: the line numbers referenced in the warning messages below are not in sync
with the NetHack-3.7 branch and should be disregarded

files.c: In function 'get_saved_games':
files.c:1168:9: warning: unused variable 'n' [-Wunused-variable]
 1168 |     int n, j = 0;
      |         ^

mhitm.c: In function 'mdamagem':
mhitm.c:843:13: warning: variable 'cancelled' set but not used [-Wunused-but-set-variable]
  843 |     boolean cancelled;
      |             ^~~~~~~~~

mhitu.c: In function 'hitmu':
mhitu.c:943:9: warning: variable 'uncancelled' set but not used [-Wunused-but-set-variable]
  943 |     int uncancelled;
      |         ^~~~~~~~~~~

mklev.c: In function 'place_branch':
mklev.c:1214:20: warning: variable 'br_room' set but not used [-Wunused-but-set-variable]
 1214 |     struct mkroom *br_room;
      |                    ^~~~~~~

monmove.c: In function 'm_move':
monmove.c:874:43: warning: variable 'doorbuster' set but not used [-Wunused-but-set-variable]
  874 |     boolean can_open = 0, can_unlock = 0, doorbuster = 0;
      |                                           ^~~~~~~~~~
This commit is contained in:
nhmall
2021-01-25 12:57:47 -05:00
parent 8a965b8cf9
commit 62f25fd000
5 changed files with 17 additions and 11 deletions

View File

@@ -1247,10 +1247,10 @@ place_branch(br, x, y)
branch *br; /* branch to place */
xchar x, y; /* location */
{
coord m;
coord m = {0};
d_level *dest;
boolean make_stairs;
struct mkroom *br_room;
/* struct mkroom *br_room; */
/*
* Return immediately if there is no branch to make or we have
@@ -1262,11 +1262,12 @@ xchar x, y; /* location */
return;
if (!x) { /* find random coordinates for branch */
br_room = find_branch_room(&m);
/* br_room = find_branch_room(&m); */
(void) find_branch_room(&m); /* sets m via mazexy() or somexy() */
x = m.x;
y = m.y;
} else {
br_room = pos_to_room(x, y);
/* br_room = pos_to_room(x, y); */
}
if (on_level(&br->end1, &u.uz)) {