Commit Graph

5409 Commits

Author SHA1 Message Date
nhmall
b6ce68865a typo fix and some elaboration
Changes to be committed:
	modified:   sys/winnt/Install.nt
2015-11-19 19:28:39 -05: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
PatR
1f3253541a display.h reformatting
A couple of macros with comments in the midst of their expansions got
badly mangled by the automated reformat and one ended up with a line
that was over 150 characters wide.
2015-11-16 18:57:11 -08:00
PatR
fa8ac8a2ce update config.h
Some reformatting (replacing tabs with spaces), but mostly updating some
of the comments, particularly about SYSCF.

Shouldn't GENERIC_USERNAMES be controllable via SYSCF?
2015-11-16 18:55:15 -08:00
Pasi Kallinen
acc883f122 Comment typofix 2015-11-16 11:46:45 +02:00
Pasi Kallinen
807f994d9b Update Guidebook.txt 2015-11-16 10:24:16 +02:00
PatR
c40982eb23 tribute enhancement
When reading a novel, select a random passage which hasn't been shown
already.  Once you've run through all the passages, it resets to get
them all again (with new random order that might happen to the be same
order if there aren't many passages).  Switching to a different novel--
even another copy of the same one--will cause the previous passage
selection to be discarded and restarted from scratch if the prior book
is read again.  Passage tracking for the most recently read novel is
kept across save and restore.  (That means I needed to bump EDITLEVEL,
so it will need to be reset to 0 again before release.)
2015-11-15 21:57:15 -08:00
PatR
334cfd8a97 tribute: Thud! 2015-11-15 17:00:08 -08:00
PatR
0072daa952 tty_exit_nhwindows
Keep window bookkeeping up to date when tty interface is shuting down.

The other interfaces should do something similar when they make windows
known to the core become unavailable.
2015-11-15 15:35:48 -08:00
Pasi Kallinen
8a07e2cdc5 Fix use of data from deleted vault teleport trap 2015-11-15 18:55:09 +02:00
PatR
d813c6f0ee window cleanup at exit
exit_nhwindows() is called before terminate(), and the tty incarnation
destroys all windows--including 'pickinv_cache_win'--without setting
the various index variables used to access them to WIN_ERR, then
terminate() calls freedynamicdata() which calls free_pickinv_cache()
which tries to destroy 'pickinv_cache_win' since it isn't WIN_ERR (if
the perm_invent option has been enabled during that playing session).
Some of the other <interface>_exit_nhwindows() also tear things down
without resetting the variables used to track them, so fixing this in
exit_nhwindows() would have been pretty messy.

Call free_pickinv_cache() before exit_nhwindows() in done().  At the
moment it's only called from done(), so other exit paths won't release
the small chunk(s) of memory used for the alternate inventory window
(if it got created for perm_invent support).
2015-11-15 00:32:56 -08:00
Pasi Kallinen
b2ab8f2504 Update precompiled lev_comp lex and yacc files 2015-11-15 09:09:45 +02:00
Pasi Kallinen
9eb14f684c Extract guard gold before disposing it
If the gold is still in monster inventory, dealloc_obj will panic.
2015-11-14 17:41:31 +02:00
PatR
272d32b343 readobjnam()'s "overlapping strcat"
Replace the code that uses strcat with two pointers into the same buffer.
Treated separately, they point at distinct strings (no overlap possible),
but the C standard does disallow that in order to enable optimizations
using block transfer or such, so the tool that complained about it isn't
wrong.  The characters getting appended to the output pointer can end
up overlapping the beginning of the other input pointer, conceivably
breaking an implementation that didn't use simple left-to-right byte-at-
a-time copying.

Also, I noticed that wishing for "luck stone" gave me a random gem.
There's code to strip off " stone" and compare against gem types, but it
prevents other code that accepts "foo bar" as a match for "foobar" and
vice versa from finding a match, since "luck" doesn't match anything
once "stone" is gone.  So add the four gray stones into the array of
alternate spellings.

