Commit Graph
100 Commits
Author SHA1 Message Date
nhmall bad3e02246 follow-up comment bit 2026-04-23 17:31:20 -04:00
nhmall 1556aec451 formatting (line length) bit 2026-04-23 15:28:20 -04:00
nhmall 93ab8405d8 some further startup, option processing bits 2026-04-23 14:31:43 -04:00
nhmall 965e1bf99d make program_state initialization a discrete step
Having it rolled into decl_globals_init() was
causing some early options to misbehave because
those early options were trying to use program_state
fields to determine their behavior, but decl_globals_init()
was resetting the program_state fields that were being used
to do that.
2026-04-22 11:15:19 -04:00
nhmall 0ef54e364e more thitu() and Half_physical_damage
As commented in:
https://github.com/NetHack/NetHack/issues/1459#issuecomment-4280354364

This also fixes a minor typo in the related doc/fixes3-7-0.txt paragraph.
2026-04-21 05:40:52 -04:00
nhmall 32acb80174 resolve some valid warnings on Windows
../sys/windows/windmain.c:226:12: warning: address of array 'gc.chosen_windowtype' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
  226 |     if (gc.chosen_windowtype && *gc.chosen_windowtype)

../sys/windows/consoletty.c:873:27: warning: address of array 'back->utf8str' will always evaluate
      to 'true' [-Wpointer-bool-conversion]
  873 |                 if (back->utf8str && front->utf8str
      |                     ~~~~~~^~~~~~~ ~~
../sys/windows/consoletty.c:873:45: warning: address of array 'front->utf8str' will always evaluate
      to 'true' [-Wpointer-bool-conversion]
  873 |                 if (back->utf8str && front->utf8str
      |                                   ~~ ~~~~~~~^~~~~~~
2026-04-21 05:13:46 -04:00
nhmall 0ca6e6f16f stray tabs 2026-04-20 21:04:22 -04:00
nhmall 7d377a0f02 clang detection in unix hints
Closes #1500 but it does apply the pull request.
Hopefully, this makes things a little clearer.
2026-04-20 20:47:59 -04:00
nhmall b5e6840bea vestigal line removed
Closes #1502
2026-04-20 10:31:32 -04:00
nhmall 3d5b3e35ea Guidebook.txt update (from NetHack daily cron) 2026-04-16 22:34:24 -04:00
nhmall fd1b8e60f8 quiet a new warning that recently appeared
[warning]NetHack\src\hack.c(3223,16): Warning C4389: '!=': signed/unsigned mismatch
2026-04-16 19:57:02 -04:00
nhmall 47892c1f22 update tested versions of Visual Studio 2026-04-16 2026-04-16 19:46:46 -04:00
nhmall bf7ba34a1e Guidebook datestamp update 2026-04-16 19:31:12 -04:00
nhmall 8c8121eb3c move a pair of functions from save.c to restore.c
A utility that links only with restore.o needs to find them.
2026-04-13 09:08:53 -04:00
nhmall efaabc3203 more storing only relative times in save & bones 2026-04-13 07:53:51 -04:00
nhmall 4bd3f8398e whitespace cleanup: tabs to spaces 2026-04-13 07:35:23 -04:00
nhmall 36c3f208a6 again store relative timestamps in save and bones 2026-04-13 07:32:54 -04:00
nhmall c249de0c2a timestamp change in save files requires EDITLEVEL bump 2026-04-13 07:11:47 -04:00
nhmall 4665b6c13c follow-up
staticfn define caused test to succeed when it shouldn't have
2026-04-13 06:47:10 -04:00
nhmall 337c5189dd store relative timestamps in save and bones 2026-04-13 06:39:54 -04:00
nhmall 80cc5ecb29 some windows cleanup at end of game 2026-04-11 14:08:36 -04:00
nhmall f6e341546d thinko 2026-04-11 11:10:47 -04:00
nhmall f29cea4a35 another impossible() update for dog_eat() 2026-04-11 07:17:20 -04:00
nhmall 85f03deca9 refine a dog_eat impossible()
Have the impossible message indicate whether the pointed-to
edog struct itself is still intact (not overwritten somewhere,
such as misuse of a stale or bad pointer) versus the apport field
itself being assigned an out-of-whack value some place.
2026-04-11 06:37:10 -04:00
nhmall 45b01cdb9a nomenclature of a couple of tasks in CI 2026-04-10 11:30:46 -04:00
nhmall e8290bc275 try testing a Windows 11 snapdragon build in CI 2026-04-10 11:14:22 -04:00
nhmall 3acb327115 resolve a warning on one platform 2026-04-10 10:53:53 -04:00
nhmall fffbf4c2e5 Windows option update for map_mode
Ensure preference_update() is called
2026-04-10 10:36:36 -04:00
nhmall 832db5b9e1 define TTY_PERM_INVENT in Windows console build 2026-04-10 09:26:24 -04:00
nhmall e005c26fbd another safestartup vestige 2026-04-10 09:24:10 -04:00
nhmall 4dd47db3ad yet more Windows startup; also safestartup vestige 2026-04-09 15:08:07 -04:00
nhmall 3b7c0e8a19 follow-up: more Windows startup 2026-04-09 14:14:49 -04:00
nhmall 335cd65d5a some further Windows startup tweaking 2026-04-09 14:04:28 -04:00
nhmall 699c31459b follow-up: fix placement location 2026-04-09 10:32:24 -04:00
nhmall 8b2b749f6f quiet a warning observed when compiling consoletty
The warning was observed during CI build:
[warning]NetHack\sys\windows\consoletty.c(2573,29): Warning C4127: conditional expression is constant
2026-04-09 10:28:52 -04:00
nhmall 4f5146306b follow-up: punctuation 2026-04-09 10:20:01 -04:00
nhmall 213400529a follow-up comment bit 2026-04-09 10:18:00 -04:00
nhmall 49cccb5a8d quiet a warning compiling sys/share/uudecode in recent compiler
../sys/share/uudecode.c: In function ‘main’:
../sys/share/uudecode.c:131:32: warning: format ‘%o’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=]
  131 |     (void) sscanf(buf, "begin %o %s", &mode, dest);
      |                               ~^      ~~~~~
      |                                |      |
      |                                |      int *
      |                                unsigned int *
      |                               %o
2026-04-09 10:06:24 -04:00
nhmall f8fbd9848e a couple more minor startup tweaks 2026-04-08 10:32:29 -04:00
nhmall 0085feb56a follow-up: remove one unnecessary change 2026-04-07 14:29:58 -04:00
nhmall 8cbbb74f3b more early config file pass
Because some optlist entries were ignored in the early pass,
some non OPTIONS= lines in the config file were having issues
due to those options not being set.

Extend what is being disregarded in the early config file pass
to include other config file statements.
2026-04-07 14:22:07 -04:00
nhmall cf7a514596 consoletty.c bit
restrict a debugging line
2026-04-07 13:59:43 -04:00
nhmall fdbf84b9b7 remove some dead code 2026-04-06 13:17:32 -04:00
nhmall 8716d92280 objects.txt tile numbering
Closes #1496 reported by @horlogeislux
2026-04-06 12:38:25 -04:00
nhmall b2b2c3f6f2 remove extraneous line 2026-04-06 11:00:12 -04:00
nhmall 0a3b8a7b72 Makefile.nmake tweaking 2026-04-05 20:28:43 -04:00
nhmall 1745d0bcce follow-up: cross compile for msdos 2026-04-05 13:36:06 -04:00
nhmall 6234e96b57 Change Windows startup - take 2
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 13:11:14 -04:00
nhmall db1f230772 Revert "Change Windows startup"
This reverts commit acb85b18cf.

Some optlist issues arose on some platforms, but not all.
I need to investigate the cause of those.
2026-04-05 12:07:57 -04:00
nhmall acb85b18cf Change Windows startup
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 11:37:20 -04:00
nhmall 92340a6827 consolidate some arg processing
Unix and Windows had diverged significantly for command line
options handling.

This:
   1. uses the the Unix processing as a baseline.
   2. consolidates the code in earlyarg.c, where it can
      be a common copy to be shared.
   3. start converting the Windows command line argument
      processing to the Unix code that now resides in earlyarg.c.
2026-04-04 13:44:23 -04:00
nhmall 7120a7190e some more discarded-qualifiers fixes 2026-04-04 07:52:06 -04:00
nhmall 3b4d4cd261 expand range of oc_weight 2026-04-01 12:56:37 -04:00
nhmall e377591240 follow-up: avoid issue with onefile concatenation 2026-04-01 10:59:22 -04:00
nhmall ab459265b0 top line fixup 2026-04-01 09:09:39 -04:00
nhmall 396a3735ca follow-up for Xcode project 2026-04-01 08:48:05 -04:00
nhmall 686618f34d move early arg and enum dump processing to own file 2026-04-01 08:32:13 -04:00
nhmall aa25005cf0 whitespace cleanup on recent file
replace leading tab with spaces to match include style
2026-03-31 12:57:41 -04:00
nhmall 90db8d7e2d clear up some warnings appearing with gcc 15.2.0
allmain.c: In function ‘debug_fields’:
allmain.c:1133:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1133 |     while ((op = strchr(opts, ',')) != 0) {
      |                ^
cfgfiles.c: In function ‘find_optparam’:
cfgfiles.c:590:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  590 |     bufp = strchr(buf, '=');
      |          ^
cfgfiles.c:591:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  591 |     altp = strchr(buf, ':');
      |          ^
end.c: In function ‘should_query_disclose_option’:
end.c:482:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  482 |     if ((dop = strchr(disclosure_options, category)) != 0) {
      |              ^
invent.c: In function ‘loot_classify’:
invent.c:175:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  175 |     p = strchr(classorder, oclass);
      |       ^
o_init.c: In function ‘dodiscovered’:
o_init.c:774:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  774 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
o_init.c: In function ‘doclassdisco’:
o_init.c:907:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  907 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
objnam.c: In function ‘the’:
objnam.c:2200:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                   ^
objnam.c:2200:53: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                                                     ^
options.c: In function ‘optfn_disclose’:
options.c:1529:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1529 |             dop = strchr(disclosure_options, c);
      |                 ^
pager.c: In function ‘add_cmap_descr’:
pager.c:1212:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1212 |                     || ((p = strchr(x_str, ' ')) != 0 && !strcmpi(p, " ice"))
      |                            ^
2026-03-31 10:16:28 -04:00
nhmall 12663473ab update tested versions of Visual Studio 2026-03-29 2026-03-29 20:20:56 -04:00
nhmall 5d814053a1 some outdated cleanup outdated/sys/windows 2026-03-27 06:59:49 -04:00
nhmall b58d2d4096 try to reduce some Amiga cross-compile warnings 2026-03-25 08:48:14 -04:00
nhmall 3c89dc2387 Guidebook date stamp to reflect most recent update 2026-03-25 08:06:12 -04:00
nhmall aac60db8d6 update Cross-compiling for Amiga steps 2026-03-24 11:46:07 -04:00
nhmall d929adc85c warning fix in sp_lev.c
In function 'create_monster',
    inlined from 'lspo_monster' at sp_lev.c:3385:5:
sp_lev.c:2169:32: warning: 'tmpmons.m_lev_adj' may be used uninitialized [-Wmaybe-uninitialized]
 2169 |             if (mtmp->m_lev + m->m_lev_adj > 49)
      |                               ~^~~~~~~~~~~
sp_lev.c: In function 'lspo_monster':
sp_lev.c:3217:13: note: 'tmpmons.m_lev_adj' was declared here
 3217 |     monster tmpmons;
      |             ^~~~~~~
2026-03-24 10:05:48 -04:00
nhmall 39a4111104 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 07:53:39 -04:00
nhmall 4991339655 don't abort clean if target cross-compile directory isn't there 2026-03-24 07:49:38 -04:00
nhmall 7f8f7c54dc Files identification update 2026-03-24 07:13:04 -04:00
nhmall 507f526b43 remove duplicate entry in .gitignore 2026-03-24 05:48:51 -04:00
nhmall 14c5f318e1 Add a fixes3-7-0.txt entry for Amiga build pr1494
Build instructions in sys/amiga/README.amiga

The Amiga cross-compile support makes the following file changes to
the repository:

 rename {outdated/include => include}/amiconf.h (96%)
 create mode 100644 sys/amiga/README.amiga
 rename {outdated/sys => sys}/amiga/amidos.c (91%)
 rename {outdated/sys => sys}/amiga/amidos.p (100%)
 rename {outdated/sys => sys}/amiga/amifont.uu (100%)
 rename {outdated/sys => sys}/amiga/amifont8.uu (100%)
 rename {outdated/sys => sys}/amiga/amigst.c (100%)
 rename {outdated/sys => sys}/amiga/amii.hlp (100%)
 rename {outdated/sys => sys}/amiga/amimenu.c (100%)
 rename {outdated/sys => sys}/amiga/amirip.c (93%)
 rename {outdated/sys => sys}/amiga/amistack.c (55%)
 rename {outdated/sys => sys}/amiga/amitty.c (97%)
 rename {outdated/sys => sys}/amiga/amiwind.c (90%)
 rename {outdated/sys => sys}/amiga/amiwind.p (100%)
 create mode 100644 sys/amiga/bmp2iff_host.c
 rename {outdated/sys => sys}/amiga/clipwin.c (100%)
 rename {outdated/sys => sys}/amiga/colorwin.c (100%)
 rename {outdated/sys => sys}/amiga/grave16.xpm (100%)
 create mode 100644 sys/amiga/nethack.cnf
 rename {outdated/sys => sys}/amiga/winamenu.c (94%)
 rename {outdated/sys => sys}/amiga/winami.c (94%)
 rename {outdated/sys => sys}/amiga/winami.p (87%)
 rename {outdated/sys => sys}/amiga/winchar.c (78%)
 rename {outdated/sys => sys}/amiga/windefs.h (98%)
 rename {outdated/sys => sys}/amiga/winext.h (100%)
 rename {outdated/sys => sys}/amiga/winfuncs.c (86%)
 rename {outdated/sys => sys}/amiga/winkey.c (89%)
 rename {outdated/sys => sys}/amiga/winproto.h (88%)
 rename {outdated/sys => sys}/amiga/winreq.c (95%)
 rename {outdated/sys => sys}/amiga/winstr.c (95%)
 create mode 100644 sys/amiga/xpm2iff_host.c
2026-03-24 05:43:46 -04:00
nhmall aa90cd5cd8 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 05:37:17 -04:00
nhmall 1ba9be09fa pre-C23 build fix
Prior to C23, a statement is required after a label.
2026-03-23 06:42:11 -04:00
nhmall e94a2f2bf2 doc/Guidebook.txt update Mar03-2026 2026-03-22 11:37:07 -04:00
nhmall f9cebc5890 avoid a warning with Xcode build 2026-03-22 11:33:26 -04:00
nhmall 8ee179a594 Guidebook timestamp to reflect the most recent update 2026-03-22 09:30:16 -04:00
nhmall 33b24fbd13 update Xcode project to reflect recent file addition 2026-03-21 18:43:04 -04:00
nhmall 1eadfa962d don't include size_t * and time_t * in _Generic for now
There are behavior differences with macOS and other plaforms that
would need to be addressed if they were included.
2026-03-21 11:11:28 -04:00
nhmall 044a229467 whitespace cleanup: tabs to spaces in sys 2026-03-19 20:33:03 -04:00
nhmall b33b09bcac whitespace cleanup: tabs to spaces 2026-03-19 20:22:24 -04:00
nhmall e21995a36d follow-up bit (from testing) 2026-03-19 10:10:59 -04:00
nhmall 9aa2f61058 limits.h follow-up 2026-03-19 10:02:10 -04:00
nhmall 87ab214229 allow some additional values for compiler testing
Allow compiler.370 to recognize a couple of additional values on the Make command line.
.
2026-03-19 09:54:19 -04:00
nhmall e8363ae23d include limits.h in cstd.h
Ensure the standard C99 values are available to the NetHack code base, so that
code/macros to accomplish essentially the same thing are not necessary.

    CHAR_BIT        Defines the number of bits in a byte.
    SCHAR_MIN       Defines the minimum value for a signed char.
    SCHAR_MAX       Defines the maximum value for a signed char.
    UCHAR_MAX       Defines the maximum value for an unsigned char.
    CHAR_MIN        Defines the minimum value for type char and its value will be equal to SCHAR_MIN if char represents negative values, otherwise zero.
    CHAR_MAX        Defines the value for type char and its value will be equal to SCHAR_MAX if char represents negative values, otherwise UCHAR_MAX.
    MB_LEN_MAX      Defines the maximum number of bytes in a multi-byte character.
    SHRT_MIN        Defines the minimum value for a short int.
    SHRT_MAX        Defines the maximum value for a short int.
    USHRT_MAX       Defines the maximum value for an unsigned short int.
    INT_MIN         Defines the minimum value for an int.
    INT_MAX         Defines the maximum value for an int.
    UINT_MAX        Defines the maximum value for an unsigned int.
    LONG_MIN        Defines the minimum value for a long int.
    LONG_MAX        Defines the maximum value for a long int.
    ULONG_MAX       Defines the maximum value for an unsigned long int.
2026-03-19 09:48:29 -04:00
nhmall 85e3d721fb Increase the value range of corpse weights
This breaks save compatibility, but is being pushed together with
other save-breaking changes to avoid the need for multiple bumps to
EDITLEVEL.
2026-03-18 23:32:26 +00:00
nhmall 8d33cafb3e update tested versions of Visual Studio 2026-03-17 2026-03-17 14:25:24 -04:00
nhmall 7cff1696b7 update tested versions of Visual Studio 2026-03-12 2026-03-12 09:28:37 -04:00
nhmall 7261c848c7 update tested versions of Visual Studio 2026-03-01 2026-03-01 09:25:55 -05:00
nhmall cccb0303ed update tested versions of Visual Studio 2026-02-12 2026-02-12 07:01:52 -05:00
nhmall a55ca3ab87 Guidebook.txt update 2026-02-12 06:30:54 -05:00
nhmall fcd9f5468c some coordxy follow-up
Return a couple of variables that actually held a direction back
to int from coordxy.

bhit() takes int params instead of coordxy.

boomhit() takes int params instead of coordxy.

xytod() renamed to xytodir(), and takes int params (promotion will handle
coordxy params).

dtoxy(coord *, int) renamed to dirtocoord(coord *, int).
2026-02-11 09:40:25 -05:00
nhmall b76d4338be avoid a reported obuf reuse in use_misc()
Report: https://github.com/NetHack/NetHack/issues/1486

Resolves #1486
2026-02-09 08:39:21 -05:00
nhmall 8833e670cd Merge branch 'NetHack-3.7-prepare-for-groff-1.24' of https://github.com/g-branden-robinson/NetHack into NetHack-3.7 2026-02-07 08:07:30 -05:00
nhmall 2a0d3eea64 a warning bit
Visual Studio build:
src/nhlsel.c(970) : warning C4702: unreachable code
2026-01-25 11:49:36 -05:00
nhmall 62f3969899 another Lua version bump follow-up 2026-01-25 10:34:27 -05:00
nhmall e1a3180535 update tested versions of Visual Studio 2026-01-25 2026-01-25 09:51:22 -05:00
nhmall 77ea8de105 attempt 6 to fix CI build issue 2026-01-24 10:51:40 -05:00
nhmall da208a0ac4 attempt 5 to fix CI build issue 2026-01-24 10:49:42 -05:00
nhmall c19fd7d7f8 attempt 4 to fix CI build issue 2026-01-24 10:30:25 -05:00
nhmall f54fc4908f attempt 3 to fix CI build issue 2026-01-24 10:28:42 -05:00
nhmall 33413604a0 attempt 2 to fix CI build issue 2026-01-24 09:49:20 -05:00