some reformatting (5 of 4)

Take care of most of include/*.h.  I punted on extern.h.

For both src/*.c and include/*.h, I used mismatched checks of
width > 79 to decide which files to look at and then width > 78
to decide which lines to maybe revise, so I didn't look at a bunch
of the files.

I don't plan to go back and do it right.  Shortening lines that are
80 or wider to less than 80 is the significant part.  Otherwise
emacs puts a backslash in column 80 and the rest of the line of text
on the next line of the screen, making things harder to read.
This commit is contained in:
PatR
2024-09-06 13:08:07 -07:00
parent 0e1abe0df9
commit cf6509dde9
16 changed files with 216 additions and 172 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 cstd.h $NHDT-Date: 1596498562 2020/08/03 23:49:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.24 $ */
/* NetHack 3.7 cstd.h $NHDT-Date: 1725652996 2024/09/06 20:03:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.6 $ */
/*-Copyright (c) Robert Patrick Rankin, 2017. */
/* NetHack may be freely redistributed. See license for details. */
@@ -8,11 +8,10 @@
/*
* The list of standard (C99 unless noted otherwise) header files:
*
* <assert.h> Conditionally compiled macro that compares its argument
* to zero
* <assert.h> Conditionally compiled macro that calls abort if its
* argument evaluates to zero
* <complex.h> (C99) Complex number arithmetic
* <ctype.h> Functions to determine the type contained in character
* data
* <ctype.h> Functions to categorize single characters
* <errno.h> Macros reporting error conditions
* <fenv.h> (C99) Floating-point environment
* <float.h> Limits of floating-point types
@@ -29,20 +28,22 @@
* <stdint.h> (C99) Fixed-width integer types
* <stdio.h> Input/output program utilities
*
* General utilities: memory management, program utilities, string conversions,
* random numbers, algorithms
* General utilities: memory management, program utilities, string
* conversions, random numbers, algorithms
* <string.h> String handling
* <tgmath.h> (C99) Type-generic math (macros wrapping math.h and complex.h)
* <tgmath.h> (C99) Type-generic math (macros wrapping math.h and
* complex.h)
* <time.h> Time/date utilities
* <wchar.h> (C95) Extended multibyte and wide character utilities
* <wctype.h> (C95) Functions to determine the type contained in wide character data
* <wctype.h> (C95) Functions to categorize single wide character
* We watch these and try not to conflict with them, or make it tough to adopt
* these in future:
*
* <stdalign.h> (C11) alignas and alignof convenience macros
* <stdatomic.h> (C11) Atomic operations
* <stdbit.h> (C23) Macros to work with the byte and bit representations of types
* <stdbit.h> (C23) Macros to work with the byte and bit representations
* of types
* <stdckdint.h> (C23) Macros for performing checked integer arithmetic
* <stdnoreturn.h> (C11) noreturn convenience macro
* <threads.h> (C11) Thread library

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 decl.h $NHDT-Date: 1720074483 2024/07/04 06:28:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.373 $ */
/* NetHack 3.7 decl.h $NHDT-Date: 1725653004 2024/09/06 20:03:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.377 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2007. */
/* NetHack may be freely redistributed. See license for details. */
@@ -270,7 +270,7 @@ struct instance_globals_c {
/* invent.c */
/* for perm_invent when operating on a partial inventory display, so that
persistent one doesn't get shrunk during filtering for item selection
then regrown to full inventory, possibly being resized in the process */
then regrown to full inventory, possibly being resized in process */
winid cached_pickinv_win;
int core_invent_state;
@@ -862,7 +862,8 @@ struct instance_globals_s {
/* symbols.c */
struct symsetentry symset[NUM_GRAPHICS];
/* adds UNICODESET */
struct symset_customization sym_customizations[NUM_GRAPHICS + 1][custom_count];
struct symset_customization
sym_customizations[NUM_GRAPHICS + 1][custom_count];
nhsym showsyms[SYM_MAX]; /* symbols to be displayed */
/* files.c */
@@ -954,8 +955,8 @@ struct instance_globals_t {
/* rumors.c */
long true_rumor_size; /* rumor size variables are signed so that value -1
* can be used as a flag */
unsigned long true_rumor_start; /* rumor start offsets are unsigned because
* they're handled via %lx format */
unsigned long true_rumor_start; /* rumor start offsets are unsigned due
* to use of %lx format */
long true_rumor_end; /* rumor end offsets are signed because they're
* compared with [dlb_]ftell() */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 defsym.h $NHDT-Date: 1720565306 2024/07/09 22:48:26 $ $NHDT-Branch: NetHack-3.7 $ $NHDT-Revision: 1.24 $ */
/* NetHack 3.7 defsym.h $NHDT-Date: 1725653007 2024/09/06 20:03:27 $ $NHDT-Branch: NetHack-3.7 $ $NHDT-Revision: 1.25 $ */
/* Copyright (c) 2016 by Pasi Kallinen */
/* NetHack may be freely redistributed. See license for details. */
@@ -33,8 +33,10 @@
DUMP_ENUMS_OBJCLASS_CLASSES, DUMP_ENUMS_OBJCLASS_SYMS)
*/
#if defined(PCHAR_S_ENUM) || defined(PCHAR_PARSE) \
|| defined(PCHAR_DRAWING) || defined(PCHAR_TILES) \
#if defined(PCHAR_S_ENUM) \
|| defined(PCHAR_PARSE) \
|| defined(PCHAR_DRAWING) \
|| defined(PCHAR_TILES) \
|| defined(DUMP_ENUMS_PCHAR)
/*
@@ -248,9 +250,12 @@
#endif /* PCHAR_S_ENUM || PCHAR_PARSE || PCHAR_DRAWING || PCHAR_TILES
* || DUMP_ENUMS_PCHAR */
#if defined(MONSYMS_S_ENUM) || defined(MONSYMS_DEFCHAR_ENUM) \
|| defined(MONSYMS_PARSE) || defined(MONSYMS_DRAWING) \
|| defined(DUMP_ENUMS_MONSYMS) || defined(DUMP_ENUMS_MONSYMS_DEFCHAR)
#if defined(MONSYMS_S_ENUM) \
|| defined(MONSYMS_DEFCHAR_ENUM) \
|| defined(MONSYMS_PARSE) \
|| defined(MONSYMS_DRAWING) \
|| defined(DUMP_ENUMS_MONSYMS) \
|| defined(DUMP_ENUMS_MONSYMS_DEFCHAR)
/*
MONSYM(idx, ch, sym desc)
@@ -282,7 +287,8 @@
#define MONSYM(idx, ch, basename, sym, desc) { sym, #sym },
#elif defined(DUMP_ENUMS_MONSYMS_DEFCHAR)
#define MONSYM(idx, ch, basename, sym, desc) { DEF_##basename, "DEF_" #basename },
#define MONSYM(idx, ch, basename, sym, desc) \
{ DEF_##basename, "DEF_" #basename },
#endif
@@ -364,11 +370,14 @@
* || MONSYMS_DRAWING || DUMP_ENUMS_MONSYMS)
* || DUMP_ENUMS_MONSYMS_DEFCHAR */
#if defined(OBJCLASS_S_ENUM) || defined(OBJCLASS_DEFCHAR_ENUM) \
|| defined(OBJCLASS_CLASS_ENUM) || defined(OBJCLASS_PARSE) \
|| defined(OBJCLASS_DRAWING) || defined(DUMP_ENUMS_OBJCLASS_DEFCHARS) \
|| defined(DUMP_ENUMS_OBJCLASS_CLASSES) \
|| defined(DUMP_ENUMS_OBJCLASS_SYMS)
#if defined(OBJCLASS_S_ENUM) \
|| defined(OBJCLASS_DEFCHAR_ENUM) \
|| defined(OBJCLASS_CLASS_ENUM) \
|| defined(OBJCLASS_PARSE) \
|| defined(OBJCLASS_DRAWING) \
|| defined(DUMP_ENUMS_OBJCLASS_DEFCHARS) \
|| defined(DUMP_ENUMS_OBJCLASS_CLASSES) \
|| defined(DUMP_ENUMS_OBJCLASS_SYMS)
/*
OBJCLASS(idx, ch, basename, sym, name, explain)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 display.h $NHDT-Date: 1698741423 2023/10/31 08:37:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */
/* NetHack 3.7 display.h $NHDT-Date: 1725653008 2024/09/06 20:03:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.106 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -87,7 +87,7 @@
(/* The hero can see the monster IF the monster */ \
(!mon->minvis || See_invisible) /* 1. is not invisible */ \
&& !mon->mundetected /* AND 2. not an undetected hider */ \
&& !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */
&& !(mon->mburied || u.uburied)) /* AND 3. neither you nor it buried */
#else /* without 'mburied' and 'uburied' */
#define _mon_visible(mon) \
(/* The hero can see the monster IF the monster */ \
@@ -228,14 +228,14 @@
#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */
#define DISP_TETHER (-3) /* Like beam, but tether glyph differs from final */
#define DISP_FLASH (-4) /* Clean up each glyph before displaying new one. */
#define DISP_ALWAYS (-5) /* Like flash, but still displayed if not visible. */
#define DISP_ALWAYS (-5) /* Like flash, but still displayed if not visible */
#define DISP_CHANGE (-6) /* Change glyph. */
#define DISP_END (-7) /* Clean up. */
#define DISP_FREEMEM (-8) /* Free all memory during exit only. */
/* Total number of cmap indices in the shield_static[] array. */
#define SHIELD_COUNT 21
#define BACKTRACK (-1) /* flag for DISP_END to display each prior location */
#define BACKTRACK (-1) /* for DISP_END to display each prior location */
/*
* display_self()
@@ -760,7 +760,8 @@ enum glyph_offsets {
* considered objects.
*/
#define glyph_is_normal_male_monster(glyph) \
((glyph) >= GLYPH_MON_MALE_OFF && (glyph) < (GLYPH_MON_MALE_OFF + NUMMONS))
((glyph) >= GLYPH_MON_MALE_OFF \
&& (glyph) < (GLYPH_MON_MALE_OFF + NUMMONS))
#define glyph_is_normal_female_monster(glyph) \
((glyph) >= GLYPH_MON_FEM_OFF && (glyph) < (GLYPH_MON_FEM_OFF + NUMMONS))
#define glyph_is_normal_monster(glyph) \
@@ -769,7 +770,8 @@ enum glyph_offsets {
#define glyph_is_female_pet(glyph) \
((glyph) >= GLYPH_PET_FEM_OFF && (glyph) < (GLYPH_PET_FEM_OFF + NUMMONS))
#define glyph_is_male_pet(glyph) \
((glyph) >= GLYPH_PET_MALE_OFF && (glyph) < (GLYPH_PET_MALE_OFF + NUMMONS))
((glyph) >= GLYPH_PET_MALE_OFF \
&& (glyph) < (GLYPH_PET_MALE_OFF + NUMMONS))
#define glyph_is_pet(glyph) \
(glyph_is_male_pet(glyph) || glyph_is_female_pet(glyph))
#define glyph_is_ridden_female_monster(glyph) \
@@ -779,8 +781,8 @@ enum glyph_offsets {
((glyph) >= GLYPH_RIDDEN_MALE_OFF \
&& (glyph) < (GLYPH_RIDDEN_MALE_OFF + NUMMONS))
#define glyph_is_ridden_monster(glyph) \
(glyph_is_ridden_male_monster(glyph) \
|| glyph_is_ridden_female_monster(glyph))
(glyph_is_ridden_male_monster(glyph) \
|| glyph_is_ridden_female_monster(glyph))
#define glyph_is_detected_female_monster(glyph) \
((glyph) >= GLYPH_DETECT_FEM_OFF \
&& (glyph) < (GLYPH_DETECT_FEM_OFF + NUMMONS))
@@ -788,10 +790,10 @@ enum glyph_offsets {
((glyph) >= GLYPH_DETECT_MALE_OFF \
&& (glyph) < (GLYPH_DETECT_MALE_OFF + NUMMONS))
#define glyph_is_detected_monster(glyph) \
(glyph_is_detected_male_monster(glyph) \
(glyph_is_detected_male_monster(glyph) \
|| glyph_is_detected_female_monster(glyph))
#define glyph_is_monster(glyph) \
(glyph_is_normal_monster(glyph) || glyph_is_pet(glyph) \
#define glyph_is_monster(glyph) \
(glyph_is_normal_monster(glyph) || glyph_is_pet(glyph) \
|| glyph_is_ridden_monster(glyph) || glyph_is_detected_monster(glyph))
#define glyph_is_invisible(glyph) ((glyph) == GLYPH_INVISIBLE)
@@ -819,8 +821,9 @@ enum glyph_offsets {
the otg_otmp assignment might occur multiple times in the same
expression but there will always be sequence points in between */
#define obj_is_piletop(obj) \
((obj)->where == OBJ_FLOOR \
&& (go.otg_otmp = svl.level.objects[(obj)->ox][(obj)->oy]->nexthere) != 0 \
((obj)->where == OBJ_FLOOR \
&& ((go.otg_otmp = svl.level.objects[(obj)->ox][(obj)->oy]->nexthere) \
!= 0) \
&& ((obj)->otyp != BOULDER || go.otg_otmp->otyp == BOULDER))
/* used to hide info such as potion and gem color when not seen yet;
stones and rock are excluded for gem class; LAST_SPELL includes blank

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 hack.h $NHDT-Date: 1724094288 2024/08/19 19:04:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.261 $ */
/* NetHack 3.7 hack.h $NHDT-Date: 1725653009 2024/09/06 20:03:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.262 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2017. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1129,7 +1129,8 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
#define MM_MINVIS 0x00100000L /* for ^G/create_particular */
/* if more MM_ flag masks are added, skip or renumber the GP_ one(s) */
#define GP_ALLOW_XY 0x00200000L /* [actually used by enexto() to decide
* whether to make extra call to goodpos()] */
* whether to make an extra call to
* goodpos()] */
#define GP_ALLOW_U 0x00400000L /* don't reject hero's location */
#define GP_CHECKSCARY 0x00800000L /* check monster for onscary() */
#define GP_AVOID_MONPOS 0x01000000L /* don't accept existing mon location */
@@ -1393,9 +1394,9 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
/* flags passed to getobj() to control how it responds to player input */
#define GETOBJ_NOFLAGS 0x0
#define GETOBJ_ALLOWCNT 0x1 /* is a count allowed with this command? */
#define GETOBJ_PROMPT 0x2 /* should it force a prompt for input? (prevents it
exiting early with "You don't have anything to
foo" if nothing in inventory is valid) */
#define GETOBJ_PROMPT 0x2 /* should it force a prompt for input? (prevents
* it exiting early with "You don't have anything
* to foo" if nothing in inventory is valid) */
/* flags for hero_breaks() and hits_bars(); BRK_KNOWN* let callers who have
already called breaktest() prevent it from being called again since it
@@ -1418,11 +1419,11 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
#define NC_SHOW_MSG 0x01U
#define NC_VIA_WAND_OR_SPELL 0x02U
/* constant passed to explode() for gas spores because gas spores are weird
* Specifically, this is an exception to the whole "explode() uses dobuzz types"
* system (the range -1 to -9 isn't used by it, for some reason), where this is
* effectively an extra dobuzz type, and some zap.c code needs to be aware of
* it. */
/* Constant passed to explode() for gas spores because gas spores are weird.
* Specifically, this is an exception to whole "explode() uses dobuzz types"
* system (the range -1 to -9 isn't used by it, for some reason), where this
* is effectively an extra dobuzz type, and some zap.c code needs to be aware
* of it. */
#define PHYS_EXPL_TYPE -1
/* macros for dobuzz() type */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 hacklib.h $NHDT-Date: 1657918089 2022/07/15 20:48:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1132 $ */
/* NetHack 3.7 hacklib.h $NHDT-Date: 1725653010 2024/09/06 20:03:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -35,7 +35,8 @@ extern char *xcrypt(const char *, char *) NONNULL NONNULLPTRS;
extern boolean onlyspace(const char *) NONNULLARG1;
extern char *tabexpand(char *) NONNULL NONNULLARG1;
extern char *visctrl(char) NONNULL;
extern char *stripchars(char *, const char *, const char *) NONNULL NONNULLPTRS;
extern char *stripchars(char *, const char *,
const char *) NONNULL NONNULLPTRS;
extern char *stripdigits(char *) NONNULL NONNULLARG1;
extern char *strsubst(char *, const char *, const char *) NONNULL NONNULLPTRS;
extern int strNsubst(char *, const char *, const char *, int) NONNULLPTRS;

View File

@@ -36,7 +36,7 @@ struct isaac64_ctx{
/**
* isaac64_init - Initialize an instance of the ISAAC64 random number generator.
* isaac64_init - Initialize an instance of ISAAC64 random number generator.
* @_ctx: The ISAAC64 instance to initialize.
* @_seed: The specified seed bytes.
* This may be NULL if _nseed is less than or equal to zero.
@@ -77,8 +77,8 @@ uint64_t isaac64_next_uint(isaac64_ctx *_ctx,uint64_t _n);
* @_ctx: The ISAAC64 instance to generate the value with.
* Returns a high-quality float uniformly distributed between 0 (inclusive)
* and 1 (exclusive).
* All of the float's mantissa bits are random, e.g., the least significant bit
* may still be non-zero even if the value is less than 0.5, and any
* All of the float's mantissa bits are random, e.g., the least significant
* bit may still be non-zero even if the value is less than 0.5, and any
* representable float in the range [0,1) has a chance to be returned, though
* values very close to zero become increasingly unlikely.
* To generate cheaper float values that do not have these properties, use

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mkroom.h $NHDT-Date: 1715203003 2024/05/08 21:16:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.31 $ */
/* NetHack 3.7 mkroom.h $NHDT-Date: 1725653011 2024/09/06 20:03:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.33 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -88,18 +88,20 @@ enum roomtype_types {
#define SHARED 1 /* indicates normal shared boundary */
#define SHARED_PLUS 2 /* indicates shared boundary - extra adjacent-square
* searching required */
#define ROOMOFFSET 3 /* (levl[x][y].roomno - ROOMOFFSET) gives svr.rooms[] index,
* for inside-squares and non-shared boundaries */
#define ROOMOFFSET 3 /* (levl[x][y].roomno - ROOMOFFSET) gives svr.rooms[]
* index, for inside-squares and non-shared boundaries */
/* Values for needfill */
#define FILL_NONE 0 /* do not fill this room with anything */
#define FILL_NORMAL 1 /* fill the room normally (OROOM or THEMEROOM gets
fill_ordinary_room; any other room type gets stocked
with its usual monsters/objects/terrain) */
* fill_ordinary_room; any other room type gets stocked
* with its usual monsters/objects/terrain) */
#define FILL_LVFLAGS 2 /* special rooms only; set the room's rtype and level
flags as appropriate, but do not put anything in it */
* flags as appropriate, but do not put anything in
* it */
#define IS_ROOM_PTR(x) ((x) >= svr.rooms && (x) < svr.rooms + MAXNROFROOMS)
#define IS_ROOM_PTR(x) \
((x) >= svr.rooms && (x) < svr.rooms + MAXNROFROOMS)
#define IS_ROOM_INDEX(x) ((x) >= 0 && (x) < MAXNROFROOMS)
#define IS_SUBROOM_PTR(x) \
((x) >= gs.subrooms && (x) < gs.subrooms + MAXNROFROOMS)
@@ -107,6 +109,7 @@ enum roomtype_types {
#define ROOM_INDEX(x) ((x) - svr.rooms)
#define SUBROOM_INDEX(x) ((x) - gs.subrooms)
#define IS_LAST_ROOM_PTR(x) (ROOM_INDEX(x) == svn.nroom)
#define IS_LAST_SUBROOM_PTR(x) (!gn.nsubroom || SUBROOM_INDEX(x) == gn.nsubroom)
#define IS_LAST_SUBROOM_PTR(x) \
(!gn.nsubroom || SUBROOM_INDEX(x) == gn.nsubroom)
#endif /* MKROOM_H */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 objects.h $NHDT-Date: 1700725879 2023/11/23 07:51:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.20 $ */
/* NetHack 3.7 objects.h $NHDT-Date: 1725653011 2024/09/06 20:03:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -423,8 +423,8 @@ BOW("crossbow", NoDes, 1, 45, 50, 40, 0, WOOD, P_CROSSBOW, HI_WOOD,
#define CLOAK(name,desc,kn,mgc,power,prob,delay,wt,cost,ac,can,metal,c,sn) \
ARMOR(name, desc, kn, mgc, 0, power, prob, delay, wt, \
cost, ac, can, ARM_CLOAK, metal, c,sn)
#define SHIELD(name,desc,kn,mgc,blk,power,prob,delay,wt,cost,ac,can,metal,c,sn) \
ARMOR(name, desc, kn, mgc, blk, power, prob, delay, wt, \
#define SHIELD(name,desc,kn,mgc,blk,pow,prob,delay,wt,cost,ac,can,metal,c,sn) \
ARMOR(name, desc, kn, mgc, blk, pow, prob, delay, wt, \
cost, ac, can, ARM_SHIELD, metal, c,sn)
#define GLOVES(name,desc,kn,mgc,power,prob,delay,wt,cost,ac,can,metal,c,sn) \
ARMOR(name, desc, kn, mgc, 0, power, prob, delay, wt, \
@@ -601,34 +601,41 @@ ARMOR("T-shirt", NoDes,
/* cloaks */
CLOAK("mummy wrapping", NoDes,
1, 0, 0, 0, 0, 3, 2, 10, 1, CLOTH, CLR_GRAY, MUMMY_WRAPPING),
1, 0, 0, 0, 0, 3, 2, 10, 1, CLOTH, CLR_GRAY,
MUMMY_WRAPPING),
/* worn mummy wrapping blocks invisibility */
CLOAK("elven cloak", "faded pall",
0, 1, STEALTH, 8, 0, 10, 60, 9, 1, CLOTH, CLR_BLACK, ELVEN_CLOAK),
CLOAK("orcish cloak", "coarse mantelet",
0, 0, 0, 8, 0, 10, 40, 10, 1, CLOTH, CLR_BLACK, ORCISH_CLOAK),
0, 0, 0, 8, 0, 10, 40, 10, 1, CLOTH, CLR_BLACK,
ORCISH_CLOAK),
CLOAK("dwarvish cloak", "hooded cloak",
0, 0, 0, 8, 0, 10, 50, 10, 1, CLOTH, HI_CLOTH, DWARVISH_CLOAK),
0, 0, 0, 8, 0, 10, 50, 10, 1, CLOTH, HI_CLOTH,
DWARVISH_CLOAK),
CLOAK("oilskin cloak", "slippery cloak",
0, 0, 0, 8, 0, 10, 50, 9, 2, CLOTH, HI_CLOTH, OILSKIN_CLOAK),
0, 0, 0, 8, 0, 10, 50, 9, 2, CLOTH, HI_CLOTH,
OILSKIN_CLOAK),
CLOAK("robe", NoDes,
1, 1, 0, 3, 0, 15, 50, 8, 2, CLOTH, CLR_RED, ROBE),
/* robe was adopted from slash'em, where it's worn as a suit
rather than as a cloak and there are several variations */
CLOAK("alchemy smock", "apron",
0, 1, POISON_RES, 9, 0, 10, 50, 9, 1, CLOTH, CLR_WHITE, ALCHEMY_SMOCK),
0, 1, POISON_RES, 9, 0, 10, 50, 9, 1, CLOTH, CLR_WHITE,
ALCHEMY_SMOCK),
CLOAK("leather cloak", NoDes,
1, 0, 0, 8, 0, 15, 40, 9, 1, LEATHER, CLR_BROWN, LEATHER_CLOAK),
1, 0, 0, 8, 0, 15, 40, 9, 1, LEATHER, CLR_BROWN,
LEATHER_CLOAK),
/* with shuffled appearances... */
CLOAK("cloak of protection", "tattered cape",
0, 1, PROTECTION, 9, 0, 10, 50, 7, 3, CLOTH, HI_CLOTH, CLOAK_OF_PROTECTION),
0, 1, PROTECTION, 9, 0, 10, 50, 7, 3, CLOTH, HI_CLOTH,
CLOAK_OF_PROTECTION),
/* cloak of protection is now the only item conferring MC 3 */
CLOAK("cloak of invisibility", "opera cloak",
0, 1, INVIS, 10, 0, 10, 60, 9, 1, CLOTH, CLR_BRIGHT_MAGENTA,
CLOAK_OF_INVISIBILITY),
CLOAK("cloak of magic resistance", "ornamental cope",
0, 1, ANTIMAGIC, 2, 0, 10, 60, 9, 1, CLOTH, CLR_WHITE,
CLOAK_OF_MAGIC_RESISTANCE),
CLOAK_OF_MAGIC_RESISTANCE),
/* 'cope' is not a spelling mistake... leave it be */
CLOAK("cloak of displacement", "piece of cloth",
0, 1, DISPLACED, 10, 0, 10, 50, 9, 1, CLOTH, HI_CLOTH,
@@ -981,7 +988,7 @@ TOOL("bugle", NoDes, 1, 0, 0, 0, 4, 10, 15, COPPER, HI_COPPER,
TOOL("leather drum", "drum", 0, 0, 0, 0, 4, 25, 25, LEATHER, HI_LEATHER,
LEATHER_DRUM),
TOOL("drum of earthquake","drum", 0, 0, 1, 1, 2, 25, 25, LEATHER, HI_LEATHER,
DRUM_OF_EARTHQUAKE),
DRUM_OF_EARTHQUAKE),
/* tools useful as weapons */
WEPTOOL("pick-axe", NoDes,
1, 0, 0, 20, 100, 50, 6, 3, WHACK, P_PICK_AXE, IRON, HI_METAL,
@@ -1000,17 +1007,17 @@ WEPTOOL("unicorn horn", NoDes,
OBJECT(OBJ("Candelabrum of Invocation", "candelabrum"),
BITS(0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, P_NONE, GOLD),
0, TOOL_CLASS, 0, 0, 10, 5000, 0, 0, 0, 0, 200, HI_GOLD,
CANDELABRUM_OF_INVOCATION),
CANDELABRUM_OF_INVOCATION),
OBJECT(OBJ("Bell of Opening", "silver bell"),
BITS(0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, P_NONE, SILVER),
0, TOOL_CLASS, 0, 0, 10, 5000, 0, 0, 0, 0, 50, HI_SILVER,
BELL_OF_OPENING),
BELL_OF_OPENING),
#undef TOOL
#undef WEPTOOL
/* Comestibles ... */
#define FOOD(name, prob, delay, wt, unk, tin, nutrition, color, sn) \
OBJECT(OBJ(name, NoDes), \
#define FOOD(name, prob, delay, wt, unk, tin, nutrition, color, sn) \
OBJECT(OBJ(name, NoDes), \
BITS(1, 1, unk, 0, 0, 0, 0, 0, 0, 0, 0, P_NONE, tin), 0, \
FOOD_CLASS, prob, delay, wt, nutrition / 20 + 5, 0, 0, 0, 0, \
nutrition, color, sn)
@@ -1044,38 +1051,41 @@ OBJECT(OBJ("meat ring", NoDes),
/* pudding 'corpses' will turn into these and combine;
must be in same order as the pudding monsters */
FOOD("glob of gray ooze", 0, 2, 20, 0, FLESH, 20, CLR_GRAY,
GLOB_OF_GRAY_OOZE),
GLOB_OF_GRAY_OOZE),
FOOD("glob of brown pudding", 0, 2, 20, 0, FLESH, 20, CLR_BROWN,
GLOB_OF_BROWN_PUDDING),
GLOB_OF_BROWN_PUDDING),
FOOD("glob of green slime", 0, 2, 20, 0, FLESH, 20, CLR_GREEN,
GLOB_OF_GREEN_SLIME),
GLOB_OF_GREEN_SLIME),
FOOD("glob of black pudding", 0, 2, 20, 0, FLESH, 20, CLR_BLACK,
GLOB_OF_BLACK_PUDDING),
GLOB_OF_BLACK_PUDDING),
/* fruits & veggies */
FOOD("kelp frond", 0, 1, 1, 0, VEGGY, 30, CLR_GREEN, KELP_FROND),
FOOD("eucalyptus leaf", 3, 1, 1, 0, VEGGY, 1, CLR_GREEN,
EUCALYPTUS_LEAF),
EUCALYPTUS_LEAF),
FOOD("apple", 15, 1, 2, 0, VEGGY, 50, CLR_RED, APPLE),
FOOD("orange", 10, 1, 2, 0, VEGGY, 80, CLR_ORANGE, ORANGE),
FOOD("pear", 10, 1, 2, 0, VEGGY, 50, CLR_BRIGHT_GREEN,
PEAR),
PEAR),
FOOD("melon", 10, 1, 5, 0, VEGGY, 100, CLR_BRIGHT_GREEN,
MELON),
MELON),
FOOD("banana", 10, 1, 2, 0, VEGGY, 80, CLR_YELLOW, BANANA),
FOOD("carrot", 15, 1, 2, 0, VEGGY, 50, CLR_ORANGE, CARROT),
FOOD("sprig of wolfsbane", 7, 1, 1, 0, VEGGY, 40, CLR_GREEN,
SPRIG_OF_WOLFSBANE),
FOOD("clove of garlic", 7, 1, 1, 0, VEGGY, 40, CLR_WHITE, CLOVE_OF_GARLIC),
FOOD("clove of garlic", 7, 1, 1, 0, VEGGY, 40, CLR_WHITE,
CLOVE_OF_GARLIC),
/* name of slime mold is changed based on player's OPTION=fruit:something
and bones data might have differently named ones from prior games */
FOOD("slime mold", 75, 1, 5, 0, VEGGY, 250, HI_ORGANIC, SLIME_MOLD),
FOOD("slime mold", 75, 1, 5, 0, VEGGY, 250, HI_ORGANIC,
SLIME_MOLD),
/* people food */
FOOD("lump of royal jelly", 0, 1, 2, 0, VEGGY, 200, CLR_YELLOW,
LUMP_OF_ROYAL_JELLY),
FOOD("cream pie", 25, 1, 10, 0, VEGGY, 100, CLR_WHITE, CREAM_PIE),
FOOD("candy bar", 13, 1, 2, 0, VEGGY, 100, CLR_BRIGHT_BLUE, CANDY_BAR),
FOOD("candy bar", 13, 1, 2, 0, VEGGY, 100, CLR_BRIGHT_BLUE,
CANDY_BAR),
FOOD("fortune cookie", 55, 1, 1, 0, VEGGY, 40, CLR_YELLOW,
FORTUNE_COOKIE),
FOOD("pancake", 25, 2, 2, 0, VEGGY, 200, CLR_YELLOW, PANCAKE),
@@ -1206,30 +1216,33 @@ SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300,
* Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding
* these and on how many of them there are. If a real scroll gets added
* after stinking cloud or the number of extra descriptions changes,
* tilemap.c must be modified to match.
* tilemap.c must be modified to match. Mgc,Prob,Cost are superfluous.
* SC values must be distinct but are only used by 'nethack --dumpenums'.
*/
SCROLL(NoDes, "FOOBIE BLETCH", 1, 0, 100, SC01),
SCROLL(NoDes, "TEMOV", 1, 0, 100, SC02),
SCROLL(NoDes, "GARVEN DEH", 1, 0, 100, SC03),
SCROLL(NoDes, "READ ME", 1, 0, 100, SC04),
SCROLL(NoDes, "ETAOIN SHRDLU", 1, 0, 100, SC05),
SCROLL(NoDes, "LOREM IPSUM", 1, 0, 100, SC06),
SCROLL(NoDes, "FNORD", 1, 0, 100, SC07), /* Illuminati */
SCROLL(NoDes, "KO BATE", 1, 0, 100, SC08), /* Kurd Lasswitz */
SCROLL(NoDes, "ABRA KA DABRA", 1, 0, 100, SC09), /* traditional incantation */
SCROLL(NoDes, "ASHPD SODALG", 1, 0, 100, SC10), /* Portal */
SCROLL(NoDes, "ZLORFIK", 1, 0, 100, SC11), /* Zak McKracken */
SCROLL(NoDes, "GNIK SISI VLE", 1, 0, 100, SC12), /* Zak McKracken */
SCROLL(NoDes, "HAPAX LEGOMENON", 1, 0, 100, SC13),
SCROLL(NoDes, "EIRIS SAZUN IDISI", 1, 0, 100, SC14), /* Merseburg Incantations */
SCROLL(NoDes, "PHOL ENDE WODAN", 1, 0, 100, SC15), /* Merseburg Incantations */
SCROLL(NoDes, "GHOTI", 1, 0, 100, SC16), /* pronounced as 'fish',
George Bernard Shaw */
SCROLL(NoDes, "MAPIRO MAHAMA DIROMAT", 1, 0, 100, SC17), /* Wizardry */
SCROLL(NoDes, "VAS CORP BET MANI", 1, 0, 100, SC18), /* Ultima */
SCROLL(NoDes, "XOR OTA", 1, 0, 100, SC19), /* Aarne Haapakoski */
SCROLL(NoDes, "STRC PRST SKRZ KRK", 1, 0, 100, SC20), /* Czech and Slovak
tongue-twister */
#define XTRA_SCROLL_LABEL(text, sn) SCROLL(NoDes, text, 1, 0, 100, sn)
XTRA_SCROLL_LABEL( "FOOBIE BLETCH", SC01),
XTRA_SCROLL_LABEL( "TEMOV", SC02),
XTRA_SCROLL_LABEL( "GARVEN DEH", SC03),
XTRA_SCROLL_LABEL( "READ ME", SC04),
XTRA_SCROLL_LABEL( "ETAOIN SHRDLU", SC05),
XTRA_SCROLL_LABEL( "LOREM IPSUM", SC06),
XTRA_SCROLL_LABEL( "FNORD", SC07), /* Illuminati */
XTRA_SCROLL_LABEL( "KO BATE", SC08), /* Kurd Lasswitz */
XTRA_SCROLL_LABEL( "ABRA KA DABRA", SC09), /* traditional incantation */
XTRA_SCROLL_LABEL( "ASHPD SODALG", SC10), /* Portal */
XTRA_SCROLL_LABEL( "ZLORFIK", SC11), /* Zak McKracken */
XTRA_SCROLL_LABEL( "GNIK SISI VLE", SC12), /* Zak McKracken */
XTRA_SCROLL_LABEL( "HAPAX LEGOMENON", SC13),
XTRA_SCROLL_LABEL( "EIRIS SAZUN IDISI", SC14), /* Merseburg Incantations */
XTRA_SCROLL_LABEL( "PHOL ENDE WODAN", SC15), /* Merseburg Incantations */
XTRA_SCROLL_LABEL( "GHOTI", SC16), /* pronounced as 'fish',
* George Bernard Shaw */
XTRA_SCROLL_LABEL("MAPIRO MAHAMA DIROMAT", SC17), /* Wizardry */
XTRA_SCROLL_LABEL( "VAS CORP BET MANI", SC18), /* Ultima */
XTRA_SCROLL_LABEL( "XOR OTA", SC19), /* Aarne Haapakoski */
XTRA_SCROLL_LABEL("STRC PRST SKRZ KRK", SC20), /* Czech and Slovak
* tongue-twister */
#undef XTRA_SCROLL_LABEL
/* These must come last because they have special fixed descriptions.
*/
#ifdef MAIL_STRUCTURES
@@ -1489,11 +1502,11 @@ COIN("gold piece", 1000, GOLD, 1, GOLD_PIECE),
BITS(0, 1, 0, 0, 0, 0, 0, 0, 0, \
HARDGEM(mohs), 0, -P_SLING, glass), \
0, GEM_CLASS, prob, 0, 1, gval, 3, 3, 0, 0, nutr, color, sn)
#define ROCK(name,desc,kn,prob,wt,gval,sdam,ldam,mgc,nutr,mohs,glass,color,sn) \
#define ROCK(name,desc,kn,prob,wt,gval,sdam,ldam,mgc,nutr,mohs,glass,colr,sn) \
OBJECT(OBJ(name, desc), \
BITS(kn, 1, 0, 0, mgc, 0, 0, 0, 0, \
HARDGEM(mohs), 0, -P_SLING, glass), \
0, GEM_CLASS, prob, 0, wt, gval, sdam, ldam, 0, 0, nutr, color, sn)
0, GEM_CLASS, prob, 0, wt, gval, sdam, ldam, 0, 0, nutr, colr, sn)
GEM("dilithium crystal", "white", 2, 1, 4500, 15, 5, GEMSTONE, CLR_WHITE,
DILITHIUM_CRYSTAL),
MARKER(FIRST_REAL_GEM, DILITHIUM_CRYSTAL)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1720717988 2024/07/11 17:13:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.261 $ */
/* NetHack 3.7 patchlevel.h $NHDT-Date: 1725653013 2024/09/06 20:03:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.264 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -84,14 +84,15 @@
* ubuntu impish 21.10; disable that for any Linux unless GCC_URWARN is
* defined to force it back into effect
* update_inventory() after leash goes slack
* player assigned name for monsters, specific objects, or object types could be
longer than what was intended to be allowed; for 'curses', much longer
* windows: added winflexbison to travis-ci configuration to permit full build of
* levcomp and dgncomp
* windows: a bad chdir specified in win/win32/dgnstuff.mak caused full build to
* abort
* windows: the console.rc file had outdated information stating 3.6.3 when the
* official 3.6.6 binary was built.
* player assigned name for monsters, specific objects, or object types
* could be longer than what was intended to be allowed; for 'curses',
* it could be much longer
* windows: added winflexbison to travis-ci configuration to permit full
* build of levcomp and dgncomp
* windows: a bad chdir specified in win/win32/dgnstuff.mak caused full build
* to abort
* windows: the console.rc file had outdated information stating 3.6.3 when
* the official 3.6.6 binary was built.
* windows: switch from using keyhandling dll's to incorporating the three
* variations (default, ray, 340) in sys/winnt/nttty.c
* curses: cherry-picked selectsaved code from 3.7 for menu of save files
@@ -103,7 +104,8 @@
* invalid status highlight color could be maliciously used to corrupt memory
* formatting corpse names used internal buffers differently from formatting
* other objects and could potentially clobber memory
* avoid divide by 0 crash if 'bogusmon' (file of bogus monster types) is empty
* avoid divide by 0 crash if 'bogusmon' (file of bogus monster types) is
* empty
* avoid #wizrumorcheck crash if either 'rumors.tru' or 'rumors.fal' or both
* were empty when makedefs built 'rumors'
*/
@@ -113,10 +115,12 @@
* fix accessing mons[-1] when trying to gate in a non-valid demon
* fix accessing mons[-1] when monster figures out if a tin cures stoning
* have string_for_opt() return empty_optstr on failure
* ensure existing callers of string_for_opt() check return value before using it
* ensure existing callers of string_for_opt() check return value before
* using it
* fix potential buffer overflow in add_menu_coloring()
* fix potential buffer overflow in sym_val()
* fix potential buffer overflow in pline(), raw_printf(), and config_error_add()
* fix potential buffer overflow in pline(), raw_printf(), and
* config_error_add()
* fix potential buffer overflow in choose_windows()
* use vsnprintf instead of vsprintf in pline.c where possible
* Windows: includes a fix from a 3.6.4 post-release update where
@@ -127,24 +131,24 @@
/* Patch 4, December 18, 2019
*
* fix potential buffer overflow when parsing run-time configuration file
* GDBPATH and GREPPATH from sysconf or -D... on compilation command line were
* being processed even if PANICTRACE was disabled but only being freed
* at end of game when that was enabled
* GDBPATH and GREPPATH from sysconf or -D... on compilation command line
* were being processed even if PANICTRACE was disabled but only being
* freed at end of game when that was enabled
* fix the article used in the message when your steed encounters a polymorph
* trap
* allow teleporting onto the vibrating square
* message "your knapsack can't accommodate any more items" when picking stuff
* up or removing such from container was inaccurate if there was some
* gold pending; vary the message rather than add more convoluted pickup
* code
* message "your knapsack can't accommodate any more items" when picking
* stuff up or removing such from container was inaccurate if there was
* some gold pending; vary the message rather than add more convoluted
* pickup code
* dozen-ish assorted spelling/typo fixes in messages and source comments
* wizard mode wishing for terrain would leave it unmapped if done while blind
* wizard mode terrain wish could leave hero in water (severe vision limits)
* or in lava (trapped, sinking) which wasn't there any more
* flying hero can go down (via '>') holes or trap doors instead of escaping
* trap
* polymorphed hero hiding on the ceiling can now use '>' to unhide instead of
* being told "you can't go down here"
* polymorphed hero hiding on the ceiling can now use '>' to unhide instead
* of being told "you can't go down here"
* fix compilation on platforms that split the ncurses and tinfo libraries
* Windows: allow all game files to be on a portable device via the sysconf
* option 'portable_device_paths'
@@ -157,7 +161,8 @@
* off due to being polymorphed
* Fixed 'object lost' panic when attempting to crawl out of the water during
* emergency disrobing/dropping
* Running now stops when moving over engravings so you can tell where they are
* Running now stops when moving over engravings so you can tell where they
* are
* Fixed detection of unseen/secret doors which failed to find monsters hiding
* under objects and failed to find monsters hiding at trap locations
* Ensured fatal status conditions made it to disclosure and/or dumplog
@@ -182,13 +187,14 @@
* Improved performance of some tty versions by reducing the number of
* function calls made from mapglyph
* Allowed the msdos implementation to build with curses and PDCurses
* Included over 100 other fixes and improvements as outlined in doc/fixes36.3
* Included over 100 other fixes and improvements as outlined in
* doc/fixes36.3 (later renamed doc/fixes3-6-3.txt)
*/
/* Patch 2, May 7, 2019
*
* Over 320 bug fixes including a couple of crash bug fixes as outlined in
* doc/fixes36.2
* doc/fixes36.2 (later renamed to doc/fixes-3-6-2.txt)
* More than 15 enhancements or improvements
* Ensuring that unix Makefiles do not rely on features unique to gnu make
* Improvements to hilite_status parsing in an effort to ensure that expected
@@ -202,13 +208,13 @@
/* Patch 1, April 27, 2018
*
* Over four hundred and seventy bug fixes and improvements as outlined in
* doc/fixes36.1
* doc/fixes36.1 (later renamed to doc/fixes3-6-1.txt)
*/
/*
* NetHack 3.6.0, December 7, 2015
*
* Hundreds of bug fixes as outlined in doc/fixes36.0.
* Hundreds of bug fixes as outlined in doc/fixes36.0 (doc/fixes3-6-0.txt).
* Some code reorganization.
* Some new features.
* Variations of some community patches rolled in.

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 permonst.h $NHDT-Date: 1721844081 2024/07/24 18:01:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.7 permonst.h $NHDT-Date: 1725653014 2024/09/06 20:03:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -83,7 +83,8 @@ struct permonst {
uchar mcolor; /* color to use */
};
extern NEARDATA struct permonst mons[NUMMONS + 1]; /* the master list of monster types */
extern NEARDATA struct permonst mons[NUMMONS + 1]; /* the master list of
* monster types */
#define VERY_SLOW 3
#define SLOW_SPEED 9

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 sndprocs.h $NHDT-Date: 1693253118 2023/08/28 20:05:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.24 $ */
/* NetHack 3.7 sndprocs.h $NHDT-Date: 1725653015 2024/09/06 20:03:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Michael Allison, 2022 */
/* NetHack may be freely redistributed. See license for details. */
@@ -69,7 +69,8 @@ struct sound_voice {
extern struct sound_procs sndprocs;
#define SOUNDID(soundname) #soundname, ((enum soundlib_ids) soundlib_##soundname)
#define SOUNDID(soundname) \
#soundname, ((enum soundlib_ids) soundlib_##soundname)
/*
* Types of triggers
@@ -295,7 +296,7 @@ enum findsound_approaches {
enum sound_file_flags {
sff_default, /* add dir prefix + '/' + sound + suffix */
sff_base_only, /* base sound name only, no dir, no suffix */
sff_havedir_append_rest, /* dir provided, append base sound name + suffix */
sff_havedir_append_rest, /* dir provided, append base sound name+suffix */
sff_baseknown_add_rest /* base is already known, add dir and suffix */
};