Another bit:  it now accepts " gem" in addition to " stone" as optional
gem suffix, so "ruby", "ruby stone", and "ruby gem" all yield ruby.
("luck gem" won't work; you'll end up with a random gem-class object.)

And a last other bit:  wishing for "lamp (lit) named foo" would yield
an unlit, unnamed lamp because "(lit)" followed by anything didn't match
"(lit)" and threw away everything past the opening paren.  Now it will
produce "lamp named foo (lit)"--a lit lamp named "foo".  (Wishing for
"lamp named foo (lit)" produces an unlit lamp named "foo (lit)".  That's
acceptable to me... I'm not crawling any farther down this hole.  Maybe
object formatting should be changed to keep the lit attribute in front
of the name?)
2015-11-14 00:46:19 -08:00
Pasi Kallinen
ffcc6f1bc2 Remove the useless FUN STUFF section
The fun stuff section in config.h contains nothing fun anymore,
so let's remove it. Move SCORE_ON_BOTL to the next section,
and add couple other defines there too.
2015-11-14 10:29:50 +02:00
Pasi Kallinen
739b6708ee Fix enexto complaint when morguemon returned null 2015-11-14 09:59:35 +02:00
PatR
95772261dc fix memory leak: obj->oextra->omonst->mextra
The memory leak (monst->mextra->edog, monst->mextra->mname,
monst->mextra for some monster were not released) I noticed recently
was due to recording a pet's full monster attributes with its corpse.
During save and restore, obj->oextra->omonst was being treated as a
full-fledged monster so worked as intended, but when freed, omonst
was treated as a black box and its mextra details weren't handled.
2015-11-13 20:39:10 -08:00
nhmall
24099c50b2 suppress an MSC warning in cppregex.cpp
Changes to be committed:
	modified:   include/ntconf.h
