Fix the situation where disabling PANICTRACE, which happened implicitly
when BETA got disabled, caused SYSCF option processing to complain and
quit if the 'sysconf' file contained any PANICTRACE settings.
Now accept all the PANICTRACE options (assuming SYSCF is defined) even
if PANICTRACE is not defined. Their values are recorded in the 'sysopt'
struct, but only validated when the appropriate macros (PANICTRACE,
PANICTRACE_LIB) are defined.
Change
|Bad option line: "foo
|"
to
|Bad option line: "foo"
by stripping away the input line's newline before processing it.
(This doesn't address the PANICTRACE options processing issue.)
With DEBUG suppressed, I started getting
16 warning: empty body in an if-statement
and 2 warning: empty body in an else-statement
from gcc.
Using braces for an empty block instead of just ';' avoids the warning:
if (foo)
debugpline("foo");
is bad,
if (bar) {
debugpline("bar");
}
is good. ;-)
The changes to lint.h are just precautionary.
modified:
include/lint.h
src/attrib.c, bones.c, dbridge.c, dig.c, eat.c,
makemon.c, mkmaze.c, mon.c, sp_lev.c
Shorten a function name in sp_lev.c that exceeded 31 characters.
That's a limit imposed by the VMS linker and the compiler complains
that it will be truncated.
Make all sp_lev.c functions which aren't listed in extern.h be static
and give all of them a declaration at the top of the file. I reordered
the ones already declared there in the same order as they occur in the
source, so the diff is quite a bit bigger than the actual changes.
(Once the one with the long name became static, the length of its name
no longer mattered, but I've shortened it anyway.)
Indent a couple of #pragma directives. Some pre-ANSI compiler didn't
like '#' in column 1 followed by something it didn't understand, even
when that occurred in a conditional block which was in the midst of
being excluded. (util/*_comp.y recently reminded me of that. files.c
should get a fix like this too.)
This could use a bit of reformatting. I stripped off trailing spaces
from a handful of lines but otherwise have kept it as is since the
formatting issue is minor.
Another issue from old beta-tester mail: #annotate and #overview were
missing from the list of extended commands. M-A and M-O were listed
but marked "(if supported)" even though they've become unconditional.
Same for M-R, although in its case #ride wasn't missing.
Some old beta-tester mail suggested mentioning the implicit_uncursed
option in the "Curses and Blessings" section; this patch does that.
It also mentions that option in the "Configuring Menu Colors" section
since anyone trying to specify a color for " uncursed " will want
objects to be explicitly described as "uncursed".
The changes to the LaTeX version haven't been tested. The generated
plain text version has a lot of spurious changes due to the padding
method it uses to right-justify short lines.
Reported by a beta tester months ago: it was possible to recognize
your god's temple on the Astral Plane by stepping into its doorway,
since #overview would show "temple of <your god>" (only if just one
temple had been entered and the altar in it was the only one you'd
seen and it was for your own god; #overview doesn't show "temple of
<other god>", just "a temple"). After this fix it will just show
"a temple" even when you can see the temple's altar, so #overview
can't be used as a shortcut to finding the right temple.
While testing the fix I discovered that amnesia wasn't handled when
forgetting the current level's map, only when other levels got
flagged as forgotten. The number of altars, fountains, and so on
are recalculated when #overview is executed, so current-level amnesia
worked for those. But data about known rooms is not recalculated,
so the number of temples and shops you'd visited on the level stayed
instead of being forgotten. The fix is a bit iffy for the case where
you only forget random spots scattered across the level's map rather
than the whole thing; this just wipes #overview memory of every room
even if parts of rooms are still remembered.
Change the 'make' rules for *_lex.c, *_yacc.c, and *_comp.h to put
the end files names into whatever #line directives that refer to
the generated names (lex.yy.c, y.tab.c, y.tab.h). This should not
produce any change in behavior during compilation except to provide
more accurate specifications of where any warnings or errors occur.
Add a 'make dist' target that copies generated scanner and parser
files to sys/share. (As mentioned in the previous patch, I haven't
committed any of those since I have different versions of flex and
also of bison.)
Bump the number of nodes (%e) specified in lev_comp.l so that the lex
on Solaris doesn't choke. flex doesn't use those paramters (%e, %p,
and a few others), so this change gets accepted but hasn't been
adequately tested to verify that it solves the problem.
Reformat some of the C code at the end of dgn_comp.l and lev_comp.l;
going through the whole thing isn't worth the effort, particularly
since flex generates such a mess in the rest of the code it produces.
I haven't updated sys/share/*_lex.c and they definitely need it now.
I've got an older version of flex than the one that was used on the
code that's there now, and the most recent version. Both of those
produce different code--the stuff that's there now has been through
more testing so whatever version was used for it ought to be used for
new editions.
How that there's nothing left to trigger it, put in some extra quest
messge debugging code. Could be useful if new roles are added or if
any deliver-by-pline messages get changed to be deliver-by-window.
The samurai ones leave something to be desired since they make no
attempt to include Japanese terminology or to make sure the tone stays
appropriate to a samurai's honor.
Another bit prompted by vibrating square testing:
|You see a strange vibration beneath the little dog's rear claws.
Fix up some body parts: dog, cat, and yeti-class (includes sasquatch,
monkey and ape, owlbear) already have "paws" instead of "fore claws".
Take away all 'Y' except owlbear from that list and add rodents to it.
Give them "rear paws" instead of "rear claws" for their feet; for legs,
use "foreleg" instead of "forelimb" and "read leg" instead of "rear limb".
For yeti/sasquatch/monkey/ape/carnivorous-ape, switch from paws to hands
since they have opposable thumbs, and switch to arm, leg, foot instead
of forelimb, rear limb, and rear claw. I've left "fore claw" for finger.
Noticed while testing the look-at vs vibrating square patch: I was
able to cover stairs with a trap via wizard mode wish. That wish can
achieve a lot of irregular things, but prevent this particular one.
When examining a trap with '/' or ';', show
|a trap (arrow trap)
instead of
|a trap or a vibrating square (arrow trap)
outside of Gehennom (unless the trap actually is a vibrating square,
which could happen via wizard mode wish). The extra verbosity is
distracting, and limiting mention of the vibrating square to the region
where it's relevant may give a hint to players getting that far for the
first time.
Preformat SYSCF entry 'WIZARDS' so that it can be displayed during panic
feedback without allocating memory for the formatted list at that time.
It also gets displayed for help's "support information" ('?k').
For panic(), push "it may be possible to rebuild" to a second line since
the formatted usernames might make the line long.
Mark panic() as never returning so that code analysis might be able
to do a smarter job. It required splitting done() into two routines
since the first part really can return (but not if PANICKED was the
reason it got called). done() is now much shorter and ends with a
call to new really_done(), and panic() skips done()'s might-return
part by calling really_done() directly.
Noticed in passing: the "report error to <list of SYSCF WIZARDS>"
code calls a routine which uses alloc(), which won't work very well
if the reason for panic was because malloc() ran out of memory.
On OSX 10.5, save file compression and uncompression fail when I run
under debugger control (for gdb, at least; I don't know why). I used
'#panic' to try something out. panic() calls exit_nhwindows(), then
after some messages calls dosave0(). Saving calls docompress_file()
and when that fails on tty it tries to call clear_nhwindow(WIN_MESSAGE)
but WIN_MESSAGE has been torn down already, leading to a nested panic().
Avoid the call to clear_nhwindow() if windows aren't up.
In the midst of composing a commit message about how I reorganized some
of genl_putmixed()'s code without finding any problem, I realized that
there was a problem. The character immediately after \G12345678 would
be copied directly to the output buffer without examination. If that
was the leading backslash for a second encoded sequence, the G and the
hex digits would follow their backslash as just ordinary chars, which
is not what's intended. Or if instead of a backslash the next character
was the input's terminating '\0', the latter would be copied into the
output and the pointer to the input string would be incremented, then
the next loop iteraction would examined whatever followed. If valgrind
is smart enough--and it seems to be--it would complain about accessing
a character that putmixed()'s caller hadn't initialized.
The only use of putmixed() I'm sure about is the what-is code showing
a screen symbol with its explanation, which doesn't exercise either
\G12345678\G12345678 or \G12345678\0. I didn't go hunting to see if
there was someplace that might have an encoded symbol at the end of the
string. what-is still works after this patch....
The only substantive change is adding ``continue'' but I haven't gone
back and undone the reorg that preceded it.