Commit Graph

7696 Commits

Author SHA1 Message Date
PatR
a7f64606d7 trap creation sanity check
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.
2015-11-25 14:56:58 -08:00
PatR
6f8ab3d9b2 look_at tweak
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.
2015-11-25 12:16:00 -08:00
Pasi Kallinen
d8d0e5b3bd More fixes entries 2015-11-25 13:01:34 +02:00
Pasi Kallinen
476db5b63a Update fixes to reflect multiple weakened farming strats 2015-11-25 12:55:56 +02:00
PatR
6c7889f3ee tribute: Making Money 2015-11-25 02:20:19 -08:00
Pasi Kallinen
943cc6057c More tiny formatting fixes, move function names to start of line 2015-11-25 10:15:41 +02:00
PatR
c8e83332fe quest message summaries: Priest and Ranger 2015-11-24 06:46:54 -08:00
Pasi Kallinen
d4578bbf23 More tiny formatting fixes 2015-11-24 12:04:52 +02:00
Pasi Kallinen
772fea0361 Prevent kraken farming
...or at least make it more inconvenient, by preventing fishy
creatures from revival by undead turning unless they're in a pool.
2015-11-24 11:35:50 +02:00
Pasi Kallinen
3a1e9ccd80 Fix infinite throne looting when confused
This could be used to generate monsters ad infinitum.
2015-11-24 11:16:07 +02:00
Pasi Kallinen
6ed4f24d24 Tiny formatting fix 2015-11-24 09:59:20 +02:00
PatR
74450ef1f5 overlay bit
Advance declaration of a function that's passed as a pointer to another
function.
2015-11-23 16:00:50 -08:00
Pasi Kallinen
c2c8259877 Add some hallu monsters 2015-11-23 14:10:10 +02:00
PatR
3edfcffccc SYSCF WIZARDS
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.
2015-11-22 17:23:11 -08:00
PatR
42f758b9b2 build warning 2015-11-22 17:21:44 -08:00
PatR
b30fce4f88 flag panic() and terminate() as "no return"
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.
2015-11-22 08:33:42 -08:00
PatR
f22c9c000a avoid panic save panic if external compress fails
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.
2015-11-22 08:26:12 -08:00
PatR
48745c8f67 valgrind vs genl_putmixed
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.
2015-11-21 23:01:43 -08:00
Pasi Kallinen
08b041f15f Pacify some clang compile warnings, pt 2 2015-11-21 23:50:11 +02:00
Pasi Kallinen
7063488621 Pacify some clang compile warnings 2015-11-21 23:40:06 +02:00
Pasi Kallinen
90302ce86d Declare a variable as static 2015-11-21 20:56:47 +02:00
Pasi Kallinen
70cfeb08d8 Remove useless variable 2015-11-21 20:51:46 +02:00
Pasi Kallinen
e1090de7b3 Declare missing function proto 2015-11-21 20:47:31 +02:00
Pasi Kallinen
579ceb35c1 Declare polearm range variables as static 2015-11-21 20:25:05 +02:00
PatR
9d76fe7b9c remove duplicate assignment
Introduced with some reformatting a couple of days ago, t1->uid is
    already given a value two lines above.
2015-11-21 06:52:29 -08:00
PatR
2e4e1adea3 fix more clang complaints
Fix some more of the complaints from clang's static analyzer.  The one
in options.c (manipulating warnings symbols) appears to be an actual bug.
All the rest are either because the analysis isn't quite sophicated
enough or outright bogus.

Two of them appear to be because a static routine is attempting to guard
against callers in the same file failing to pass in required output
pointers.  Stripping away the check for missing pointer should convince
the analyzer that those output parameters always receive a value.  We'll
see once the analysis is eventually re-run....
2015-11-21 00:25:50 -08:00
PatR
63dc6b3a31 lev_main cleanup
Use an alternate fix for the complaint from clang's static analyzer
(about potentially derefencing a null pointer, which can't happen
here because alloc() panics and quits rather than return Null), plus
some reformatting and removal of a chunk of unused code (strncmpi).

Also a formatting bit for lev_comp.y, making sys/share/lev_yacc.c
be out of date.  However, the generated code will be the same--except
for line numbers--so this shouldn't inhibit anybody's planned testing
waiting for the generated copy to be updated.
2015-11-20 18:58:48 -08:00
PatR
d3d332e606 valgrind trap complaint
I think this should fix one of the valgrind complaints.  Traps which
didn't use the trap->vl union field never initialized it, leaving a
bit of random garbage in the malloc'd trap structure.  (And traps
which overwrote existing ones that did use it didn't reinitialize it
so kept stale data around.)  Since those fields weren't in use by
the traps that don't care about them, this didn't provoke any actual
trouble.

