From: PatR Date: Wed, 26 Feb 2020 00:04:41 +0000 (-0800) Subject: fix nhlsel.c warning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19df82971da94066b580fb669cf6de05a2ef420b;p=nethack fix nhlsel.c warning A recent change has resulted in complaints about 'sel' not being used in struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *ret; int p = (int) luaL_checkinteger(L, 2); lua_pop(L, 1); (void) l_selection_clone(L); ret = l_selection_check(L, 1); selection_filter_percent(ret, p); This preserves the semantics of that code while getting rid of the warning, but I have no idea whether it makes any sense. --- diff --git a/src/nhlsel.c b/src/nhlsel.c index a0ba7e627..62aa326fd 100644 --- a/src/nhlsel.c +++ b/src/nhlsel.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 nhlua.c $NHDT-Date: 1581562591 2020/02/13 02:56:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.9 $ */ +/* NetHack 3.7 nhlua.c $NHDT-Date: 1582675449 2020/02/26 00:04:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.20 $ */ /* Copyright (c) 2018 by Pasi Kallinen */ /* NetHack may be freely redistributed. See license for details. */ @@ -298,10 +298,11 @@ static int l_selection_filter_percent(L) lua_State *L; { - struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *ret; - int p = (int) luaL_checkinteger(L, 2); + int p; + (void) l_selection_check(L, 1); + p = (int) luaL_checkinteger(L, 2); lua_pop(L, 1); (void) l_selection_clone(L); ret = l_selection_check(L, 1);