From: nhmall Date: Thu, 9 Jun 2022 19:16:28 +0000 (-0400) Subject: granular verbose message suppression mechanics updated X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95a39d0b715793bd5e7fc813708576d4b5cde0b0;p=nethack granular verbose message suppression mechanics updated update the macro definition [re-do full commit message due to errors in last one] Switch to using a macro invocation Verbos(n, s) in place of the flags.verbose checks. Provide the mechanics for individual suppression of any of the existing messages that were considered verbose. Mechanics only - this code update does not provide any means of setting the suppression bits. flags.verbose = 0 is still a master suppression of all the verbose messages. flags.verbose = 1 turns on the verbose messages only for those whose suppression bit is 0 (not set). --- diff --git a/include/hack.h b/include/hack.h index 740df08e6..2b276606b 100644 --- a/include/hack.h +++ b/include/hack.h @@ -862,8 +862,10 @@ enum verbosity_values { #undef VB_ELEMENTS extern long verbosity_suppressions[vb_elements]; /* in decl.c */ -#define Verbose(n,s) (flags.verbose && ((n) < vb_elements) \ - && !(verbosity_suppressions[(n)] & vb##n##s)) +#define Verbose(n,s) (flags.verbose && \ + (((n) >= 0 && (n) < vb_elements) && \ + !(verbosity_suppressions[(n)] & vb##n##s))) + #else /* NO_VERBOSE_GRANULARITY */ #define Verbose(n,s) (flags.verbose) #endif /* !NO_VERBOSE_GRANULARITY */