]> granicus.if.org Git - nethack/log
nethack
4 years agoensure build with old linux-qt5 hints
nhmall [Wed, 3 Feb 2021 18:46:13 +0000 (13:46 -0500)]
ensure build with old linux-qt5 hints

4 years agoremove debugging statement from warnings.h
nhmall [Wed, 3 Feb 2021 18:25:50 +0000 (13:25 -0500)]
remove debugging statement from warnings.h

4 years agoclear a number of Qt build warnings on linux related to compiler flags
nhmall [Wed, 3 Feb 2021 18:18:43 +0000 (13:18 -0500)]
clear a number of Qt build warnings on linux related to compiler flags

option ‘-Wimplicit’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
option ‘-Wmissing-parameter-type’ is valid for C/ObjC but not for C++
option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++
option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

4 years agovariable set but not used warning in qt_yndlg.cpp
nhmall [Wed, 3 Feb 2021 17:56:55 +0000 (12:56 -0500)]
variable set but not used warning in qt_yndlg.cpp

../win/Qt/qt_yndlg.cpp: In member function ‘char nethack_qt_::NetHackQtYnDialog::Exec()’:
../win/Qt/qt_yndlg.cpp:80:9: warning: variable ‘ch_per_line’ set but not used [-Wunused-but-set-variable]
   80 |     int ch_per_line=6;
      |         ^~~~~~~~~~~

4 years agoprevent a warning about a multi-line comment in qt_svsel.cpp
nhmall [Wed, 3 Feb 2021 17:51:26 +0000 (12:51 -0500)]
prevent a warning about a multi-line comment in qt_svsel.cpp

4 years agoQt c++ function name shadow warnings
nhmall [Wed, 3 Feb 2021 15:55:07 +0000 (10:55 -0500)]
Qt c++ function name shadow warnings

We have a struct called mkroom and a function called mkroom()
so c++ complains about the mkroom() function hiding the
initializer for the struct.

Similarly, we have a struct called attack and a function
called attack().

There may be a more elegant way of eliminating those two
warnings, but renaming mkroom() to do_mkroom() and
attack() to do_attack() was straightforward enough.

4 years agowording fix
nhmall [Wed, 3 Feb 2021 14:42:59 +0000 (09:42 -0500)]
wording fix

4 years agoextend the Qt clang fix pertaining to shadowing of global variables to g++
nhmall [Wed, 3 Feb 2021 14:22:57 +0000 (09:22 -0500)]
extend the Qt clang fix pertaining to shadowing of global variables to g++

