From: nhmall Date: Thu, 28 Jan 2021 14:45:16 +0000 (-0500) Subject: fix some warnings seen by Microsoft Visual Studio compiler X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bd95649de65d5b675fb5061688dc47e9ab2a7a7;p=nethack fix some warnings seen by Microsoft Visual Studio compiler ../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 --- diff --git a/src/nhlsel.c b/src/nhlsel.c index 2b142a706..58e712f9f 100644 --- a/src/nhlsel.c +++ b/src/nhlsel.c @@ -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);