]> granicus.if.org Git - nethack/log
nethack
9 years agoCount only stacks when listing container contents.
Sean Hunt [Mon, 25 May 2015 23:59:31 +0000 (08:59 +0900)]
Count only stacks when listing container contents.

By popular demand of the beta testers.

9 years agoProvide feedback when one of your items gets wet.
Sean Hunt [Mon, 25 May 2015 11:55:48 +0000 (20:55 +0900)]
Provide feedback when one of your items gets wet.

9 years agoquestpgr.c's in_line[], out_line[]
PatR [Mon, 25 May 2015 22:49:44 +0000 (15:49 -0700)]
questpgr.c's in_line[], out_line[]

Replace static in_line[] and out_line[] with local variables that are
released when the quest pager code returns to caller.  QTEXT_IN_SIZ
was already removed from makedefs; now QTEXT_OUTSIZ is removed from
nethack.  Use regular BUFSZ for them instead of trying to maintain a
separate size for quest text.

9 years agowishing bit - royal jelly
PatR [Mon, 25 May 2015 21:54:48 +0000 (14:54 -0700)]
wishing bit - royal jelly

9 years agoFix squeaky board creation segfault
Pasi Kallinen [Mon, 25 May 2015 19:02:59 +0000 (22:02 +0300)]
Fix squeaky board creation segfault

If a trap is created on top of another trap, maketrap reuses
the trap struct in place, instead of deleting and recreating it.

If a squeaky trap was created on top of another trap, maketrap
first set the trap type to squeaky board, and then tried to
look through all squeaky boards on the level, to determine
what note the new trap should play. Unfortunately, the union
with the trap note most likely contained a rolling boulder
coordinate or something else outside the 12 note range, so
then the tavail-array lookup would cause a segfault.

9 years agoFix dark room glyphs on level re-entry
Pasi Kallinen [Mon, 25 May 2015 07:02:09 +0000 (10:02 +0300)]
Fix dark room glyphs on level re-entry

9 years agotrickier lint cleanup
PatR [Mon, 25 May 2015 06:49:05 +0000 (23:49 -0700)]
trickier lint cleanup

Suppress some mostly longstanding "unused parameter" warnings where
the usage was generally conditional.

restlevl() had a conditional closing brace that confused the recent
reformat, resulting in some code inside a funciton ending up flush
against the left border (first column, that is, as if outside of the
function).

9 years agomakedefs lint
PatR [Mon, 25 May 2015 06:26:35 +0000 (23:26 -0700)]
makedefs lint

makedefs.c: In function 'fgetline':
makedefs.c:2630: warning: comparison between signed and unsigned
makedefs.c: At top level:
makedefs.c:2638: warning: ISO C does not allow extra ';' outside of a function

fgetline() makes my recent check for quest line truncation become
redundant, so strip that out.  I haven't taken the corresponding
macro out of qtext.h though.

[I didn't see any patch introducing 'fgetline'.  Was it hidden as
part of some big merge?]

9 years agoadd missing tile and correct clobbered header file
nhmall [Mon, 25 May 2015 01:10:22 +0000 (21:10 -0400)]
add missing tile and correct clobbered header file

9 years agoAdd clang-formatting file.
Sean Hunt [Mon, 25 May 2015 00:15:36 +0000 (09:15 +0900)]
Add clang-formatting file.

This should be in the repository, even though nobody can use it yet.

9 years agoRemove stale version control lines.
Sean Hunt [Mon, 25 May 2015 00:14:13 +0000 (09:14 +0900)]
Remove stale version control lines.

9 years agoReformat .h files.
Sean Hunt [Mon, 25 May 2015 00:03:10 +0000 (09:03 +0900)]
Reformat .h files.

I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.

The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.

9 years agoConvert the vibrating square to a trap
Sean Hunt [Sun, 24 May 2015 15:32:45 +0000 (00:32 +0900)]
Convert the vibrating square to a trap

Patch due to ais523 in NetHack 4.

This is not ready to be merged yet; the vibrating square needs a tile
image for tiles builds.

9 years agoremove #include of file that doesn't exist
nhmall [Sun, 24 May 2015 23:29:20 +0000 (19:29 -0400)]
remove #include of file that doesn't exist