Also reformatting....
2015-11-20 18:31:17 -08:00
Pasi Kallinen
9518e74c93 Fix segfault if lev_comp could not alloc memory for opcode 2015-11-20 12:27:46 +02:00
PatR
3dfc3200dd more warning suppression
This should avoid two of the three bogus clang complaints about
retaining the address of a stack variable after it has gone out of
scope.

Plus a recreation of some formatting I did a while back and then
accidentally clobbered before committing.
2015-11-20 02:00:31 -08:00
nhmall
d46a80b1c5 nmake Makefile updates 2015-11-19 23:12:20 -05:00
nhmall
ec0655d2df Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-11-19 22:45:29 -05:00
nhmall
93cd299b69 nmake output status messages
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.
2015-11-19 22:35:49 -05:00
PatR
a2a567737e warning suppression
Fix a couple of the clang static analyzer's warnings.

muse.c has some reformatting.  zap.c wasn't triggering any warning about
possible null pointer, but using MON_AT() to maybe avoid m_at() is not
a useful optimization since m_at() is a macro which starts out by using
MON_AT() itself.
2015-11-19 18:49:50 -08:00
nhmall
7d23420314 another typo 2015-11-19 19:36:14 -05:00
nhmall
a5000481a7 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-11-19 19:29:55 -05:00
nhmall
b6ce68865a typo fix and some elaboration
Changes to be committed:
	modified:   sys/winnt/Install.nt
2015-11-19 19:28:39 -05:00
PatR
b5a08bc729 built warning for STATUS_VIA_WINDOWPORT
This should fix one of the 64-bit warnings.  Make the conversion from
ptrdiff_t to int be explicit with a cast.
2015-11-19 16:18:12 -08:00
nhmall
43628124a4 Windows build updates 2015-11-19 18:57:17 -05:00
nhmall
889f600aa8 Windows x64 Makefile build work 2015-11-19 07:58:58 -05:00
nhmall
014856397b undo unintended default build architecture change
Changes to be committed:
	modified:   sys/winnt/Makefile.msc

Previous patch altered more than intended.
2015-11-18 23:12:39 -05:00
nhmall
d41e4d5ab4 Ensure VS2013 64-bit compiler drops to warning level -W3
This doesn't fix the cppregex.cpp issue. This just eliminates
about 10,000 warnings.
2015-11-18 22:41:30 -05:00
PatR
493027cbc8 sysconf update
Add missing 'sysconf' to sys/unix/ and sys/winnt/ sections of Files.

Update sys/unix/sysconf; I started out just to remove the duplicate
DEBUGFILES entry but ended up expanding several of the comments too.

Also, fix a typo in the vms build/install instructions.
2015-11-18 18:07:35 -08:00
Haoyang Wang
70aa7fe818 Merge branch 'master' into mac-build-tty-pkg 2015-11-18 13:23:35 -08:00
Pasi Kallinen
dc09a991fe Fix some warnings from clang's static code analyzer 2015-11-18 22:54:28 +02:00
PatR
5e5a78fdb2 X11 pilemark.xbm
Update the unix Makefiles and the older OSX hints files to handle the
pile marker tile overlay.  I didn't touch hints/macosx10.10 and .11
since I think there's still a merge for them pending.

A couple of formatting tweaks for bemain.c are included, for no
compelling reason.  What are the odds that anyone will every build
that again?
2015-11-18 03:04:35 -08:00
PatR
3583587f1c fix for pre-ANSI compilers
Declare a function pointer without requiring support for prototypes.
Plus a couple of formatting tidbits.
2015-11-18 00:45:03 -08:00
PatR
1fb9de1375 unix/Makefile.utl typo
Confusing build failure, explained by a typo in sys/unix/Makefile.utl.
dgn_lex.o didn't get rebuilt after modifying unixconf.h to take out
the #define MONITOR_HEAP I had in place, resulting in link failure for
dgn_comp because the old object file was referencing 'nhalloc' rather
than 'alloc'.  dgn_lex.o accidentally didn't care about modifications
to config.h and the other headers that pulls in, such as unixconf.h.

This typo was already present when the last cvs repository was
initialized nearly 14 years ago.
2015-11-17 03:09:20 -08:00
PatR
9645eeef82 tribute: Wintersmith 2015-11-17 02:47:05 -08:00
PatR
2d284b0907 include/*.h formatting
I tracked down the widest lines, which sometimes occur due to mis-indent
of block comments (see tradstdc.h for an example), and fixed those up.
For the files affected, I also converted tabs to spaces.
2015-11-17 02:26:17 -08:00