For make install or update, dlb.o was being recompiled unnecessarily
when building util/dlb because the dependency in Makefile.utl listed
hack.h instead of config.h for it. Then attempting to run nethack
under debugger control could cause debugger complaints about dlb.o
being newer than nethack.
Updated for unix and vms.
Setting CHECK_PLNAME to 1 makes WIZARDS, EXPLORERS, and SHELLERS
check the player name instead of the user's login name.
This is mostly useful for public servers which have external
login system and don't create user accounts for players.
I just tried to build with MONITOR_HEAP defined in unixconf.h plus
WANT_WIN_X11=1 for make. tile2x11 wouldn't link. It doesn't use
alloc() and free(), but it does link with drawing.o, and drawing.o
has calls to free(), so MONITOR_HEAP makes it need nhfree() from
alloc.o.
All the miscellaneous tile utilities seem to link with drawing.o, so
they all need alloc.o too, and that drags in util/panic.o as well.
I've only changed it for Unix where I can actually test the change
but other platforms probably should do this too. Or we need to redo
drawing.c so that the small subset of stuff utilities want is
separate from the code the core uses for that same stuff.
Since the attempted fix for the warning about has_color() being
implicitly declared introduced a worse problem of conflicting
declaration in cases where it's already declared, back that change
out.
Increase the lex paramaters in lev_comp.l and replace use of snprintf
with sprintf in lev_comp.y and lev_main.c.
Also some reformatting for lev_comp.y, but I gave up pretty quickly:
some early tab replacement and adjusting of the spacing for casts.
Changes to be committed:
modified: src/files.c
modified: sys/share/pcmain.c
Related to #H4170, bz274
The current startup code seeks out the SYSCONFPREFIX using:
envp = nh_getenv("COMMONPROGRAMFILES");
which is fine and usually translates to something like
"C:\\Program Files (x86)\\Common Files\\
NetHack then tacks on the NetHack subfolder to the path
"C:\\Program Files (x86)\\Common Files\\NetHack\\"
That should always be the definitive location.
However, in the event that there is no SYSCF_FILE actually
located at that system-wide spot (and ONLY in that event),
fall back to a secondary location of HACKDIR for locating
the SYSCF_FILE.
Also, there's some explicit tweaking added for the Microsoft
visual studio compiler debug execution to all a debug
session to correctly locate things. By default, on a
visual studio build, the executables are linked down in
subfolders of the build directory (Release, or Debug,
depending on visual studio build configuration options).
_M_UNIX (SCO UNIX) and __linux__ (all flavors of linux?) both call
has_colors() for TTY_GRAPHICS+TEXTCOLOR configuration, but neither
declared it. The new declaration is just a guess based on usage.
Changes to be committed:
modified: sys/share/pcmain.c
modified: sys/winnt/nttty.c
modified: sys/winnt/stubs.c
Bug 123 Report 4030:
Minor thing I've noticed - if I quit the game, at the "Hit <Enter> to end."
prompt, if I close the window rather than pressing Enter, I get the following:
Bug 138 - #H4045:
"nethack -s" leads to "-s is not supported for the Graphical Interface".
That's wrong.
(The Graphical Interface comes with "nethackw".)
I'm not sure whether basic formatting cleanup belongs in 3.6.1, but
there are also a couple of strings that got split and require the
implicit concatenation of adjacent string literals introduced with
C89/C90. The code itself compiles with pre-ANSI compilers, or at
least used to--most of it was developed with one....
Much of it is tabs in comments. But there was one substantive item:
an obsolete reference to "use 'Q' to Quit" after however many years....
This is important for public servers. Setting the MAXPLAYERS
sysconf value to 0 (or commenting it out) constructs the lock
files with the player UID and player name, so each player may
have one game at a time.
Some commented make variables for X11 misspelled 'pilemark.xbm' with
bad '.xbm' suffix.
'symbols' was handled strangely, but it still should have been working
during playground installation. This removes the strangeness but I have
no idea whether it solves #H4015 ('unable to access "symbols" file' for
the Mac OSX binary).
The HP C compiler for VMS issued a pair of diagnostics for both *_lex.c
files, about an expression of the form (unsigned_var <= 0) maybe not
being what was really intended, and it was right. Changing that to
'< 1' would have suppressed the diagnostic but left the bug, which was
in code that performed a subtraction and then checked for a negative
result. It worked in older flex versions when the variables were
signed, but got broken when they were changed to unsigned (no doubt in
respose to gcc complaining about comparing signed and unsigned in some
other spot where one of them was used).
The bug is in flex's original skeleton, so was inherited by our new
custom skeleton. I've fixed it in the custom skeleton, which means
that sys/share/*_lex.c became out of date even though util/*_comp.l
remain unchanged.
SYSCF is enabled by default, but nethack won't run without the required
sysconf file. sys/vms/install.com expects to find a template one in
sys/vms/sysconf so create that.
Since the tarball will need repackaging, fix a comment typo (dyslexic
spelling of "nymph") in sys/unix/sysconf. Also, move DEBUGFILES to the
bottom so that more useful entries move up. And expand the comment for
the PANICTRACE options.
Generated with flex 2.6.0 and a new custom skeleton for that version
(which almost certainly won't work with any older or newer version of
flex, but that limitation has no effect on the usefulness of the
generated scanner code).
Function definitions are oldstyle:
int foo(bar)
char *bar;
{...}
rather than ANSI, like nethack's core code. Advance declarations use
FDECL for prototypes, so should also fit nethack, although the usage
'FDECL(, (arglist))' makes me feel a bit uneasy. gcc doesn't mind the
omitted first argument but other compilers might not like it.
The system headers (stdlib.h and a few others) that flex has been
insisting on including are gone (with this skeleton). It starts out
including "config.h" and that header has the responsibility for any
definitions and declarations necessary. That shouldn't be a big deal
since config.h -> XXXconf.h -> system.h is what we're already relying
on for everything else, but it does need testing for any configuration
that uses sys/share/{dgn,lev}_{lex,yacc}.c.
I'll be checking the skeleton into the NHinternals repository after
adding some documentation, but I'm wondering whether it should really
become part of the source distribution.
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.
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.)
Changes to be committed:
modified: sys/winnt/Makefile.msc
I've noticed odd output from some of the echo statements
used in the Microsoft nmake Makefile before, but never
bothered to investigate why.
Pat observed that it was due to conversion of \t
in the path that resulted from expansion of the target
macro $@
This change uses the macro character substitution
feature to convert the back slashes to forward slashes
in the message, making the quirky conversion go away.