View File

@@ -42,11 +42,11 @@
#ifdef ACTIVATE_WARNING_PRAGMAS
#if defined(__clang__)
#define DISABLE_WARNING_UNREACHABLE_CODE \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
#define DISABLE_WARNING_FORMAT_NONLITERAL \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wformat-nonliteral\"")
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wformat-nonliteral\"")
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_FORMAT_NONLITERAL _Pragma("clang diagnostic pop")
@@ -55,13 +55,14 @@
#define STDC_Pragma_AVAILABLE
#elif defined(__GNUC__)
/* unlike in clang, -Wunreachable-code does not function in later versions of gcc */
/* unlike in clang, -Wunreachable-code does not function in later versions
of gcc [this may be an issue of requiring -O1 or higher] */
#define DISABLE_WARNING_UNREACHABLE_CODE \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
#define DISABLE_WARNING_FORMAT_NONLITERAL \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"")
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_FORMAT_NONLITERAL _Pragma("GCC diagnostic pop")
@@ -72,14 +73,14 @@
#elif defined(_MSC_VER)
#if _MSC_VER > 1916
#define DISABLE_WARNING_UNREACHABLE_CODE \
_Pragma("warning( push )") \
_Pragma("warning( disable : 4702 )")
_Pragma("warning( push )") \
_Pragma("warning( disable : 4702 )")
#define DISABLE_WARNING_FORMAT_NONLITERAL \
_Pragma("warning( push )") \
_Pragma("warning( disable : 4774 )")
_Pragma("warning( push )") \
_Pragma("warning( disable : 4774 )")
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT \
_Pragma("warning( push )") \
_Pragma("warning( disable : 4127 )")
_Pragma("warning( push )") \
_Pragma("warning( disable : 4127 )")
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT _Pragma("warning( pop )")
#define RESTORE_WARNING_FORMAT_NONLITERAL _Pragma("warning( pop )")
#define RESTORE_WARNING_UNREACHABLE_CODE _Pragma("warning( pop )")
@@ -87,14 +88,14 @@
#define STDC_Pragma_AVAILABLE
#else /* Visual Studio prior to 2019 below */
#define DISABLE_WARNING_UNREACHABLE_CODE \
__pragma(warning(push)) \
__pragma(warning(disable:4702))
__pragma(warning(push)) \
__pragma(warning(disable:4702))
#define DISABLE_WARNING_FORMAT_NONLITERAL \
__pragma(warning(push)) \
__pragma(warning(disable:4774))
__pragma(warning(push)) \
__pragma(warning(disable:4774))
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT \
__pragma(warning(push)) \
__pragma(warning(disable:4127))
__pragma(warning(push)) \
__pragma(warning(disable:4127))
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT __pragma(warning(pop))
#define RESTORE_WARNING_FORMAT_NONLITERAL __pragma(warning(pop))
#define RESTORE_WARNING_UNREACHABLE_CODE __pragma(warning(pop))

