]> granicus.if.org Git - nethack/commitdiff
look_here() arguments
authorPatR <rankin@nethack.org>
Thu, 11 Aug 2022 01:02:57 +0000 (18:02 -0700)
committerPatR <rankin@nethack.org>
Thu, 11 Aug 2022 01:02:57 +0000 (18:02 -0700)
Add LOOKHERE_NOFLAGS to use instead of 0 for look_here()'s 2nd arg.
Fix the call to look_here() that passed FALSE.

include/hack.h
src/invent.c
src/pickup.c

index e6bf44f9d2f7f917ddcc81ace0a97fb5f2654348..6471ac1750e89adc23898ec74debe3192a14f77b 100644 (file)
@@ -128,8 +128,9 @@ enum cost_alteration_types {
 #define CXN_NOCORPSE 16 /* suppress " corpse" suffix */
 
 /* flags for look_here() */
-#define LOOKHERE_PICKED_SOME   1
-#define LOOKHERE_SKIP_DFEATURE 2
+#define LOOKHERE_NOFLAGS       0U
+#define LOOKHERE_PICKED_SOME   1U
+#define LOOKHERE_SKIP_DFEATURE 2U
 
 /* getpos() return values */
 enum getpos_retval {
index 2440d70126d2fcceb1d1becc2f64f6719a6647ed..d9001b9b51eaf4c49e979291cf918c0470bfdaf2 100644 (file)
@@ -4296,7 +4296,7 @@ dolook(void)
        MSGTYPE={norep,noshow} "You see here"
        interfere with feedback from the look-here command */
     hide_unhide_msgtypes(TRUE, MSGTYP_MASK_REP_SHOW);
-    res = look_here(0, FALSE);
+    res = look_here(0, LOOKHERE_NOFLAGS);
     /* restore normal msgtype handling */
     hide_unhide_msgtypes(FALSE, MSGTYP_MASK_REP_SHOW);
     return res;
index 54704bc4433568d73bfef60c5cec628257bc2068..c7bb2603ce67dadd312b6b790d41d733d3ceda6e 100644 (file)
@@ -365,7 +365,7 @@ check_here(boolean picked_some)
 {
     register struct obj *obj;
     register int ct = 0;
-    unsigned lhflags = picked_some ? LOOKHERE_PICKED_SOME : 0;
+    unsigned lhflags = picked_some ? LOOKHERE_PICKED_SOME : LOOKHERE_NOFLAGS;
 
     if (flags.mention_decor) {
         if (describe_decor())
@@ -1025,7 +1025,7 @@ query_objlist(const char *qstr,        /* query string */
             if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE
                 && will_feel_cockatrice(curr, FALSE)) {
                 destroy_nhwindow(win); /* stop the menu and revert */
-                (void) look_here(0, 0);
+                (void) look_here(0, LOOKHERE_NOFLAGS);
                 unsortloot(&sortedolist);
                 return 0;
             }