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.
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.
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.
"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.
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.
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.
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).
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.
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.
../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