]> granicus.if.org Git - nethack/commitdiff
some Microsoft compiler warnings
authornhmall <nhmall@nethack.org>
Mon, 18 Jan 2021 03:58:52 +0000 (22:58 -0500)
committernhmall <nhmall@nethack.org>
Mon, 18 Jan 2021 03:58:52 +0000 (22:58 -0500)
src/muse.c(2255) : warning C4702: unreachable code
src/options.c(2549) : warning C4702: unreachable code
src/restore.c(930) : warning C4701: potentially uninitialized local variable 'stway' used
src/sp_lev.c(5118) : warning C4701: potentially uninitialized local variable 'x' used
src/sp_lev.c(5118) : warning C4701: potentially uninitialized local variable 'y' used
src/trap.c(2979) : warning C4701: potentially uninitialized local variable 'cc' used
src/trap.c(2985) : warning C4701: potentially uninitialized local variable 'bcc' used

src/muse.c
src/options.c
src/restore.c
src/sp_lev.c
src/trap.c

index 91aaa9c8e3fef9323f9ef46ad8486ab75c23de70..b1e35cc1e5e0018aa7d36f4a3c6dce5ebf878f9a 100644 (file)
@@ -2252,6 +2252,7 @@ struct monst *mtmp;
             }
             return 1;
         }
+        /*NOTREACHED*/
         return 0;
     case 0:
         return 0; /* i.e. an exploded wand */
index e8dd2412a3d3517d9515063e132f3c2cf2a9577d..75c5baab4ed3cc34607918a111ec078db61d2449 100644 (file)
@@ -2544,7 +2544,6 @@ char *op;
                 flags.paranoia_bits &= ~PARANOID_PRAY;
             else
                 flags.paranoia_bits |= PARANOID_PRAY;
-            return optn_ok;
         }
         return optn_ok;
     }
index 32657d5a992f11f362537948354aedcb54ba4525..0b771ad288bde421e1003ff97cfe34f84ec31cb8 100644 (file)
@@ -910,7 +910,7 @@ rest_stairs(nhfp)
 NHFILE *nhfp;
 {
     int buflen = 0;
-    stairway stway;
+    stairway stway = UNDEFINED_VALUES;
     int len = 0;
 
     stairway_free_all();
index dcf6ff645365c62116a39a6f2bb638b00f742966..bb405cabed6ee00afb163c734cda905f72c1a6b4 100755 (executable)
@@ -5069,7 +5069,7 @@ lspo_terrain(L)
 lua_State *L;
 {
     terrain tmpterrain;
-    xchar x, y;
+    xchar x = 0, y = 0;
     struct selectionvar *sel = NULL;
     int argc = lua_gettop(L);
 
index 6cfd0e61d4738faec99512f4e922b94096f94eb2..1dd598051c866f3bdbdfd239eaf10ef9056831e7 100644 (file)
@@ -2931,8 +2931,8 @@ long ocount;
     register int tmp;
     schar dx, dy;
     int distance;
-    coord cc;
-    coord bcc;
+    coord cc = UNDEFINED_VALUES,
+          bcc = UNDEFINED_VALUES;
     int trycount = 0;
     boolean success = FALSE;
     int mindist = 4;