9 years agofix a mistake on patch merge
nhmall [Sun, 24 May 2015 23:17:05 +0000 (19:17 -0400)]
fix a mistake on patch merge
Changes to be committed:
modified:   util/makedefs.c

9 years agoWarning cleanup.
Sean Hunt [Sun, 24 May 2015 15:08:34 +0000 (00:08 +0900)]
Warning cleanup.

9 years agoMake the wand of wishing chest immune to trapping
Sean Hunt [Sun, 24 May 2015 15:04:05 +0000 (00:04 +0900)]
Make the wand of wishing chest immune to trapping

This eliminates a source of very random, unpreventable frustration to
players.

9 years agoMake long worms unleashable.
Sean Hunt [Sun, 24 May 2015 15:04:04 +0000 (00:04 +0900)]
Make long worms unleashable.

Fixes a bug reported by ais523. Rather than account for individual
segments, I opted just to make them unleashable, because it's not very
useful behaviour anyhow.

9 years agoClean up ceiling nits.
Sean Hunt [Sun, 24 May 2015 15:04:03 +0000 (00:04 +0900)]
Clean up ceiling nits.

Fixes C343-102.

9 years agoFiles update
nhmall [Sun, 24 May 2015 14:30:55 +0000 (10:30 -0400)]
Files update

9 years agomerge two sets of patches to makedefs.c,qtext.h
nhmall [Sun, 24 May 2015 14:27:03 +0000 (10:27 -0400)]
merge two sets of patches to makedefs.c,qtext.h
 Changes to be committed:
modified:   include/qtext.h
modified:   util/makedefs.c

9 years agoProvide documentation for the regex engine.
Sean Hunt [Sun, 24 May 2015 13:23:18 +0000 (22:23 +0900)]
Provide documentation for the regex engine.

The guidebook entries could do with more detailed descriptions, but this
will do for now.

9 years agoUse the common regex engine in more places.
Sean Hunt [Sun, 24 May 2015 13:23:17 +0000 (22:23 +0900)]
Use the common regex engine in more places.

In particular, in autopickup_exceptions and user sounds.

9 years agoModify makedefs to use dynamic buffers for reading.
Sean Hunt [Sun, 24 May 2015 12:40:30 +0000 (21:40 +0900)]
Modify makedefs to use dynamic buffers for reading.

This will prevent crashing due to excessively long lines.

9 years agoprep for sean's emailed patch
nhmall [Sun, 24 May 2015 14:16:38 +0000 (10:16 -0400)]
prep for sean's emailed patch

9 years agoprep for sean's emailed patch
nhmall [Sun, 24 May 2015 14:09:44 +0000 (10:09 -0400)]
prep for sean's emailed patch

9 years agoAdd pmatch-based regex engine.
Sean Hunt [Sun, 24 May 2015 13:23:16 +0000 (22:23 +0900)]
Add pmatch-based regex engine.

As mentioned, this is not tested. It should be simple though.

9 years agoAudit rloc()
Sean Hunt [Sun, 24 May 2015 12:40:33 +0000 (21:40 +0900)]
Audit rloc()

Most of the time, rloc() is used for teleporting monsters and it's not a
big deal if they can't find somewhere to go. In a few cases, it is. I
went through all the callsites and made calls to rloc() not cause
impossible()s if they don't need to.

Fixes a bug/suite of bugs reported by ais523.

9 years agoClean up a rare corner case with mnearto().
Sean Hunt [Sun, 24 May 2015 12:40:32 +0000 (21:40 +0900)]
Clean up a rare corner case with mnearto().

With this fix, if the second mnearto fails, we don't accidentally strand
othermon at (0,0).

9 years agoFix sleep explosion causing impossible().
Sean Hunt [Sun, 24 May 2015 12:40:31 +0000 (21:40 +0900)]
Fix sleep explosion causing impossible().

Also clean up come ternaries while I'm here.

My first attempt to fix was to add AD_SLEE to explode(), but that failed
because do_break_wand() already does the sleeping portion. I don't
generally like the duplication between explode() and do_break_wand as a
result, but I consider that issue a project for another day.