View File

@@ -119,7 +119,7 @@ extern win_request_info *curses_ctrl_nhwindow(winid, int, win_request_info *);
/* curswins.c */
extern WINDOW *curses_create_window(int wid, int width, int height, orient orientation);
extern WINDOW *curses_create_window(int, int, int, orient);
extern void curses_set_wid_colors(int wid, WINDOW *win);
extern void curses_parse_wid_colors(int wid, char *fg, char *bg);
extern void curses_destroy_win(WINDOW *win);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 winprocs.h $NHDT-Date: 1683748057 2023/05/10 19:47:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.74 $ */
/* NetHack 3.7 winprocs.h $NHDT-Date: 1725653017 2024/09/06 20:03:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.81 $ */
/* Copyright (c) David Cohrs, 1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -420,7 +420,8 @@ struct chain_procs {
unsigned long *);
boolean (*win_can_suspend)(CARGS);
void (*win_update_inventory)(CARGS, int);
win_request_info *(*win_ctrl_nhwindow)(CARGS, winid, int, win_request_info *);
win_request_info *(*win_ctrl_nhwindow)(CARGS, winid, int,
win_request_info *);
};
#endif /* WINCHAIN */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 youprop.h $NHDT-Date: 1702274029 2023/12/11 05:53:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.44 $ */
/* NetHack 3.7 youprop.h $NHDT-Date: 1725653018 2024/09/06 20:03:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.45 $ */
/* Copyright (c) 1989 Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
@@ -137,6 +137,7 @@
#define EWounded_legs u.uprops[WOUNDED_LEGS].extrinsic
#define Wounded_legs (HWounded_legs || EWounded_legs)
/* Sleepy: prone to falling asleep periodically; not necessarily asleep now */
#define HSleepy u.uprops[SLEEPY].intrinsic
#define ESleepy u.uprops[SLEEPY].extrinsic
#define Sleepy (HSleepy || ESleepy)
@@ -395,8 +396,9 @@
#define Hate_silver (u.ulycn >= LOW_PM || hates_silver(gy.youmonst.data))
/* _Hitchhikers_Guide_to_the_Galaxy_ on uses for 'towel': "wrap it round
/* _The_Hitchhikers_Guide_to_the_Galaxy_ on uses for 'towel': "wrap it round
your head to ward off noxious fumes" [we require it to be damp or wet] */
#define Half_gas_damage (ublindf && ublindf->otyp == TOWEL && ublindf->spe > 0)
#define Half_gas_damage \
(ublindf && ublindf->otyp == TOWEL && ublindf->spe > 0)
#endif /* YOUPROP_H */