2015-11-13 09:14:50 -05:00
PatR
2e5818d803 tty build warning
Use casts to try to suppress a couple of assignments of long to short
that Michael's compiler warns about.  'cw->maxrow' might have a value
that's too big for 'short' (when dealing with really big menus), but
'cw->maxcol' never will (unless someone comes up with a terminal or
emulator that's wider that 32K-1 characters...).
2015-11-13 01:12:43 -08:00
Pasi Kallinen
4387bde968 Clear thrownobj when punished and swallowed
As per Pat's suggestion, this actually does work correctly;
I have no idea why I thought it didn't ...
2015-11-13 00:07:47 +02:00
Pasi Kallinen
489d56d4bb Fix hiding under nothing when corpse rotted away 2015-11-13 00:06:07 +02:00
Pasi Kallinen
ca02f00208 Prevent buffer overflow 2015-11-12 22:01:47 +02:00
Pasi Kallinen
c1e34f17f7 Prevent a rnd(0) call 2015-11-12 20:11:45 +02:00
Pasi Kallinen
8451f67dff Fix wallification and wallify catacombs mine end 2015-11-12 18:29:33 +02:00
Pasi Kallinen
0bcb713b4f Fix special level loader memory leaks 2015-11-12 18:00:55 +02:00
PatR
f1106d136e tribute: Going Postal 2015-11-12 01:47:04 -08:00
PatR
ef2a6e6f1b make depend
dungeon.o depending on lev.h is the only change found by 'make depend'.
(I'm a bit suspicious about that.)

I haven't attempted to reconcile the vms Makefiles with the Unix ones,
just put in this one new dependency.  I know vms/Makefile.src lacks
handling for sys/share/*regex.c and vms/Makefile.top and install.com
both lack handling for 'sysconf'.
2015-11-11 23:46:19 -08:00
PatR
b9d5b35078 src/objects.c formatting
Fit the new comments within 80 (actually 78) columns.
2015-11-11 23:30:59 -08:00
PatR
a14b1f9992 fix PATCHLEVEL
> Somebody has changed versioning so that the game incorrectly states
> 3.6.1 in messages. It looks like someone updated patchlevel instead of
> editlevel?

Yes, that was me.  I meant to increment EDITLEVEL and nobody noticed
the mistake until now....

This changes PATCHLEVEL back to the correct value of 0, and implicitly
resets EDITLEVEL to 0 for release (by not changing it to 1 as it was
supposed to have been for the past 3-4 weeks).

Data files from Oct. 18 through today are actually compatible but will
be rejected once anyone rebuilds with this fix, same as would happen
when EDITLEVEL changs.  Data files from before Oct. 18 will be
incompatible but be accepted by nethack but not work correctly due to
a change in the 'context' structure.
2015-11-11 22:56:57 -08:00
nhmall
ce6670174c Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-11-12 00:52:35 -05:00
nhmall
39a1667677 Repair recent tile mapping error when MAIL is undefined
Changes to be committed:
	modified:   src/objects.c
	modified:   win/share/tilemap.c

Warnings during tile builds (and incorrect tile mappings
at run time when MAIL wasn't defined):
	Creating 16x16 binary tile files (this may take some time)
	warning: for tile 325 (numbered 325) of objects.txt,
	        found 'ETAOIN SHRDLU' while expecting 'stamped / mail'
	warning: for tile 326 (numbered 326) of objects.txt,
	        found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU'

The recent addition of the first new extra scroll descriptions in a
very long time caused this problem to show up when MAIL was undefined.

There was a magic number in use that made an assumption that there
were only 4 such extra scroll descriptions, those being
"FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME"
2015-11-12 00:42:52 -05:00
Pasi Kallinen
fad2eab749 Fix infinite looping when bound digging on solid map 2015-11-11 21:47:51 +02:00
nhmall
ecd277cec2 unused parameter warning and an invalid index
Changes to be committed:
	modified:   win/tty/wintty.c
2015-11-11 09:57:05 -05:00
nhmall
38080e921f Windows 10 2015-11-11 09:20:19 -05:00
nhmall
c634164ac1 Windows 10
Changes to be committed:
	modified:   README

 Changes not staged for commit:
modified:   sys/winnt/Install.nt
2015-11-11 09:19:06 -05:00
PatR
f97c3dec0a tty memory management at program termination
Release some dynamically allocated memory prior to exit.  These were
previously left alone due to assumed complexity (at least by me...),
but dealing with them turned out to be straightforward.

|#if FREE_ALL_MEMORY
 free BASE_WINDOW  -- tty-specific; other windows are drawn on top of it
 free ttyDisplay   -- tty's basic data structure
|#endif
 free nh_HI, nh_HE -- termcap values handled differently from the rest

These are the last things that 'heaputil' always reported as not freed
for the basic Unix+tty configuration.  (I've observed other things not
being freed; those are post-3.4.3 bugs that need to be found and fixed.)
2015-11-11 01:43:03 -08:00
PatR
cbeb562d20 doset() -> special_handling() -> free(NULL)
This isn't urgent, but I figure that until the mac build stuff gets
merged in, the core is still fair game....

'O' command's autopickup_exceptions was freeing a menu pick-list even
when it hadn't been allocated (for the list case, and for the remove
case if nothing was chosen for removal).  That code was evidently used
as the model for msgtype and menucolors; they had the same situation.

I think ANSI and ISO sanction free(NULL) as a no-op, but pre-ANSI free
implementations don't necessarily handle that benignly.  Even if they
all do, freeing something--even if that 'something' is nothing--which
hasn't been allocated is a bug on our end.
2015-11-11 01:28:04 -08:00
keni
b31033b7a0 add Windows info 2015-11-10 13:27:32 -05:00
keni
98de663083 Add the DEVEL tree to Files. 2015-11-10 09:44:21 -05:00