4 years agoWindows format string bits
nhmall [Wed, 3 Feb 2021 02:53:13 +0000 (21:53 -0500)]
Windows format string bits

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
keni [Wed, 3 Feb 2021 01:46:54 +0000 (20:46 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agosrc/end.c: improve backtrace text spacing (see #K3259)
keni [Wed, 3 Feb 2021 01:45:45 +0000 (20:45 -0500)]
src/end.c: improve backtrace text spacing (see #K3259)

4 years agomore macOS whitelisting
nhmall [Wed, 3 Feb 2021 01:11:43 +0000 (20:11 -0500)]
more macOS whitelisting

X11, Qt, and util

also ensure the functional warnings.h macro definitions are used
with c++ clang compiler

4 years agowhitelist some macOS clang format-nonliteral warnings
nhmall [Wed, 3 Feb 2021 00:50:07 +0000 (19:50 -0500)]
whitelist some macOS clang format-nonliteral warnings

4 years agoenable -Wformat-nonliteral for linux and equivalent for windows compilers
nhmall [Wed, 3 Feb 2021 00:03:12 +0000 (19:03 -0500)]
enable -Wformat-nonliteral for linux and equivalent for windows compilers

Whitelist all the verified existing triggers:
makedefs.c: In function ‘name_file’
attrib.c: one compiler balks at a ? b : c for fmtstring
cmd.c: In function ‘extcmd_via_menu’
cmd.c: In function ‘wiz_levltyp_legend’
do.c: In function ‘goto_level’
do_name.c: In function ‘coord_desc’
dungeon.c: In function ‘overview_stats’
eat.c:  one compiler balks at a ? b : c for fmtstring
end.c:  one compiler balks at a ? b : c for fmtstring
engrave.c: In function ‘engr_stats’
hack:c one compiler balks at a ? b : c for fmtstring
hacklib.c: one compiler balks at a ? b : c for fmtstring
insight.c: one compiler balks at a ? b : c for fmtstring
invent.c: In function ‘let_to_name’
light.c: In function ‘light_stats’
mhitm.c: In function ‘missmm’
options.c: In function ‘handler_symset’
options.c: In function ‘basic_menu_colors’
options.c: In function ‘optfn_o_autopickup_exceptions’
options.c: In function ‘optfn_o_menu_colors’
options.c: In function ‘optfn_o_message_types’
options.c: In function ‘optfn_o_status_cond’
options.c: In function ‘optfn_o_status_hilites’
options.c: In function ‘doset’
options.c: In function ‘doset_add_menu’
options.c: In function ‘show_menu_controls’
options.c: In function ‘handle_add_list_remove’
pager.c: In function ‘do_supplemental_info’
pager.c: In function ‘dohelp’
region.c: In function ‘region_stats’
rumors.c: sscanf usage
sounds.c: In function ‘domonnoise’
spell.c: In function ‘dospellmenu’
timeout.c: In function ‘timer_stats’
topten.c: In function ‘outentry’, fscanf, sscanf, fprintf usage
windows.c: In function ‘genl_status_update’
zap.c: one compiler balks at a ? b : c for fmtstring
win/curses/cursstat.c: In function ‘curses_status_update’
win/tty/wintty.c: In function ‘tty_status_update’
win/win32/mswproc.c: In function ‘mswin_status_update’

4 years agoadd format string arg to Sprintf in hack.c
nhmall [Tue, 2 Feb 2021 22:20:41 +0000 (17:20 -0500)]
add format string arg to Sprintf in hack.c

4 years agowarning fix - missing format string in botl.c
nhmall [Tue, 2 Feb 2021 21:06:25 +0000 (16:06 -0500)]
warning fix - missing format string in botl.c

4 years agoresolve a warning in sounds.c
nhmall [Tue, 2 Feb 2021 01:02:12 +0000 (20:02 -0500)]
resolve a warning in sounds.c

sounds.c: In function ‘add_sound_mapping’:
sounds.c:1381:33: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
 1381 |         Sprintf(filespec, "%s/%s", sounddir, filename);
      |                                 ^
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from sounds.c:5:
../include/global.h:274:24: note: ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
  274 | #define Sprintf (void) sprintf
sounds.c:1381:9: note: in expansion of macro ‘Sprintf’
 1381 |         Sprintf(filespec, "%s/%s", sounddir, filename);
      |         ^~~~~~~

4 years agoclear some more format-overflow warnings
nhmall [Mon, 1 Feb 2021 21:36:17 +0000 (16:36 -0500)]
clear some more format-overflow warnings

clear some -Wformat-overflow warnings being experienced with
i586-pc-msdosdjgpp-gcc (GCC) 10.2.0 cross-compiler

--
Warnings log:

botl.c: In function 'status_hilite_menu_add':
botl.c:3661:38: warning: ' or ' directive writing 4 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
 3661 |                     Sprintf(obuf, "%s or %s",
      |                                      ^~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from botl.c:6:
../include/global.h:274:24: note: 'sprintf' output between 5 and 163 bytes into a destination of size 80
  274 | #define Sprintf (void) sprintf
botl.c:3661:21: note: in expansion of macro 'Sprintf'
 3661 |                     Sprintf(obuf, "%s or %s",
      |                     ^~~~~~~

do_name.c: In function 'getpos_menu':
do_name.c:594:37: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |                                     ^
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from do_name.c:6:
../include/global.h:274:24: note: 'sprintf' output 1 or more bytes (assuming 257) into a destination of size 256
  274 | #define Sprintf (void) sprintf
do_name.c:594:13: note: in expansion of macro 'Sprintf'
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |             ^~~~~~~

dungeon.c: In function 'print_dungeon':
dungeon.c:2172:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |                           ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 10 and 1427 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2172:13: note: in expansion of macro 'Sprintf'
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |             ^~~~~~~
dungeon.c:2169:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                           ^~
dungeon.c:2169:26: note: directive argument in the range [-21474836472147483646]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                          ^~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output 10 or more bytes (assuming 1427) into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2169:13: note: in expansion of macro 'Sprintf'
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |             ^~~~~~~
dungeon.c: In function 'print_mapseen':
dungeon.c:3185:33: warning: '%s' directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |                                 ^~                                ~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 37 and 292 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3185:9: note: in expansion of macro 'Sprintf'
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |         ^~~~~~~
dungeon.c:3350:35: warning: '%s' directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |                                   ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 18 and 273 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3350:9: note: in expansion of macro 'Sprintf'
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |         ^~~~~~~

explode.c:541:69: warning: '%s' directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                                                                     ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from explode.c:5:
../include/global.h:274:24: note: 'sprintf' output 21 or more bytes (assuming 276) into a destination of size 256
  274 | #define Sprintf (void) sprintf
explode.c:541:21: note: in expansion of macro 'Sprintf'
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                     ^~~~~~~

hacklib.c: In function 'yyyymmddhhmmss':
hacklib.c:1034:28: warning: '%02d' directive writing between 2 and 11 bytes into a region of size between 4 and 11 [-Wformat-overflow=]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                            ^~~~
hacklib.c:1034:22: note: directive argument in the range [-21474836472147483647]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from hacklib.c:7:
../include/global.h:274:24: note: 'sprintf' output between 15 and 67 bytes into a destination of size 15
  274 | #define Sprintf (void) sprintf
hacklib.c:1034:5: note: in expansion of macro 'Sprintf'
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |     ^~~~~~~

4 years agoyet-another typo
nhmall [Mon, 1 Feb 2021 18:46:54 +0000 (13:46 -0500)]
yet-another typo

4 years agofollow-up bit
nhmall [Mon, 1 Feb 2021 18:44:09 +0000 (13:44 -0500)]
follow-up bit

missed macro and a typo

4 years agomore warnings.h - macOS issue
nhmall [Mon, 1 Feb 2021 18:37:04 +0000 (13:37 -0500)]
more warnings.h - macOS issue

It turns out that macOS barked when a POP was issued without
a prior PUSH, so since the DISABLE_WARNING_CONDEXPR_IS_CONSTANT
expanded to an empty macro on that platform.

Include a corresponding
RESTORE_WARNING_CONDEXPR_IS_CONSTANT macro for use with that
particular warning.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Mon, 1 Feb 2021 18:24:08 +0000 (13:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agovisual studio project update; also recover.c
nhmall [Mon, 1 Feb 2021 18:24:14 +0000 (13:24 -0500)]
visual studio project update; also recover.c

4 years agoWindows nmake build warnings during compiles of Lua sources
nhmall [Mon, 1 Feb 2021 18:03:32 +0000 (13:03 -0500)]
Windows nmake build warnings during compiles of Lua sources

4 years agosuppress a particular warning for an individual function; useful for non-gcc
nhmall [Mon, 1 Feb 2021 17:54:19 +0000 (12:54 -0500)]
suppress a particular warning for an individual function; useful for non-gcc

Microsoft and other non-GNU compilers don't recognize gcc tricks
like  /*NOTREACHED*/ to suppress individual warnings. clang recognizes most
of them because it tries to be gcc-compatible. Because of that, a lot of
potentially useful warnings have had to be completely suppressed in the
past in all source files when using the non-gcc compatible compilers.

Now that the code is C99, take advantage of a way to suppress warnings for
individual functions, a big step up from suppressing the warnings
altogether.

Unfortunately, it does require a bit of ugliness caused by the
insertion of some macros in a few spots, but I'm not aware of
a cleaner alternative that still allows warnings to be enabled
in general, while suppressing a warning for known white-listed
instances.

Prior to the warning-tiggering function, place whichever one of
the following is needed to suppress the warning being encountered:

DISABLE_WARNING_UNREACHABLE_CODE
DISABLE_WARNING_CONDEXPR_IS_CONSTANT

After the warning-triggering function, place this:

RESTORE_WARNINGS

Under the hood, the compiler-appropriate warning-disabling
mechanics involve the use of C99 _Pragma, which can be used
in macros.

For unrecognized or inappropriate compilers, or if
DISABLE_WARNING_PRAGMAS is defined, the macros expand
to nothing.

4 years agounify code for extracting an object from a monster's inventory PR #455
nhmall [Mon, 1 Feb 2021 14:41:21 +0000 (09:41 -0500)]
unify code for extracting an object from a monster's inventory PR #455

Closes #455

4 years agoMerge branch 'copperwater-pr455-2' into NetHack-3.7
nhmall [Mon, 1 Feb 2021 14:40:11 +0000 (09:40 -0500)]
Merge branch 'copperwater-pr455-2' into NetHack-3.7

4 years agowording bit
nhmall [Mon, 1 Feb 2021 02:34:23 +0000 (21:34 -0500)]
wording bit

4 years agofixes37.0 catch up for macOS Xcode issue
nhmall [Mon, 1 Feb 2021 02:32:03 +0000 (21:32 -0500)]
fixes37.0 catch up for macOS Xcode issue

4 years agooutdated files in Xcode project
nhmall [Mon, 1 Feb 2021 02:18:48 +0000 (21:18 -0500)]
outdated files in Xcode project

4 years agoXcode project fix when NetHack source directory path contains spaces
nhmall [Mon, 1 Feb 2021 01:07:50 +0000 (20:07 -0500)]
Xcode project fix when NetHack source directory path contains spaces

Underlying shell scripts configued in the Xcode project were not
coded to accommodate spaces in the path

4 years agooutdated vs Unix 'make depend'
PatR [Sun, 31 Jan 2021 21:05:32 +0000 (13:05 -0800)]
outdated vs Unix 'make depend'

After the most recent round of moving old stuff to 'outdated',
src/windows.c contained two references to non-existent files.
That broke 'make depend'.  Updating it to turn those two into
comments seems risky because someone might add an include for
some new interface later in the file.  So comment them out in
the source instead.  Also, redo previous 'make depend' update
from about three weeks ago to do the same thing.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Sun, 31 Jan 2021 14:24:07 +0000 (09:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoFDECL and NDECL
nhmall [Sun, 31 Jan 2021 19:15:08 +0000 (14:15 -0500)]
FDECL and NDECL

4 years agofollow-up bit for QSORTCALLBACK entries
nhmall [Sun, 31 Jan 2021 19:06:56 +0000 (14:06 -0500)]
follow-up bit for QSORTCALLBACK entries

4 years agoCFDECLSPEC -> QSORTCALLBACK
nhmall [Sun, 31 Jan 2021 18:58:19 +0000 (13:58 -0500)]
CFDECLSPEC -> QSORTCALLBACK

also remove one inappropriate use of CFDECLSPEC

4 years agofollow-up to remove some remnant wingem.h references
nhmall [Sun, 31 Jan 2021 18:44:15 +0000 (13:44 -0500)]
follow-up to remove some remnant wingem.h references

this should correct the broken mingw tty build

4 years agoFDECL, NDECL in outdated
nhmall [Sun, 31 Jan 2021 18:40:15 +0000 (13:40 -0500)]
FDECL, NDECL in outdated

4 years agoFDECL and NDECL in sys/vms
nhmall [Sun, 31 Jan 2021 17:49:22 +0000 (12:49 -0500)]
FDECL and NDECL in sys/vms

4 years agoremnant FDECL
nhmall [Sun, 31 Jan 2021 14:20:25 +0000 (09:20 -0500)]
remnant FDECL

4 years agorelocate some gem and Gnome files to outdated folder tree
nhmall [Sun, 31 Jan 2021 13:51:35 +0000 (08:51 -0500)]
relocate some gem and Gnome files to outdated folder tree

4 years agoremove Amiga cross-compile bits
nhmall [Sun, 31 Jan 2021 12:57:28 +0000 (07:57 -0500)]
remove Amiga cross-compile bits

4 years agoRemove awful kludges dealing with command counts.
Bart House [Sun, 31 Jan 2021 03:06:27 +0000 (19:06 -0800)]
Remove awful kludges dealing with command counts.

4 years agofix #K3257 - lichens' sticky attack holds hero
PatR [Sun, 31 Jan 2021 01:19:17 +0000 (17:19 -0800)]
fix #K3257 - lichens' sticky attack holds hero

in the air.  can_reach_floor() was changed relatively recently
to return False if hero was held by a monster.  It wasn't
necessarily because the monster was lifting him or her off the
floor though.  Restricted movement could produce same effect.

Change the new behavior to only happen when holder has used a
hug attack, so that being held by a fungus or mimic doesn't
prevent access to the floor.

This may need to be revisited because the idea that the hero's
arms have been pinned by a hugging monster contradicts the
ability to attack that monster.  However, it matches the long-
standing inability to attack any other adjacent monster in
that circumstance.

4 years agosqueaky board message grammar bit
PatR [Sun, 31 Jan 2021 00:42:36 +0000 (16:42 -0800)]
squeaky board message grammar bit

"You hear a [BCDG] note squeak in the distance" is ok, but
"you hear a [AEF] note squeak in the distance" isn't.

Squeaky board notes already had correct a/an handling but that
particular message explicitly suppressed it.

4 years agoMerge branch 'extract-from-minvent' of https://github.com/copperwater/NetHack into...
nhmall [Sat, 30 Jan 2021 20:24:07 +0000 (15:24 -0500)]
Merge branch 'extract-from-minvent' of https://github.com/copperwater/NetHack into copperwater-pr455-2

4 years agoanother doc/options.doc update
nhmall [Sat, 30 Jan 2021 17:28:23 +0000 (12:28 -0500)]
another doc/options.doc update

4 years agodoc/options.doc update
nhmall [Sat, 30 Jan 2021 17:18:49 +0000 (12:18 -0500)]
doc/options.doc update

4 years agoMove the other options to alphabetical order
Pasi Kallinen [Sat, 30 Jan 2021 17:07:58 +0000 (19:07 +0200)]
Move the other options to alphabetical order

4 years agoMove other options into the options array
Pasi Kallinen [Sat, 30 Jan 2021 16:02:48 +0000 (18:02 +0200)]
Move other options into the options array

4 years agoremove an old #pragma from sp_lev.c that isn't actually accomplishing anything
nhmall [Sat, 30 Jan 2021 16:25:27 +0000 (11:25 -0500)]
remove an old #pragma from sp_lev.c that isn't actually accomplishing anything

4 years agoDisable warning for LUA files in Visual Studio builds.
Bart House [Sat, 30 Jan 2021 04:49:37 +0000 (20:49 -0800)]
Disable warning for LUA files in Visual Studio builds.

4 years agoa couple of curses warnings on one compiler
nhmall [Sat, 30 Jan 2021 04:14:16 +0000 (23:14 -0500)]
a couple of curses warnings on one compiler

4 years agoFixing azure pipeline build to use correct project.
Bart House [Sat, 30 Jan 2021 00:56:05 +0000 (16:56 -0800)]
Fixing azure pipeline build to use correct project.

4 years agoUnify code for extracting an object from a monster's inventory
copperwater [Sun, 24 Jan 2021 21:39:33 +0000 (16:39 -0500)]
Unify code for extracting an object from a monster's inventory

The code for doing this (basically an obj_extract_self() call plus
handling if the object was worn or wielded) was duplicated all over, and
inconsistent - for instance, though all of them updated the monster's
misc_worn_check to indicate it was no longer wearing something in
whatever slot, only one call also set the bit that flags the monster to
consider putting on other gear afterwards.

Under a new function, extract_from_minvent, all this extra handling is
checked in one function, which can simply replace the obj_extract_self
call.

A few callers (such as stealing) have some common code *after* the
object is extracted and some other things happen such as message
printing, such as calling mselftouch if the object was worn
gloves. extract_from_minvent does not handle these cases.

4 years agoextcmdlist[] bit
PatR [Fri, 29 Jan 2021 20:33:20 +0000 (12:33 -0800)]
extcmdlist[] bit

4 years agoazure-pipelines overrode a recent gcc change in the cross-compile
nhmall [Fri, 29 Jan 2021 19:29:38 +0000 (14:29 -0500)]
azure-pipelines overrode a recent gcc change in the cross-compile

this makes it match, but doesn't fix the stray

4 years agoextcmdlist[] formatting
PatR [Fri, 29 Jan 2021 18:48:35 +0000 (10:48 -0800)]
extcmdlist[] formatting

Reformat the list of commands, making all of them take two lines
(except for a couple that need more) even if they fit on one.

Put "#wizmgender" into alphabetical order.  I don't think we need
it anymore, but if we keep the functionality then it should be
demoted from a command to a wizard mode boolean option.

Also wrap a handful of lines wider than the formatting threshold.

4 years agodeal with some win/win32 warnings
nhmall [Fri, 29 Jan 2021 18:00:00 +0000 (13:00 -0500)]
deal with some win/win32 warnings

win/win32/mhdlg.c(137)   : warning C4456: declaration of 'wbuf' hides
                           previous local declaration
win/win32/mhdlg.c(62)    : note: see declaration of 'wbuf'
win/win32/mhdlg.c(875)   : warning C4189: 'gender': local variable is
                           initialized but not referenced
win/win32/mhdlg.c(874)   : warning C4189: 'race': local variable is
                           initialized but not referenced
win/win32/mhdlg.c(876)   : warning C4189: 'alignment': local variable is
                           initialized but not referenced
win/win32/mhdlg.c(873)   : warning C4189: 'role': local variable is
                           initialized but not referenced
win/win32/mhinput.h(24)  : warning C4201: nonstandard extension used:
                           nameless struct/union
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhinput.h(24)  : warning C4201: nonstandard extension used:
                           nameless struct/union
win/win32/mhinput.h(24)  : warning C4201: nonstandard extension used:
                           nameless struct/union
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhmenu.c(62)   : warning C4201: nonstandard extension used:
                           nameless struct/union
win/win32/mhmenu.c(1082) : warning C4456: declaration of 'monitorScale'
                           hides previous local declaration
win/win32/mhmenu.c(995)  : note: see declaration of 'monitorScale'
win/win32/mhmenu.c(1142) : warning C4456: declaration of 'wbuf' hides
                           previous local declaration
win/win32/mhmenu.c(986)  : note: see declaration of 'wbuf'
win/win32/mhmenu.c(1082) : warning C4189: 'monitorScale': local variable
                           is initialized but not referenced
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhmsgwnd.c(700): warning C4701: potentially uninitialized
                           local variable 'size' used
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhsplash.c(158): warning C4189: 'verstrsize': local variable
                           is initialized but not referenced
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhstatus.c(353): warning C4057: 'function':
                           'const unsigned char *' differs in indirection
                           to slightly different base types from 'const char *'
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/mhmsg.h(70)    : warning C4200: nonstandard extension used:
                           zero-sized array in struct/union
win/win32/NetHackW.c(181): warning C4456: declaration of 'buf' hides
                           previous local declaration
win/win32/NetHackW.c(90) : note: see declaration of 'buf'
win/win32/NetHackW.c(189): warning C4456: declaration of 'buf' hides
                           previous local declaration
win/win32/NetHackW.c(90) : note: see declaration of 'buf'

4 years agoAdd missing fields in shown_stats[] in winstat.c
Dean Luick [Fri, 29 Jan 2021 16:19:27 +0000 (10:19 -0600)]
Add missing fields in shown_stats[] in winstat.c

This eliminates a compiler initializer warning.

4 years agoAdd missing fields in extcmdlist[] in cmd.c
Dean Luick [Fri, 29 Jan 2021 15:58:16 +0000 (09:58 -0600)]
Add missing fields in extcmdlist[] in cmd.c

This eliminates a compiler initializer warning.

4 years agoFix align type mixup wth align mask
Dean Luick [Sun, 17 Jan 2021 20:25:08 +0000 (14:25 -0600)]
Fix align type mixup wth align mask

Fix two cases of missed conversion of an alignment to an align mask.

Change induced_align()'s return type to unsigned int since it returns
an align mask (unsigned), not an align type (signed).

4 years agoUpdate code style for ANSI function prototypes
Dean Luick [Fri, 29 Jan 2021 15:01:15 +0000 (09:01 -0600)]
Update code style for ANSI function prototypes

4 years agoFix X11 warnings
Dean Luick [Mon, 18 Jan 2021 00:17:13 +0000 (18:17 -0600)]
Fix X11 warnings

4 years agoFix set but not used warnings
Dean Luick [Fri, 29 Jan 2021 03:09:28 +0000 (21:09 -0600)]
Fix set but not used warnings

4 years agofix class discovery for fully discovered class
PatR [Fri, 29 Jan 2021 01:10:18 +0000 (17:10 -0800)]
fix class discovery for fully discovered class

This was caused by a post-3.6 change I made when adding sorting
capability to '`' (and to '\' but that wasn't affected).  Cited
case was lack of "water" when all potions had been discovered.
Some other classes (but not all) were vulnerable too.

4 years agofix #K3255 - "death wand"
PatR [Fri, 29 Jan 2021 01:00:13 +0000 (17:00 -0800)]
fix #K3255 - "death wand"

Prevent a wish request of "death wand" (as alternate spelling
for "wand of death") from matching "Death" monster and yielding
a random wand.

"death finger" and "death finger spellbook" produce a "spellbook
of finger of death" even without a similar fix.

4 years agofix some warnings seen by Microsoft Visual Studio compiler
nhmall [Thu, 28 Jan 2021 14:45:16 +0000 (09:45 -0500)]
fix some warnings seen by Microsoft Visual Studio compiler

../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'x1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'x' used
../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'y1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'y' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'x2' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'y2' used

4 years agoupdate msdos djgpp cross-compiler gcc version
nhmall [Thu, 28 Jan 2021 13:02:45 +0000 (08:02 -0500)]
update msdos djgpp cross-compiler gcc version

4 years agoremove more FDECL, NDECL macro usage
nhmall [Thu, 28 Jan 2021 12:55:34 +0000 (07:55 -0500)]
remove more FDECL, NDECL macro usage

4 years agoRemove leftover variables
Pasi Kallinen [Thu, 28 Jan 2021 10:44:45 +0000 (12:44 +0200)]
Remove leftover variables

4 years agoWindows Makefile.msc update
nhmall [Thu, 28 Jan 2021 04:07:52 +0000 (23:07 -0500)]
Windows Makefile.msc update

4 years agoa couple of old-style function declarations in Windows code
nhmall [Thu, 28 Jan 2021 02:52:55 +0000 (21:52 -0500)]
a couple of old-style function declarations in Windows code

4 years agofollow-up bits
nhmall [Thu, 28 Jan 2021 02:04:51 +0000 (21:04 -0500)]
follow-up bits

4 years agoswitch source tree from k&r to c99
nhmall [Wed, 27 Jan 2021 02:06:16 +0000 (21:06 -0500)]
switch source tree from k&r to c99

4 years agoX11 fancy status coloring cleanup
PatR [Tue, 26 Jan 2021 21:54:43 +0000 (13:54 -0800)]
X11 fancy status coloring cleanup

Fix a couple of warnings and do some reformatting.

Also tracks current color and attributes for each status field
and only updates them if they're being changed instead of every
time the value changes.  Not very thoroughly tested so far.

The only attribute being supported is inverse but tty-style
status supports the full set.  Also, changed values are always
highlighted in inverse even if there is no highlight rule.
That should probably only apply when 'statushilites' is 0,
giving the old fancy status highlighting when regular hilites
are turned off.

4 years agopull request #443 - X11 color status highlighting
PatR [Tue, 26 Jan 2021 21:39:50 +0000 (13:39 -0800)]
pull request #443 - X11 color status highlighting

for 'fancy status'.  This is from an emailed diff rather than
directly from git, and the git code has a bunch of commits,
so this may or may not match the latest.  It needs formatting
cleanup and triggers a couple of warnings on OSX.  Fix to follow.

Status highlight colors use the same names as menu coloring
but this uses different X11 colors for the two sets.  That
will have to be changed so that yellow either means yellow all
the time or goldenrod all the time instead of sometimes yellow
and sometimes goldenrod.

Adopts #443

4 years agoX11 warning on macOS
nhmall [Tue, 26 Jan 2021 15:27:51 +0000 (10:27 -0500)]
X11 warning on macOS

4 years agofix warning differently mklev.c
nhmall [Tue, 26 Jan 2021 13:48:38 +0000 (08:48 -0500)]
fix warning differently mklev.c

4 years agoclear five warnings for "set but not used" variables
nhmall [Mon, 25 Jan 2021 17:57:47 +0000 (12:57 -0500)]
clear five warnings for "set but not used" variables

Note: the line numbers referenced in the warning messages below are not in sync
with the NetHack-3.7 branch and should be disregarded

files.c: In function 'get_saved_games':
files.c:1168:9: warning: unused variable 'n' [-Wunused-variable]
 1168 |     int n, j = 0;
      |         ^

mhitm.c: In function 'mdamagem':
mhitm.c:843:13: warning: variable 'cancelled' set but not used [-Wunused-but-set-variable]
  843 |     boolean cancelled;
      |             ^~~~~~~~~

mhitu.c: In function 'hitmu':
mhitu.c:943:9: warning: variable 'uncancelled' set but not used [-Wunused-but-set-variable]
  943 |     int uncancelled;
      |         ^~~~~~~~~~~

mklev.c: In function 'place_branch':
mklev.c:1214:20: warning: variable 'br_room' set but not used [-Wunused-but-set-variable]
 1214 |     struct mkroom *br_room;
      |                    ^~~~~~~

monmove.c: In function 'm_move':
monmove.c:874:43: warning: variable 'doorbuster' set but not used [-Wunused-but-set-variable]
  874 |     boolean can_open = 0, can_unlock = 0, doorbuster = 0;
      |                                           ^~~~~~~~~~

4 years ago\#wizintrinsic timeout values
PatR [Sun, 24 Jan 2021 21:55:19 +0000 (13:55 -0800)]
\#wizintrinsic timeout values

Tell/remind wizard mode player how to specify timeout amounts
when using #wizintrinsic to set temporary timeouts.

4 years agofix github issue #447 - casting area-effect spell
PatR [Sun, 24 Jan 2021 21:00:44 +0000 (13:00 -0800)]
fix github issue #447 - casting area-effect spell

at self when blind.  Spell targetting would let player pick
hero's own spot but casting would reject it when blind because
hero didn't sense any monster there.  The player wanted to cast
skilled fireball at self to cure being turned into slime but
wasn't allowed.  (Targetting an adjacent spot would work for
fireball, but is only feasible when telepathy reveals a monster
there.)

While testing the one-line fix, I noticed that the message line
(tty) showed stale data (autodescribe info for target spot) as
the fireball I cast (when not blind) bounced around the vicinity.
Normally that's cleared when a message is issued or the when the
next command is requested, but skilled fireball causes multiple
explosion animations before either of those situations.

4 years agooptions parsing one more time
PatR [Sun, 24 Jan 2021 02:46:03 +0000 (18:46 -0800)]
options parsing one more time

Manually created and maintained prototypes for optfn_FOO()
aren't needed once the conditionals in optlist.h and options.c
match each other.

4 years agocouple of missing Qt prototypes
PatR [Sat, 23 Jan 2021 23:58:23 +0000 (15:58 -0800)]
couple of missing Qt prototypes

Shut up two missing prototype warnings.

4 years agooptions parsing madness
PatR [Sat, 23 Jan 2021 23:42:00 +0000 (15:42 -0800)]
options parsing madness

I should have reenabled curses before committing an earlier change;
it broke compile.

Make all optfn_FOO() be static in options.c;
fix newly added prototype for optfn_cursesgraphics();
fix conditionals for optfn_palette(), both prototype and function.

Also, add missing prototype for a sound routine.

4 years agoSELECTSAVED handling
PatR [Sat, 23 Jan 2021 23:02:11 +0000 (15:02 -0800)]
SELECTSAVED handling

By default, enable the SELECTSAVED option for everyone instead
of just for Windows or Qt.  And make Qt obey the 'selectsaved'
run-time option.

It can be disabled in config.h if necessary.

4 years agocursesgraphics
PatR [Sat, 23 Jan 2021 22:58:28 +0000 (14:58 -0800)]
cursesgraphics

Not sure whether it was because I hadn't build without curses
in a long time or because of recent changes in warning settings
in the hints, but optfn_cursesgraphics() first drew a complaint
about lack of prototype, then after I added one and made it be
static, about a static routine not being used.

4 years agoNetHackW: fix rendering of animations
Bart House [Sat, 23 Jan 2021 20:04:16 +0000 (12:04 -0800)]
NetHackW: fix rendering of animations

Animations render by changing map state and calling delay.  When we delay,
we must ensure map windoow has been updated to show latest state before
we delay.

4 years agoNetHackW: fix focus flashing when using far look
Bart House [Sat, 23 Jan 2021 19:44:35 +0000 (11:44 -0800)]
NetHackW: fix focus flashing when using far look

Changed when we update the map window back buffer.  We now defer all
back buffer renderig until mswin_map_update is called.  We update
the window only within the main message loop thus we should only
get fully coherent map state rendered prior to getting input.

4 years agofix missing prototype warning for Qt SELECTSAVED
nhmall [Sat, 23 Jan 2021 14:37:47 +0000 (09:37 -0500)]
fix missing prototype warning for Qt SELECTSAVED

For whatever reason, Qt relies on late #define of SELECTSAVED
inside files.c.

The prototype in extern.h is therefore not picked up with
as a result of #include "hack.h"

Options were:
1. remove the conditional #if defined(SELECTSAVED) around the
   prototype in extern.h entirely
2. Move the forced #define of SELECTSAVED above the #include "hack.h"
3. Alter the conditional in extern.h to also include the condition for
   the forced #define of SELECTSAVED inside files.c

This goes with option #3.

4 years agofix warning in restore.c
nhmall [Sat, 23 Jan 2021 14:15:15 +0000 (09:15 -0500)]
fix warning in restore.c

restore.c:909:1: warning: no previous prototype for ‘rest_stairs’ [-Wmissing-prototypes]
  909 | rest_stairs(nhfp)
      | ^~~~~~~~~~~

4 years agofix warning in invent.c
nhmall [Sat, 23 Jan 2021 14:07:33 +0000 (09:07 -0500)]
fix warning in invent.c

invent.c:1459:1: warning: no previous prototype for ‘mime_action’ [-Wmissing-prototypes]
 1459 | mime_action(word)
      | ^~~~~~~~~~~

4 years agounused variable in files.c
nhmall [Sat, 23 Jan 2021 13:58:59 +0000 (08:58 -0500)]
unused variable in files.c

4 years agofix a warning in display.c
nhmall [Sat, 23 Jan 2021 13:49:04 +0000 (08:49 -0500)]
fix a warning in display.c

display.c: In function ‘redraw_map’:
display.c:1460:15: warning: variable ‘glyph’ set but not used [-Wunused-but-set-variable]
 1460 |     int x, y, glyph;
      |               ^~~~~

4 years agoRemove unused function
Pasi Kallinen [Sat, 23 Jan 2021 13:19:34 +0000 (15:19 +0200)]
Remove unused function

4 years agoFix leftover variables from trap refactor
Pasi Kallinen [Sat, 23 Jan 2021 09:32:54 +0000 (11:32 +0200)]
Fix leftover variables from trap refactor

4 years agoFix article used for steed when stepping on trap
Pasi Kallinen [Sat, 23 Jan 2021 09:25:50 +0000 (11:25 +0200)]
Fix article used for steed when stepping on trap

This was caused by the trap code refactor I did a month ago.

4 years agoFix missing proto
Pasi Kallinen [Sat, 23 Jan 2021 08:56:56 +0000 (10:56 +0200)]
Fix missing proto

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Fri, 22 Jan 2021 21:52:55 +0000 (16:52 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 22 Jan 2021 21:24:07 +0000 (16:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files