]> granicus.if.org Git - nethack/commitdiff
quiet windows x86 warnings
authornhmall <nhmall@nethack.org>
Wed, 1 Apr 2020 16:58:36 +0000 (12:58 -0400)
committernhmall <nhmall@nethack.org>
Wed, 1 Apr 2020 16:58:36 +0000 (12:58 -0400)
nhlua.c(628): warning C4244: 'function': conversion from 'lua_Integer' to 'int', possible loss of data
nhlua.c(644): warning C4244: 'function': conversion from 'lua_Integer' to 'int', possible loss of data
nhlua.c(646): warning C4244: 'function': conversion from 'lua_Integer' to 'int', possible loss of data

src/nhlua.c

index 0e5fb08dec64ab07c75d3c4dab18bdae65bceaea..a8ec32edbaa751cd4e846997819b1f8778d695c9 100644 (file)
@@ -625,7 +625,7 @@ lua_State *L;
     int argc = lua_gettop(L);
 
     if (argc == 1)
-        lua_pushinteger(L, rn2(luaL_checkinteger(L, 1)));
+        lua_pushinteger(L, rn2((int) luaL_checkinteger(L, 1)));
     else
         nhl_error(L, "Wrong args");
 
@@ -641,9 +641,9 @@ lua_State *L;
     int argc = lua_gettop(L);
 
     if (argc == 1)
-        lua_pushinteger(L, rn2(luaL_checkinteger(L, 1)));
+        lua_pushinteger(L, rn2((int) luaL_checkinteger(L, 1)));
     else if (argc == 2)
-        lua_pushinteger(L, luaL_checkinteger(L, 1) + rn2(luaL_checkinteger(L, 2)));
+        lua_pushinteger(L, luaL_checkinteger(L, 1) + rn2((int) luaL_checkinteger(L, 2)));
     else
         nhl_error(L, "Wrong args");