Commit Graph

11741 Commits

Author SHA1 Message Date
nhmall
102007d7cf visual studio project update; also recover.c 2021-02-01 13:24:14 -05:00
nhmall
32c417d788 Windows nmake build warnings during compiles of Lua sources 2021-02-01 13:03:32 -05:00
nhmall
a6631e3bb0 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.
2021-02-01 12:54:19 -05:00
nhmall
7445435a36 unify code for extracting an object from a monster's inventory PR #455
Closes #455
2021-02-01 09:41:21 -05:00
nhmall
0835ae1542 Merge branch 'copperwater-pr455-2' into NetHack-3.7 2021-02-01 09:40:11 -05:00
nhmall
e7d2ecb85d wording bit 2021-01-31 21:34:23 -05:00
nhmall
1bf122ff1d fixes37.0 catch up for macOS Xcode issue 2021-01-31 21:32:03 -05:00
nhmall
113ee039e7 outdated files in Xcode project 2021-01-31 21:18:48 -05:00
nhmall
5c3582d27a 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
2021-01-31 20:07:50 -05:00
PatR
0b1f5ea45e 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.
2021-01-31 13:05:32 -08:00
nhw_cron
28f89ae3b2 This is cron-daily v1-Jan-20-2020. files updated: Files 2021-01-31 14:19:40 -05:00
nhmall
e53fcf0940 FDECL and NDECL 2021-01-31 14:15:08 -05:00
nhmall
5ec6a3f341 follow-up bit for QSORTCALLBACK entries 2021-01-31 14:06:56 -05:00
nhmall
41fc278cfb CFDECLSPEC -> QSORTCALLBACK
also remove one inappropriate use of CFDECLSPEC
2021-01-31 13:58:19 -05:00
nhmall
322293993f follow-up to remove some remnant wingem.h references
this should correct the broken mingw tty build
2021-01-31 13:44:15 -05:00
nhmall
979571e09e FDECL, NDECL in outdated 2021-01-31 13:40:15 -05:00
nhmall
b851b28cbe FDECL and NDECL in sys/vms 2021-01-31 12:49:22 -05:00
nhmall
fadc5f8a5e remnant FDECL 2021-01-31 09:20:25 -05:00
nhmall
4a6eb00c84 relocate some gem and Gnome files to outdated folder tree 2021-01-31 08:51:35 -05:00
nhmall
e2a3368837 remove Amiga cross-compile bits 2021-01-31 07:57:28 -05:00
Bart House
a54a8c6854 Remove awful kludges dealing with command counts. 2021-01-30 19:06:27 -08:00
PatR
38e69519d1 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.
2021-01-30 17:19:17 -08:00
PatR
aacea63f7c 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.
2021-01-30 16:42:36 -08:00
nhmall
a0874c414d Merge branch 'extract-from-minvent' of https://github.com/copperwater/NetHack into copperwater-pr455-2 2021-01-30 15:24:07 -05:00
nhmall
143a7b3a06 another doc/options.doc update 2021-01-30 12:28:23 -05:00
nhmall
513bf63300 doc/options.doc update 2021-01-30 12:18:49 -05:00
Pasi Kallinen
933c7f215c Move the other options to alphabetical order 2021-01-30 19:07:58 +02:00
Pasi Kallinen
10cd5af500 Move other options into the options array 2021-01-30 18:43:21 +02:00
nhmall
5e5df4f6b9 remove an old #pragma from sp_lev.c that isn't actually accomplishing anything 2021-01-30 11:25:27 -05:00
Bart House
9862e19a36 Disable warning for LUA files in Visual Studio builds. 2021-01-29 20:49:37 -08:00
nhmall
262f0d11b5 a couple of curses warnings on one compiler 2021-01-29 23:14:16 -05:00
Bart House
a2d76d09b2 Fixing azure pipeline build to use correct project. 2021-01-29 16:56:05 -08:00
copperwater
ee7664684a 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.
2021-01-29 19:19:03 -05:00
PatR
e8d44b8329 extcmdlist[] bit 2021-01-29 12:33:20 -08:00
nhmall
7b357463d3 azure-pipelines overrode a recent gcc change in the cross-compile
this makes it match, but doesn't fix the stray
2021-01-29 14:29:38 -05:00
PatR
30ab63165f 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.
2021-01-29 10:48:35 -08:00
nhmall
ca1f7c88d4 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'
2021-01-29 13:00:00 -05:00
Dean Luick
7a07125ca3 Add missing fields in shown_stats[] in winstat.c
This eliminates a compiler initializer warning.
2021-01-29 11:44:39 -06:00
Dean Luick
3da8dca836 Add missing fields in extcmdlist[] in cmd.c
This eliminates a compiler initializer warning.
2021-01-29 11:41:12 -06:00
Dean Luick
2f4f7d22d3 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).
2021-01-29 09:31:08 -06:00
Dean Luick
2c38749cab Update code style for ANSI function prototypes 2021-01-29 09:01:15 -06:00
Dean Luick
cf3ad240ac Fix X11 warnings 2021-01-28 21:12:06 -06:00
Dean Luick
8ddab09cab Fix set but not used warnings 2021-01-28 21:11:21 -06:00
PatR
407acbf987 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.
2021-01-28 17:10:18 -08:00
PatR
41956e5798 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.
2021-01-28 17:00:13 -08:00
nhmall
5bd95649de 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
2021-01-28 09:45:16 -05:00
nhmall
0714ddcef8 update msdos djgpp cross-compiler gcc version 2021-01-28 08:02:45 -05:00
nhmall
f625a8c553 remove more FDECL, NDECL macro usage 2021-01-28 07:55:34 -05:00
Pasi Kallinen
b502a7d9b2 Remove leftover variables 2021-01-28 12:44:45 +02:00
nhmall
0b518d0cee Windows Makefile.msc update 2021-01-27 23:07:52 -05:00