9 years agominor comment typo spotted
nhmall [Sun, 24 May 2015 12:17:32 +0000 (08:17 -0400)]
minor comment typo spotted
 Changes to be committed:
modified:   src/objnam.c

9 years agomakedefs -q fix
PatR [Sun, 24 May 2015 06:11:41 +0000 (23:11 -0700)]
makedefs -q fix

Make the input buffer for quest messages bigger so that the expanded
header line from nhsub won't be too long.  Also, makedefs will notice
and report too long lines ('makedefs -q' only) and sanely proceed with
the rest of the file instead of treating the excess part of a long
line as a separate line.

9 years agoquest summary messages for B and C
PatR [Sat, 23 May 2015 08:10:56 +0000 (01:10 -0700)]
quest summary messages for B and C

Add '%E [summary line]' to '%Cc' messages for Barbarian and Caveman.
Archeologist was done several years ago; the other roles still need
them.  Creating them is fairly tedious, but DEBUGFILES=questpgr.c
allows them all to be checked on turn 1 via ^P, a great improvement
since that first set.

9 years agomsghistory bandage
PatR [Sat, 23 May 2015 07:59:18 +0000 (00:59 -0700)]
msghistory bandage

Have genl_putmsghistory() pass the message to pline() for the !restoring
case, so that quest summary lines are delivered as ordinary messages.
No effect on tty or win32, which have their own putmsghistory routines.
But for X11, which has a multi-line message window but no save/restore
implementation for its contents, this makes the quest summary lines
actually show up somewhere.  (I looked at maybe implementing
X11_getmsghistory() and X11_putmsghistory() but don't have the energy to
tackle it.)

Other interfaces which lack their own history save/restore will see the
quest summary messages too.  Presumeably they'll all have multi-line
history windows so the extra line won't be displacing the most recent
message.  If not, they'll essentially get the long quest messages twice,
once in full via popup window, then the one-line summary via pline.

9 years agoqtdump() overhaul
PatR [Sat, 23 May 2015 07:50:34 +0000 (00:50 -0700)]
qtdump() overhaul

When dumping quest messages at startup via DEBUGFILES=questpgr.c,
give a single message for each one, instead of a pline showing the
message number and delivery protocol followed by a popup message
window containing the text.  This puts the number and protocol info
at the start/top of the popup window, bypassing the pline (and the
extra --More-- given for tty).

9 years agobeta info
nhmall [Sat, 23 May 2015 00:08:33 +0000 (20:08 -0400)]
beta info
 Changes to be committed:
modified:   src/version.c

9 years agoGuidebook accuracy
nhmall [Fri, 22 May 2015 00:59:04 +0000 (20:59 -0400)]
Guidebook accuracy
 Changes to be committed:
modified:   doc/Guidebook.mn
modified:   doc/Guidebook.tex

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Fri, 22 May 2015 00:46:58 +0000 (20:46 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agocomment out experimentals
nhmall [Fri, 22 May 2015 00:44:32 +0000 (20:44 -0400)]
comment out experimentals

9 years ago#terrain update
PatR [Thu, 21 May 2015 23:53:46 +0000 (16:53 -0700)]
#terrain update

Make the post-3.4.3 '#terrain' command be more versatile by allowing the
player to choose between floor-only, floor+traps, and floor+traps+objects
so that it is possible to view known traps covered by objects or monsters
and remembered objects covered by monsters.  The extra explore mode and
wizard mode choices aren't affected.

9 years agoyou feel {a,an unexpected} draft
PatR [Tue, 19 May 2015 01:25:44 +0000 (18:25 -0700)]
you feel {a,an unexpected} draft

Move the message given when a monster digs through a closed door
or a secret corridor into a separate routine.  In theory, nethack
should determine whether there is a path between the new opening
and the hero's location in order to decide whether a draft can
be felt.  (I don't think anyone is likely to implement that--I'm
certainly not.  Checking whether the hero is in a room with no
breaches in its walls could at least catch being inside a vault.)

While at it, add some USA-centric puns about feeling the prospect
of imminent military conscription instead of air current if it
happens while hallucinating.

9 years agoremove accidentally added util/lev_main.i
PatR [Sat, 16 May 2015 06:08:15 +0000 (23:08 -0700)]
remove accidentally added util/lev_main.i

9 years agoVA_DECL/VA_END usage
PatR [Sat, 16 May 2015 00:45:21 +0000 (17:45 -0700)]
VA_DECL/VA_END usage

Make the variadic functions look more like ordinary code rather than
have the function opening brace be hidden inside the VA_DECL() macro.
That brace is still there, but VA_DECL() now needs to be followed by
a visible brace (which introduces a nested block rather than the
start of the funciton).  VA_END() now provides a hidden closing brace
to end the nested block, and the existing closing brace still matches
the one in VA_DECL().

Sample usage:
void foo VA_DECL(int, arg)  --macro expansion has a hidden opening brace
{  --new, explicit opening brace (actually introduces a nested block)
  VA_START(bar);
  ...code for foo...
  VA_END();  --expansion now provides a closing brace for the nested block
}  --existing closing brace, still pairs with the hidden one in VA_DECL()

This should help if/when another round of reformatting ever takes place,
and also with editors or other tools that do brace/bracket/parenthesis
matching.

I had forgotten that there were variadic functions in sys/* and ended
up modifying a lot more files than intended.  The majority of changes
to those just inserted a new '{' line so that revised VA_END()'s '}'
won't introduce a syntax error.  A couple of them needed VA_END() moved
so that local variables wouldn't go out of scope too soon.  Only the
Unix ones have been tested.

9 years agofix mdig_tunnel impossibility
PatR [Thu, 14 May 2015 00:54:26 +0000 (17:54 -0700)]
fix mdig_tunnel impossibility

Reported by the keymasher:  "stone at (48,8) is undiggable".  Bigroom 4
has a tree at that spot and the whole level is flagged as undiggable.
Undiggable trees were supported on arboreal levels (where their terrain
type is STONE rather than TREE), but not elsewhere.  Monster movement
uses IS_ROCK(), which is true for TREEs, but may_dig() uses IS_STWALL(),
which is false for TREEs so doesn't consider the location as being of
interest and fails to disallow digging.  But mdig_tunnel() bypasses
may_dig() and tests the NONDIGGABLE bit directly, disallowing digging.
(If this sounds confusing, it's a stroll in the park compared to the
code itself.  Apologies for the mixed metaphore.)

Digging away a secret corridor could leave rocks, which doesn't make
a whole lot of sense.  Now a monster's dig attempt will reveal the
location as a corridor instead.

This also moves an assignment out of a macro invocation where it was
inviting trouble if that macro gets modified.  And reorganizes an 'if'
to put cheaper tests sooner.

9 years agoMake the #terrain command work as intended if used while the map is
PatR [Tue, 12 May 2015 23:07:18 +0000 (16:07 -0700)]
Make the #terrain command work as intended if used while the map is
suppressed when the hero is engulfed.  No fixes entry.

9 years agosome pre-Beta updates
nhmall [Sun, 10 May 2015 10:27:07 +0000 (06:27 -0400)]
some pre-Beta updates
 Changes to be committed:
modified:   README
modified:   doc/fixes35.0

9 years ago...don't forget to include the prebuilt headers
Derek S. Ray [Sun, 10 May 2015 00:48:59 +0000 (20:48 -0400)]
...don't forget to include the prebuilt headers

derp.

9 years agocode_style for emacs
PatR [Sun, 10 May 2015 00:05:36 +0000 (17:05 -0700)]
code_style for emacs

9 years agodisplay.h cleanup
PatR [Sat, 9 May 2015 23:54:05 +0000 (16:54 -0700)]
display.h cleanup

I started out just to replace the weird partial expression in the
maybe_display_usteed macro but ended up cleaning up some other stuff
such as line wrapping.

There are still tabs present.

9 years agocatch this up on new features/changes
Derek S. Ray [Sat, 9 May 2015 19:25:37 +0000 (15:25 -0400)]
catch this up on new features/changes

9 years agoAdd token Visual Studio section
Derek S. Ray [Sat, 9 May 2015 19:13:00 +0000 (15:13 -0400)]
Add token Visual Studio section

9 years agoupdate pre-built versions of these
Derek S. Ray [Sat, 9 May 2015 18:41:39 +0000 (14:41 -0400)]
update pre-built versions of these

9 years agoReplace tabs with spaces.
Sean Hunt [Sat, 9 May 2015 18:45:43 +0000 (14:45 -0400)]
Replace tabs with spaces.

9 years agoAdd a coding style document.
Sean Hunt [Sat, 9 May 2015 18:42:54 +0000 (14:42 -0400)]
Add a coding style document.

I've put my best approximation of what the style should be in here. I
don't intend for this to be prescriptive, except as the DevTeam has
agreed, so I do encourage discussion on the mailing list. I would also
appreciate if people with other editors could include the appropriate
configuration recipes.

9 years agofix duplicated header lines
Derek S. Ray [Sat, 9 May 2015 18:35:12 +0000 (14:35 -0400)]
fix duplicated header lines

9 years agoMerge branch 'AlexK-misc'
Derek S. Ray [Sat, 9 May 2015 18:34:16 +0000 (14:34 -0400)]
Merge branch 'AlexK-misc'

* AlexK-misc:
  erosion is not being removed after reading non-cursed scroll of enchant weapon

9 years agofix whitespace errors from simultaneous commit
Derek S. Ray [Sat, 9 May 2015 18:20:36 +0000 (14:20 -0400)]
fix whitespace errors from simultaneous commit

9 years agoreorder onscary() logic to be in right order
Derek S. Ray [Sat, 9 May 2015 18:10:41 +0000 (14:10 -0400)]
reorder onscary() logic to be in right order

9 years agoReformat all C files.
Sean Hunt [Sat, 9 May 2015 17:43:16 +0000 (13:43 -0400)]
Reformat all C files.

I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!

9 years agoFix type compatibility warning.
Sean Hunt [Sat, 9 May 2015 17:07:49 +0000 (13:07 -0400)]
Fix type compatibility warning.

9 years agoMerge branch 'derek-elbereth'
Derek S. Ray [Sat, 9 May 2015 15:58:36 +0000 (11:58 -0400)]
Merge branch 'derek-elbereth'

* derek-elbereth:
  ensure that the 'safe' objects remain safe
  finish up the changes to trigger erosion on use
  initial pass for toning down Elbereth

Conflicts:
dat/castle.des
dat/sokoban.des
include/extern.h
src/engrave.c
src/mklev.c
src/monmove.c
src/zap.c

9 years agodon't break other ports use of tilemap.c
nhmall [Sat, 9 May 2015 14:59:10 +0000 (10:59 -0400)]
don't break other ports use of tilemap.c

The modifications made for supporting monster-looking tiles
may not be supported on platforms other than windows yet.

9 years agoMerge branch 'win32-x64-working'
nhmall [Sat, 9 May 2015 12:02:19 +0000 (08:02 -0400)]
Merge branch 'win32-x64-working'

9 years agoerosion is not being removed after reading non-cursed scroll of enchant weapon
Alex Kompel [Fri, 8 May 2015 07:12:36 +0000 (00:12 -0700)]
erosion is not being removed after reading non-cursed scroll of enchant weapon

9 years agoUsed invent letters didn't destroy the window
Pasi Kallinen [Thu, 7 May 2015 15:04:40 +0000 (18:04 +0300)]
Used invent letters didn't destroy the window

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Thu, 7 May 2015 09:00:36 +0000 (05:00 -0400)]
Merge branch 'master' into win32-x64-working

9 years agomake internal numbering match updated headers
nhmall [Thu, 7 May 2015 08:58:59 +0000 (04:58 -0400)]
make internal numbering match updated headers

9 years agomore header update
nhmall [Thu, 7 May 2015 08:55:05 +0000 (04:55 -0400)]
more header update
 Changes to be committed:
modified:   sys/winnt/nttty.c
modified:   sys/winnt/winnt.c

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Thu, 7 May 2015 08:52:30 +0000 (04:52 -0400)]
Merge branch 'master' into win32-x64-working

9 years agoRestore lost executable bits.
Sean Hunt [Thu, 7 May 2015 03:23:48 +0000 (23:23 -0400)]
Restore lost executable bits.

9 years agoVersion number increment
karnov [Thu, 7 May 2015 02:04:27 +0000 (22:04 -0400)]
Version number increment

9 years agocouple bits omitted from lint.h patch
PatR [Thu, 7 May 2015 00:33:48 +0000 (17:33 -0700)]
couple bits omitted from lint.h patch

* list lint.h in Files
* add dependency to win/X11/dialogs.o since dialogs.c includes lint.h
  directly rather than via hack.h

9 years agomakefile updates
nhmall [Thu, 7 May 2015 00:22:03 +0000 (20:22 -0400)]
makefile updates

9 years agoupdates forced from master
nhmall [Thu, 7 May 2015 00:07:18 +0000 (20:07 -0400)]
updates forced from master
 Changes to be committed:
modified:   sys/winnt/Makefile.bcc
modified:   sys/winnt/Makefile.gcc
modified:   sys/winnt/Makefile.msc

9 years agoput back Derek's _MSC_VER changes into the lint.h version
nhmall [Wed, 6 May 2015 23:58:31 +0000 (19:58 -0400)]
put back Derek's _MSC_VER changes into the lint.h version

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Wed, 6 May 2015 23:53:26 +0000 (19:53 -0400)]
Merge branch 'master' into win32-x64-working

Conflicts:
include/hack.h
win/X11/winmenu.c
win/X11/winstat.c

9 years agoAdd a funny message for when a burrower eats food.
Sean Hunt [Sat, 2 May 2015 03:37:17 +0000 (23:37 -0400)]
Add a funny message for when a burrower eats food.

9 years agoupdate fixes with a few things
Derek S. Ray [Wed, 6 May 2015 21:48:35 +0000 (17:48 -0400)]
update fixes with a few things

9 years agocherry-pick the YACC/LEX upgrades from elsewhere
Derek S. Ray [Tue, 5 May 2015 22:30:58 +0000 (18:30 -0400)]
cherry-pick the YACC/LEX upgrades from elsewhere

9 years agojonadab's patch for engraving on the drawbridge
Derek S. Ray [Tue, 5 May 2015 22:56:25 +0000 (18:56 -0400)]
jonadab's patch for engraving on the drawbridge

Should be splinters, not gravel.
Addendum to C343-239

9 years agoHidden holes made by breaking a wand of digging
Pasi Kallinen [Wed, 6 May 2015 15:02:11 +0000 (18:02 +0300)]
Hidden holes made by breaking a wand of digging

Holes created via applying a wand of digging were not
shown on the map, because holes are always marked as seen,
and seetrap/feeltrap then do nothing.

9 years agoX11 lint suppression
PatR [Wed, 6 May 2015 07:59:15 +0000 (00:59 -0700)]
X11 lint suppression

Suppress close to 400 warnings generated by gcc on the win/X11/*.c code,
most due to -Wwrite-strings which makes string literals implicitly have
the 'const' attribute.  (Since modifying a string literal results in
undefined behavior, that is an appropriate check to have enabled, but
it can be troublesome since string literals have type 'char *' and code
that uses them that way is correct provided it avoids modifying them.)

 113  warning: initialization discards qualifiers from pointer target type
 127  warning: assignment discards qualifiers from pointer target type
  29  warning: passing argument discards qualifiers from pointer target type
 109  warning: unused parameter
  12  warning: comparison between signed and unsigned

The nhStr() hack casts to 'char *', explicitly removing 'const', for
situations where it isn't feasible to make code directly honor const.
The vast marjority of uses are for the second parameter to XtSetArg(),
which is a macro that actually performs an assignment with the second
argument rather than passing it in a function.  It takes values like
'XtNtop', which doesn't need to be altered (although in many places I
changed that to nhStr(XtNtop) for uniformity with the surrounding code,
and 'XtNbottom', which does need to have the extra const stripping to
avoid a warning.  Go figure.

The nhUse() hack actually uses its argument in a meaningless way if the
code is compiled with FORCE_ARG_USAGE defined.  When GCC_WARN is defined,
FORCE_ARG_USAGE will be enabled if it hasn't been already.  Example:

 /*ARGUSED*/
 int foo(arg)
   int arg;  /* not used */
 {
+  nhUse(arg);
   return 0;
 }

The extra line will expand to ';' when FORCE_ARG_USAGE is not defined
or too
   nhUse_dummy += (unsigned)arg;
when it is.  I figured direct assignment might lead to a different
warning by some compilers in a situation like
   nhUse(arg);
   nhUse(otherarg);
where the first assignment would be clobbered by the second, and using
bitwise operations or safer '+= (arg != 0)' would most likely generate
more non-useful code.  Some tweaking might turn out to be necessary.

9 years agonew file: include/lint.h
PatR [Wed, 6 May 2015 07:38:16 +0000 (00:38 -0700)]
new file: include/lint.h

modified files: include/hack.h, src/decl.c, sys/unix/Makefile.src

Groundwork for cleaning up the X11 sources, where gcc with the option
settings specified in the OSX hints file currently generates close to
400 warnings for win/X11/*.c.

lint.h is included by hack.h, and I've moved the debugpline stuff from
the latter to the former to hide it better.  (By rights it belongs in
debug.h or something of the sort, but I didn't want to go that far.)
Makefile and project dependencies need to catch up.

nhStr() hides a cast to char *, and is intended to by used on string
literals where it isn't feasible to maintain the 'const' attribute.
(A pernicious problem with X11 code, where the include situation can
become very convoluted, and many, MANY string literals are hidden
behind macros to look like keyword-type tokens.)

nhUse() can be used to force a fake usage on something which triggers
an unused parameter warning.  There are a 6 or 8 or 10 places in the
core code where that applies, but so far I have't touched any of them.
There's a tradeoff since it will result in some worthless code being
generated and executed, but is much simpler than tacking on compiler-
specific workarounds like '#pragma unused' or gcc's __attribute__ hack.

9 years agoComment for the pudding glob order
Pasi Kallinen [Wed, 6 May 2015 06:54:28 +0000 (09:54 +0300)]
Comment for the pudding glob order

9 years agoanother pass at "gold wield inconsistency"
PatR [Tue, 5 May 2015 23:25:49 +0000 (16:25 -0700)]
another pass at "gold wield inconsistency"

Handle !fixinv by forcing gold to have slot '$' all the time; that
particular type of object is 'fixed' regardless of user preference.
Also add a couple of checks for non-'$' gold when selecting from
inventory, just in case the issue of multiple gold stacks reappears.

9 years agoFix impossible when quivered gold was stolen from you
Pasi Kallinen [Tue, 5 May 2015 18:29:24 +0000 (21:29 +0300)]
Fix impossible when quivered gold was stolen from you

9 years agoRevert previous, with a comment in code
Pasi Kallinen [Tue, 5 May 2015 03:55:56 +0000 (06:55 +0300)]
Revert previous, with a comment in code

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Mon, 4 May 2015 21:56:35 +0000 (17:56 -0400)]
Merge branch 'master' into win32-x64-working

9 years agoMelded pudding object may be gone
Pasi Kallinen [Mon, 4 May 2015 19:19:27 +0000 (22:19 +0300)]
Melded pudding object may be gone

9 years agomore "deleting worn obj"
PatR [Mon, 4 May 2015 15:49:21 +0000 (08:49 -0700)]
more "deleting worn obj"

Lit candles and burning potions of oil can be on the migrating objects
list and get deleted before arrival, so they need the same cleanup as
rotting corpses to prevent obfree from complaining that they're worn.

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
karnov [Mon, 4 May 2015 02:08:07 +0000 (22:08 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

Pull to resync.

9 years agoMade sysconf define contiditional to ensure no double inclusion.
karnov [Mon, 4 May 2015 02:03:09 +0000 (22:03 -0400)]
Made sysconf define contiditional to ensure no double inclusion.

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Mon, 4 May 2015 00:53:04 +0000 (20:53 -0400)]
Merge branch 'master' into win32-x64-working

Conflicts:
src/dig.c
src/mkobj.c

 Changes to be committed:
modified:   src/dig.c
modified:   src/mkobj.c

9 years agoowornmask sanity_check fix and enhancement
PatR [Sun, 3 May 2015 23:57:09 +0000 (16:57 -0700)]
owornmask sanity_check fix and enhancement

Thinko fix:  sanity checking for owornmask was mis-treating
OBJ_MIGRATING as OBJ_MINVENT of migrating monsters rather than as
unattended objects and would have had problems similar to obfree's
inappropriate impossible check.

Sanity checking for objects worn in invalid slots (amulet worn in
a ring slot and so forth) is extended to items worn by monsters.
Also add a check for wielded coins since the loophole that let them
become wielded has been closed.

9 years agofix "deleting worn object" impossibility
PatR [Sun, 3 May 2015 23:54:53 +0000 (16:54 -0700)]
fix "deleting worn object" impossibility

Migrating objects overload obj->owornmask with a destination code,
so rot_corpse needs to clear that before deleting corpses.  (Buried
objects don't touch owornmask, so rot_organic, which does the actual
object deletion, shouldn't need any similar change.)

The corpses with owornmask 3 that have been observed recently were
slated to arrive on the up stairs, so presumeably fell down the down
stairs of the current level and rotted before the hero went down.
Put plainly, it was the [post-3.4.3] impossible() check which was in
error, not the active game data.

9 years agoMerge branch 'master' into win32-x64-working
nhmall [Sun, 3 May 2015 13:01:46 +0000 (09:01 -0400)]
Merge branch 'master' into win32-x64-working

9 years agofix "gold wield inconsistency"
PatR [Sun, 3 May 2015 08:22:25 +0000 (01:22 -0700)]
fix "gold wield inconsistency"

'w$' reported "you can't wield gold" but
'w*$', choosing from inventory and picking gold, let you wield gold.

The old code checked whether gold had been picked before checking
whether '?' or '*' had been picked to request selection from inventory.
This wasn't an issue with 3.4.3's !GOLDINV configuration (but probably
was for anyone who explicitly switched to GOLDINV) because getobj()'s
callers only inserted gold into inventory when they intended to accept
it as a valid choice.

Fix is just to swap two adjacent 'if' blocks in getobj() so that '*'
is processed before the test of whether '$' has been chosen.  Most of
the diff is indentation and other minor reformatting.

9 years agotiles lint
PatR [Sun, 3 May 2015 08:03:24 +0000 (01:03 -0700)]
tiles lint

Several instances of "comparison between signed and unsigned".

  win/share/tiletext.c
  win/X11/tile2x11.c

9 years agotiles-related build stuff
PatR [Sun, 3 May 2015 07:47:10 +0000 (00:47 -0700)]
tiles-related build stuff

* Add missing entry for include/tile.h to (top)/Files; also
  add new entry for generated file util/tiletxt.c (Unix only);
* Add several missing entries for tile utility programs that
  can be built by sys/unix/Makefile.utl to util/.gitignore;
* Update sys/unix/Makefile.utl to build 'tilemap' differently so
  that it won't leave behind an unwanted subdirectory tree under OSX:
    util/tilemap.dSYM/
    util/tilemap.dSYM/Contents/
    util/tilemap.dSYM/Contents/Info.plist
    util/tilemap.dSYM/Contents/Resources/
    util/tilemap.dSYM/Contents/Resources/DWARF/
    util/tilemap.dSYM/Contents/Resources/DWARF/tilemap
  It now generates util/tiletxt.c on the fly, to be compiled into
  tiletxt.o, so that tilemap.c can be compiled in the ordinary
  manner and tilemap.o can be kept around for dependency checking.
  (Creating real source file win/share/tiletxt.c would be a little
  bit cleaner, but it's effectively two lines long so seems silly
  to be in the source distribution.)  I looked to see whether I
  could find a linker or compiler option to suppress that stuff but
  failed.  I'm sure something of the sort must exist but didn't
  pursue it.  Someday I might actually learn about how OSX works....

9 years agoRandomize secret door locations
Pasi Kallinen [Sun, 3 May 2015 07:31:24 +0000 (10:31 +0300)]
Randomize secret door locations

... in the Wizard quest locate level and Rodney tower entrance