]> granicus.if.org Git - nethack/commitdiff
fix some warnings seen by Microsoft Visual Studio compiler
authornhmall <nhmall@nethack.org>
Thu, 28 Jan 2021 14:45:16 +0000 (09:45 -0500)
committernhmall <nhmall@nethack.org>
Thu, 28 Jan 2021 14:45:16 +0000 (09:45 -0500)
../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'x1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'x' used
../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'y1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'y' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'x2' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'y2' used

src/nhlsel.c

index 2b142a706e84f093c2b67179ff9924c62d11609a..58e712f9f4b74461e3820ad9403cfde62960c3b1 100644 (file)
@@ -442,7 +442,7 @@ l_selection_randline(lua_State *L)
 {
     int argc = lua_gettop(L);
     struct selectionvar *sel = (struct selectionvar *) 0;
-    xchar x1, y1, x2, y2;
+    xchar x1 = 0, y1 = 0, x2 = 0, y2 = 0;
     int roughness = 7;
 
     if (argc == 6) {
@@ -575,7 +575,7 @@ l_selection_flood(lua_State *L)
 {
     int argc = lua_gettop(L);
     struct selectionvar *sel = (struct selectionvar *) 0;
-    xchar x, y;
+    xchar x = 0, y = 0;
 
     if (argc == 2) {
         x = (xchar) luaL_checkinteger(L, 1);