a couple of warnings
invent.c: In function 'getobj':
invent.c:1579:29: warning: 'cnt' may be used uninitialized [-Wmaybe-uninitialized]
1579 | if (cnt < 1 || otmp->quan <= cnt)
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
invent.c:1529:10: note: 'cnt' was declared here
1529 | long cnt;
| ^~~
../win/X11/winstat.c: In function 'update_fancy_status_field':
../win/X11/winstat.c:1920:28: warning: declaration of 'active' shadows a global declaration [-Wshadow]
1920 | static boolean active = FALSE;
| ^~~~~~
In file included from ../include/hack.h:196,
from ../win/X11/winstat.c:36:
../include/wintype.h:180:5: note: shadowed declaration is here
180 | active = 0x001,
| ^~~~~~
This commit is contained in:
@@ -1526,7 +1526,7 @@ getobj(
|
|||||||
* between "you don't have anything to <foo>"
|
* between "you don't have anything to <foo>"
|
||||||
* versus "you don't have anything _else_ to <foo>"
|
* versus "you don't have anything _else_ to <foo>"
|
||||||
* (also used for GETOBJ_EXCLUDE_NONINVENT) */
|
* (also used for GETOBJ_EXCLUDE_NONINVENT) */
|
||||||
long cnt;
|
long cnt = 0L;
|
||||||
boolean cntgiven = FALSE;
|
boolean cntgiven = FALSE;
|
||||||
boolean msggiven = FALSE;
|
boolean msggiven = FALSE;
|
||||||
boolean oneloop = FALSE;
|
boolean oneloop = FALSE;
|
||||||
|
|||||||
@@ -1917,12 +1917,12 @@ update_fancy_status_field(int i, int color, int attributes)
|
|||||||
*
|
*
|
||||||
* Break out with this.
|
* Break out with this.
|
||||||
*/
|
*/
|
||||||
static boolean active = FALSE;
|
static boolean isactive = FALSE;
|
||||||
|
|
||||||
if (!active) {
|
if (!isactive) {
|
||||||
active = TRUE;
|
isactive = TRUE;
|
||||||
impossible("update_other: unknown shown value");
|
impossible("update_other: unknown shown value");
|
||||||
active = FALSE;
|
isactive = FALSE;
|
||||||
}
|
}
|
||||||
val = 0L;
|
val = 0L;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user