]> granicus.if.org Git - nethack/commitdiff
silence three compile warnings
authornhmall <nhmall@nethack.org>
Sun, 19 Jun 2022 08:56:48 +0000 (04:56 -0400)
committernhmall <nhmall@nethack.org>
Sun, 19 Jun 2022 08:56:48 +0000 (04:56 -0400)
apply.c:495:22: warning: variable 'optr' set but not used [-Wunused-but-set-variable]
    struct permonst *optr;
                     ^
1 warning generated.
cmd.c:4577:26: warning: variable 'how' set but not used [-Wunused-but-set-variable]
    const char *dothat, *how;
                         ^
cmd.c:4578:29: warning: variable 'viawindow' set but not used [-Wunused-but-set-variable]
    boolean prefixhandling, viawindow;
                            ^
2 warnings generated.

src/apply.c
src/cmd.c

index 03e28ea4b0cd85c0da4c65f620dd9a6bbdd850d9..a4f4f9cef730403a1e2c7a57f0a3a22a2b30ff2f 100644 (file)
@@ -492,7 +492,7 @@ static void
 magic_whistled(struct obj *obj)
 {
     struct monst *mtmp, *nextmon;
-    struct permonst *optr;
+    /* struct permonst *optr; */
     char buf[BUFSZ], *mnam = 0,
          shiftbuf[BUFSZ + sizeof "shifts location"],
          appearbuf[BUFSZ + sizeof "appears"],
@@ -529,7 +529,7 @@ magic_whistled(struct obj *obj)
         if (M_AP_TYPE(mtmp))
             seemimic(mtmp);
         omx = mtmp->mx, omy = mtmp->my;
-        optr = mtmp->data;
+        /* optr = mtmp->data; */
         mnexto(mtmp, !already_discovered ? RLOC_MSG : RLOC_NONE);
 
         if (mtmp->mx != omx || mtmp->my != omy) {
index a124f0c760bf62f4348d1adca67fe976947b4f8e..c7b4a3e00b273601e1b49f00ceaf3b8d63892c50 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -4574,11 +4574,11 @@ help_dir(
     char ctrl;
     winid win;
     char buf[BUFSZ], buf2[BUFSZ], *explain;
-    const char *dothat, *how;
-    boolean prefixhandling, viawindow;
+    const char *dothat /*, *how */;
+    boolean prefixhandling /*, viawindow */;
 
     /* NHKF_ESC indicates that player asked for help at getdir prompt */
-    viawindow = (spkey == g.Cmd.spkeys[NHKF_ESC] || iflags.cmdassist);
+    /* viawindow = (spkey == g.Cmd.spkeys[NHKF_ESC] || iflags.cmdassist); */
     prefixhandling = (spkey != g.Cmd.spkeys[NHKF_ESC]);
     /*
      * Handling for prefix keys that don't want special directions.
@@ -4586,7 +4586,7 @@ help_dir(
      * general message if it's on.
      */
     dothat = "do that";
-    how = " at"; /* for "<action> at yourself"; not used for up/down */
+    /* how = " at"; */ /* for "<action> at yourself"; not used for up/down */
 
     buf[0] = '\0';
 #if 0   /* Since prefix keys got 'promoted' to commands, feedback for