]> granicus.if.org Git - nethack/log
nethack
4 years ago'O' feedback for booleans
PatR [Fri, 19 Feb 2021 08:24:45 +0000 (00:24 -0800)]
'O' feedback for booleans

Give a message for each boolean option toggled via 'O'.  It may
help catch mistakes sooner if/when player types wrong menu letter.

Only applies to 'O', not booleans manipulated during config file
or NETHACKOPTIONS processing.

4 years ago'wizmgender' flag
PatR [Fri, 19 Feb 2021 07:54:30 +0000 (23:54 -0800)]
'wizmgender' flag

"Demote" wizmgender from an obscure wizard mode extended command
to an obscure wizard mode boolean option.  Behaves the same except
that no message is given when the value gets toggled.

4 years agofix github issue #462 - line not displayed
PatR [Wed, 17 Feb 2021 22:27:00 +0000 (14:27 -0800)]
fix github issue #462 - line not displayed

Fix a latent bug in unreachable code.  As the comment preceding
the cited code states, hero polymorphed into an eel isn't offered
a chance to use #monster to hide, so program execution won't ever
get to the bad code.  Using formatting routine The() where message
delivery routine pline_The() is intended is certainly a bug though.

Fixes #462

4 years agoX11's yn_function() echoing its response
PatR [Tue, 16 Feb 2021 03:09:00 +0000 (19:09 -0800)]
X11's yn_function() echoing its response

X11_yn_function() issues a pline() to put the prompt and player's
response into the message window.  Change it to use visctrl() to
make sure that the response character is ledgible when something
like the '&' command allows an arbitrary answer.

This patch adds a leading space and two extra trailing spaces
to the prompt when it's being issued via popup, but that hasn't
affected the issue mentioned next....

The popup prompting when the 'slow' resource is False doesn't
always resize properly.  I saw both too wide and too narrow
[What do you want to throw? [abc] ]b
[       In what direction?        ]
and
[Really quit? [yn] (n) ]y
[Dump core? [ynq] (q) ]n   (size seemed right, but hard to tell)
[Do you want your posses]  (might have shown one more letter;
                            resize doodad in window's bottom right
                            corner on OSX oscures the rightmost
                            column--which is ordinarily a space)
The truncated one did accept responses.  If I answered 'n' then
the next question was truncated too, but for 'y' (plus ensuing
feedback) it would be sized correctly for the question after that.

To be clear:  the popup width issue was present before this change
and is still present after it.  The code already has a hack that's
intended to deal with this but it doesn't do the job for me.

4 years agoX11 persistent inventory again: initial display
PatR [Sun, 14 Feb 2021 08:57:34 +0000 (00:57 -0800)]
X11 persistent inventory again: initial display

If 'perm_invent' is preset in player's options, have X11 show the
persistent inventory window from the start instead of waiting for
an 'i' command.  moveloop() prolog needed a tweak do deal with it
cleanly.

Require WC_PERM_INVENT in order to honor the perm_invent option.
X11 and curses already set that, tty and curses don't support it,
so only Windows GUI needed to be updated for it.

4 years agoX11 perm_invent: handle 'O' toggling off perm_invent
PatR [Sun, 14 Feb 2021 03:17:20 +0000 (19:17 -0800)]
X11 perm_invent: handle 'O' toggling off perm_invent

When persistent inventory window is up, remove it if 'perm_invent'
option gets set to False.  This has a side-effect of fixing the
end-of-game prompting problem it caused.

4 years agomonster missiles vs sinks
PatR [Sat, 13 Feb 2021 23:16:15 +0000 (15:16 -0800)]
monster missiles vs sinks

Missiles shot or thrown by monsters already stop at sinks; give
a message if they haven't exhausted their range and hero sees.

4 years agoscatter() vs sinks
PatR [Sat, 13 Feb 2021 23:15:21 +0000 (15:15 -0800)]
scatter() vs sinks

Objects shot, thrown, or kicked by the hero or by monsters stop
short if they try to pass over a sink; make objects launched by
an explosion behave similarly.

4 years agoAdd couple more config tests
Pasi Kallinen [Sat, 13 Feb 2021 09:51:25 +0000 (11:51 +0200)]
Add couple more config tests

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 12 Feb 2021 23:24:07 +0000 (18:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoX11: persistent inventory issues and hack for OSX
PatR [Fri, 12 Feb 2021 23:07:51 +0000 (15:07 -0800)]
X11: persistent inventory issues and hack for OSX

This hack prevents the perm_invent window for X11 on OSX from
creeping every time it gets updated.  It is far from perfect and
at the very least ought be handled via user settable X resources
rather than hardcoded values, but it's as much effort as I'm likely
to spend.

Add a new file containing a list of issues that ought to be fixed.
The initial entries are things I noticed while experimenting with
perm_invent; there is lots of older stuff that could/should be
there too.  I'm not sure whether the first one is OSX-specific; the
others aren't.

4 years agoMake runmode option complain, add some tests for it
Pasi Kallinen [Fri, 12 Feb 2021 17:38:40 +0000 (19:38 +0200)]
Make runmode option complain, add some tests for it

4 years agomkroom.c oddity
PatR [Thu, 11 Feb 2021 23:38:26 +0000 (15:38 -0800)]
mkroom.c oddity

Replace a strange pline() with impossible().

Remove some ancient MAC special handling for getenv("SHOPTYPE").

4 years agomklev.c's mkroom qsort
PatR [Thu, 11 Feb 2021 23:18:12 +0000 (15:18 -0800)]
mklev.c's mkroom qsort

Get rid of some obsolete qsort hackery.  Use of prototypes makes
it unnecessary.  Even before that it was the only one of a dozen
instances of qsort() usage that cared about pre-ANSI implementation.

Also, reformat a couple of comments.

4 years agoDon't complain about unknown option if param is wrong
Pasi Kallinen [Thu, 11 Feb 2021 16:22:14 +0000 (18:22 +0200)]
Don't complain about unknown option if param is wrong

When a compound option was given an erroneous parameter,
for example "OPTIONS=runmode:foo",
you first got "Unknown runmode parameter 'foo", and
then "Unknown option 'runmode:foo'".

Prevent the Unknown option complaint, if we actually did
find a match.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Wed, 10 Feb 2021 17:24:08 +0000 (12:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoGuidebook date was behind on recent updates so give it a bump
nhmall [Thu, 11 Feb 2021 15:38:43 +0000 (10:38 -0500)]
Guidebook date was behind on recent updates so give it a bump

4 years agorecent X11 bit: X11_bail() doesn't return
PatR [Thu, 11 Feb 2021 02:52:22 +0000 (18:52 -0800)]
recent X11 bit: X11_bail() doesn't return

4 years agonroff Guidebook fix
PatR [Thu, 11 Feb 2021 02:48:21 +0000 (18:48 -0800)]
nroff Guidebook fix

Options which show lists of possible values using '.CC' were
unintentionally being rendered with bold font.  I tracked it
down to "figure 3" which has been in place for quite a while.
The font setting and resetting wasn't working as I expected.
This change yields the intended results.

4 years agobump editlevel
nhmall [Thu, 11 Feb 2021 00:54:10 +0000 (19:54 -0500)]
bump editlevel

4 years agoMerge branch 'copperwater-pr460' into NetHack-3.7
nhmall [Thu, 11 Feb 2021 00:53:07 +0000 (19:53 -0500)]
Merge branch 'copperwater-pr460' into NetHack-3.7

4 years agoFix lua doc copypaste error
Pasi Kallinen [Wed, 10 Feb 2021 20:06:36 +0000 (22:06 +0200)]
Fix lua doc copypaste error

4 years agoAdd lua tests for config file parsing
Pasi Kallinen [Wed, 10 Feb 2021 17:15:35 +0000 (19:15 +0200)]
Add lua tests for config file parsing

Bare-bones for now, more tests needed.

4 years agoAdd in_lua flag
Pasi Kallinen [Wed, 10 Feb 2021 15:06:08 +0000 (17:06 +0200)]
Add in_lua flag

In preparation of making config errors available to lua scripts,
instead outputting them via pline.

4 years agocurses comment
PatR [Tue, 9 Feb 2021 23:50:03 +0000 (15:50 -0800)]
curses comment

Add a TODO item for curses status display that will probably
never get done.  Could apply to tty too.

4 years agowiz_identify vs perm_invent
PatR [Tue, 9 Feb 2021 23:07:16 +0000 (15:07 -0800)]
wiz_identify vs perm_invent

Using ^I to identify inventory and picking '_' (or '^I' or full
menu) would update persistent inventory window after identifying
everything, but picking specific items (even everything as long
as '_' was excluded) to identify wasn't doing that.

I moved some fixes37.0 entries around to group the persistent
inventory ones together.  One involved hold_another_object so I
group those too.  I didn't look very hard to try to find others
that could fit with these.

4 years agoThis is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt
nhw_cron [Tue, 9 Feb 2021 01:24:07 +0000 (20:24 -0500)]
This is cron-daily v1-Jan-20-2020.  guidebook updated: doc/Guidebook.txt

4 years agocurses persistent inventory window tweak
PatR [Tue, 9 Feb 2021 00:34:29 +0000 (16:34 -0800)]
curses persistent inventory window tweak

Under curses interface, provide a way to get a little more space
for perm_invent without turning off windowborders entirely.

Possible 'windowborders' values:
 0 = no borders, max screen space available for useful info
 1 = full borders, two lines and two columns wasted for each window
 2 = contingent borders, show if screen is big enough, else hide
New:
 3 = as 1 except no borders for perm_invent window
 4 = as 2 except never borders for perm_invent window

3 and 4 let the map, message, and status windows have borders while
providing two extra lines and two extra columns on each line for
persistent inventory.  It's not much but better than nothing when
borders are enabled.

4 years agoplug config file parsing memory leak
PatR [Mon, 8 Feb 2021 21:16:54 +0000 (13:16 -0800)]
plug config file parsing memory leak

The new options processing had a memory leak:  'parser.inbuf'.

Also, reorder some routines to fit in the corresponding comment
sections (with new sections for wizkit and symset) and reorder
some prototypes to match their order in the file.

4 years agomake engraving an occupation pr#460
nhmall [Mon, 8 Feb 2021 13:41:23 +0000 (08:41 -0500)]
make engraving an occupation pr#460

copperwater commented 8 hours ago:
Instead of inexplicably paralyzing the player for the duration of their
engraving. Many a character has died by trying to engrave something and
then sitting there diligently writing it while monsters surround and
attack them. (This was especially prominent back in the 3.4.3 era when
repeated Elbereths were viable, but it still occurs today with e.g.
using a hard stone to engrave Elbereth). There were also some other
oddities - for instance, if something teleported the player away while
they were engraving, they would continue to "engrave" (be paralyzed) on
their new location, but would not produce any text there; the full
engraving would be placed on their initial position.

In this commit, I have converted engraving to use the occupation
framework, which treats it as an interruptible activity. This
necessitated some logical restructuring, mostly involving the engraving
being written out in chunks as the player spends more uninterrupted time
on it.

I've tried to keep this free of regressions except for those inherent to
the occupation system.

What has NOT changed:

o The rate of engraving is still 10 characters per turn, or 1 character
using slow methods.

o The formulas for determining how much a bladed weapon or marker can
engrave before getting exhausted are kept. Though this is a bit
convoluted, and if it's not considered important to preserve the
existing behavior, I would recommend simplifying it by decreasing the
maximum engraving length for weapons by 1 so that each point of
enchantment simply gets you 2 characters' worth of engraving (e.g. a
-2 weapon will only engrave 1 or 2 characters before dulling to -3,
rather than giving it a third "grace character".

o The input buffer is still modified based on confusion/blindness/etc
only at the time when the player inputs it (if they gain a
debilitating status while engraving, it will not affect the text). My
personal preference is to make the text affected in scenarios like
that, but it's not strictly necessary to do here, so I didn't.

o Wand messages such as "The floor is riddled by bullet holes", and
blinding from engraving lightning, still appear before the hero starts
to take any time engraving. As noted above, getting blinded by the
wand still has no effect on accurately engraving the text, unless the
hero was already blind or impaired.

What has changed:

o Moving off the engraving or losing the object being engraved with
causes the player to stop engraving.

o Wands can still engrave an arbitrary amount of text using a single
charge, but if the hero is interrupted and decides to start engraving
again, they will consume a second charge.

As it adds a new field to g.context, this is a save-breaking change.

4 years agoMerge branch 'engraving-occupation' of https://github.com/copperwater/NetHack into...
nhmall [Mon, 8 Feb 2021 13:39:50 +0000 (08:39 -0500)]
Merge branch 'engraving-occupation' of https://github.com/copperwater/NetHack into copperwater-pr460

4 years agoMake engraving an occupation
copperwater [Mon, 8 Feb 2021 04:21:31 +0000 (23:21 -0500)]
Make engraving an occupation

Instead of inexplicably paralyzing the player for the duration of their
engraving. Many a character has died by trying to engrave something and
then sitting there diligently writing it while monsters surround and
attack them. (This was especially prominent back in the 3.4.3 era when
repeated Elbereths were viable, but it still occurs today with e.g.
using a hard stone to engrave Elbereth). There were also some other
oddities - for instance, if something teleported the player away while
they were engraving, they would continue to "engrave" (be paralyzed) on
their new location, but would not produce any text there; the full
engraving would be placed on their initial position.

In this commit, I have converted engraving to use the occupation
framework, which treats it as an interruptible activity. This
necessitated some logical restructuring, mostly involving the engraving
being written out in chunks as the player spends more uninterrupted time
on it.

I've tried to keep this free of regressions except for those inherent to
the occupation system.

What has NOT changed:
- The rate of engraving is still 10 characters per turn, or 1 character
  using slow methods.
- The formulas for determining how much a bladed weapon or marker can
  engrave before getting exhausted are kept. Though this is a bit
  convoluted, and if it's not considered important to preserve the
  existing behavior, I would recommend simplifying it by decreasing the
  maximum engraving length for weapons by 1 so that each point of
  enchantment simply gets you 2 characters' worth of engraving (e.g. a
  -2 weapon will only engrave 1 or 2 characters before dulling to -3,
  rather than giving it a third "grace character".
- The input buffer is still modified based on confusion/blindness/etc
  only at the time when the player inputs it (if they gain a
  debilitating status while engraving, it will not affect the text). My
  personal preference is to make the text affected in scenarios like
  that, but it's not strictly necessary to do here, so I didn't.
- Wand messages such as "The floor is riddled by bullet holes", and
  blinding from engraving lightning, still appear before the hero starts
  to take any time engraving. As noted above, getting blinded by the
  wand still has no effect on accurately engraving the text, unless the
  hero was already blind or impaired.

What has changed:
- Moving off the engraving or losing the object being engraved with
  causes the player to stop engraving.
- Wands can still engrave an arbitrary amount of text using a single
  charge, but if the hero is interrupted and decides to start engraving
  again, they will consume a second charge.

As it adds a new field to g.context, this is a save-breaking change.

4 years agoRe-fix altar compiler warning
Dean Luick [Mon, 8 Feb 2021 04:25:25 +0000 (22:25 -0600)]
Re-fix altar compiler warning

Implement a better fix for commit 2f4f7d22d ("Fix align type
mixup wth align mask") which was reverted in commit 4e35e8b5a
("Revert "Fix align type mixup wth align mask"").

In the present code, the field align in both struct altar and
struct monster is not an aligntyp, but an align mask with extra flags.
Change the type to match its actual use and improve the naming.

Consolidate duplicated code into a single routine.

Change the return type of induced_align() to be unsigned to match
amask usage.

Change the special level align mask values to be separate from
the normal align mask values.

4 years agodisplay_pickinv
PatR [Sun, 7 Feb 2021 22:58:08 +0000 (14:58 -0800)]
display_pickinv

A formatting bit that grew a little.  An end of line comment that
spans on two or more lines
  foo(); /* call
            foo() */
will confuse clang-format if the continuation lines don't begin
with an asterisk
  foo(); /* call
          * foo() */
Instead of just doing that, I changed display_pickinv() to add a
comment for each of its arguments.

4 years agopotion dipping tweak
PatR [Sun, 7 Feb 2021 00:34:41 +0000 (16:34 -0800)]
potion dipping tweak

Update some code from four weeks ago.  One of two hold_potion()
calls was followed by update_inventory() but the other wasn't.
Have hold_potion() do that itself.  I'm not sure that this is
needed and haven't convinced myself that it's not.

4 years agopartial fix for #K3262 - X11 perm_invent panic
PatR [Sun, 7 Feb 2021 00:04:44 +0000 (16:04 -0800)]
partial fix for #K3262 - X11 perm_invent panic

Prevent the "X Error (bad Atom)" situation that causes an
"X Error" panic.

The issue isn't fixed.  This fails to implement the intended
functionality of having the X server remember the persistent
inventory window's location across games (until the next time
that the X server restarts).  Worse, on OSX the window creeps
each time it is updated (visually it seems to be moving down by
the height of the window's title bar).

That's not as bad as having it move to the pointer's location as
it did in 3.6.1, but prior to the commit which introduced this
code that had been fixed and it stayed put during the current
game, so more work is definitely needed.

4 years agoduring engraving, spaces were counted instead of non-spaces
nhmall [Sat, 6 Feb 2021 23:49:16 +0000 (18:49 -0500)]
during engraving, spaces were counted instead of non-spaces

2015 commit 27d8b631cd5b628577194b689b6182a8b4fc4bae incorrectly altered a test

/* Chop engraving down to size if necessary */
if (len > maxelen) {
    for (sp = ebuf; (maxelen && *sp); sp++)
-> if (!isspace(*sp)) maxelen--;
    if (!maxelen && *sp) {
*sp = (char)0;
if (multi) nomovemsg = "You cannot write any more.";

was changed to:

/* Chop engraving down to size if necessary */
        if (len > maxelen) {
    for (sp = ebuf; (maxelen && *sp); sp++)
-> if (*sp == ' ') maxelen--;
    if (!maxelen && *sp) {
*sp = (char)0;
if (multi) nomovemsg = "You cannot write any more.";

Fixes #457

4 years agoRevert "Fix align type mixup wth align mask"
nhmall [Sat, 6 Feb 2021 19:54:54 +0000 (14:54 -0500)]
Revert "Fix align type mixup wth align mask"

This reverts commit 2f4f7d22d3531c8c07253543b9d8f81637f9356c
for now while the matter is investigated further.

Also closes #459

4 years agoLua: set and get config options
Pasi Kallinen [Sat, 6 Feb 2021 16:57:41 +0000 (18:57 +0200)]
Lua: set and get config options

Still needs more work, especially the error handling.

4 years agoWindows sys/winnt/Makefile.msc update
nhmall [Sat, 6 Feb 2021 00:53:05 +0000 (19:53 -0500)]
Windows sys/winnt/Makefile.msc update

4 years agowasm cross-compile bit
nhmall [Sat, 6 Feb 2021 00:16:49 +0000 (19:16 -0500)]
wasm cross-compile bit

4 years agoadd -Wdeprecated-copy if clang and clang >= 9
nhmall [Fri, 5 Feb 2021 21:28:09 +0000 (16:28 -0500)]
add -Wdeprecated-copy if clang and clang >= 9

4 years agotypo fix
nhmall [Fri, 5 Feb 2021 15:03:18 +0000 (10:03 -0500)]
typo fix

4 years agosync some macOS hints changes to linux hints
nhmall [Fri, 5 Feb 2021 14:51:07 +0000 (09:51 -0500)]
sync some macOS hints changes to linux hints

4 years agoseparate the C compiler flags and C++ compiler flags where needed
nhmall [Fri, 5 Feb 2021 14:45:03 +0000 (09:45 -0500)]
separate the C compiler flags and C++ compiler flags where needed

4 years agopotential fix for the macOS issue encountered
nhmall [Fri, 5 Feb 2021 14:38:35 +0000 (09:38 -0500)]
potential fix for the macOS issue encountered

Some build flags were unintentionally overlooked in a previous change

4 years agoroll back a Makefile.src change due to macOS issue afterwards
nhmall [Fri, 5 Feb 2021 12:43:51 +0000 (07:43 -0500)]
roll back a Makefile.src change due to macOS issue afterwards

Requires further investigation

4 years agoFix BIND segfault
Pasi Kallinen [Fri, 5 Feb 2021 09:14:11 +0000 (11:14 +0200)]
Fix BIND segfault

Recent commit that added terminator entry to default_menu_cmd_info
caused a segfault when trying to BIND keys.

4 years agocurses: honor menu_next_page/&c option settings
PatR [Fri, 5 Feb 2021 09:04:48 +0000 (01:04 -0800)]
curses: honor menu_next_page/&c option settings

tty and X11 honor the menu_xxx options.  Qt currently doesn't
support menu manipulation by keyboard.  curses does support that
but was only handling the default menu keys.

4 years agomore cross-compile warning bits
nhmall [Fri, 5 Feb 2021 00:42:07 +0000 (19:42 -0500)]
more cross-compile warning bits

maximize warnings for NetHack sources
minimize warnings for Lua and pdcurses which we won't be changing

4 years agoanother old-style-definition
nhmall [Fri, 5 Feb 2021 00:40:38 +0000 (19:40 -0500)]
another old-style-definition

4 years agomore msdos cross-compile pdcurses warning suppression
nhmall [Thu, 4 Feb 2021 23:53:18 +0000 (18:53 -0500)]
more msdos cross-compile pdcurses warning suppression

4 years agowarnings in cross-compile of pdcurses are not desired
nhmall [Thu, 4 Feb 2021 23:41:07 +0000 (18:41 -0500)]
warnings in cross-compile of pdcurses are not desired

4 years agoprogress detail in the CI log file is too verbose
nhmall [Thu, 4 Feb 2021 23:04:11 +0000 (18:04 -0500)]
progress detail in the CI log file is too verbose

4 years agoDisable warning 4774 for lua source files.
Bart House [Thu, 4 Feb 2021 19:28:41 +0000 (11:28 -0800)]
Disable warning 4774 for lua source files.

4 years agofollow-up on the util/recover.c change earlier
nhmall [Thu, 4 Feb 2021 17:50:53 +0000 (12:50 -0500)]
follow-up on the util/recover.c change earlier

It failed in the CI

4 years agoRevert "follow-up on the util/recover.c change earlier"
nhmall [Thu, 4 Feb 2021 17:48:51 +0000 (12:48 -0500)]
Revert "follow-up on the util/recover.c change earlier"

This reverts commit 54e984c70c72575e1095bdc4cf5b94e71a71761a.

4 years agofollow-up on the util/recover.c change earlier
nhmall [Thu, 4 Feb 2021 17:45:28 +0000 (12:45 -0500)]
follow-up on the util/recover.c change earlier

It failed in the CI

4 years agoset but not used warning in util/recover.c
nhmall [Thu, 4 Feb 2021 12:40:55 +0000 (07:40 -0500)]
set but not used warning in util/recover.c

../util/recover.c:416:9: warning: variable 'bsize' set but not used [-Wunused-but-set-variable]
  416 |     int bsize;
      |         ^~~~~

4 years agosome options tidying
PatR [Thu, 4 Feb 2021 09:35:58 +0000 (01:35 -0800)]
some options tidying

Somehow several arrays of compound option values ended up in
between defining menu_cmd_t and using menu_cmd_t.  Reorder them.

Also, add a terminator to the list of menu commands so that it
could potentially be used manipulated from other source files
that don't have access to the array size.

4 years agoanother duplicate entry in Xcode project file
nhmall [Thu, 4 Feb 2021 03:04:15 +0000 (22:04 -0500)]
another duplicate entry in Xcode project file

4 years agoremove a duplicate entry in Xcode project file
nhmall [Thu, 4 Feb 2021 03:03:04 +0000 (22:03 -0500)]
remove a duplicate entry in Xcode project file

4 years agoadd missing lua files to Xcode build
nhmall [Thu, 4 Feb 2021 02:52:42 +0000 (21:52 -0500)]
add missing lua files to Xcode build

4 years agoCouple of Xcode setup documenation bits
PatR [Thu, 4 Feb 2021 01:10:49 +0000 (17:10 -0800)]
Couple of Xcode setup documenation bits

4 years agoprevent lua crash upon init failure
PatR [Thu, 4 Feb 2021 01:09:35 +0000 (17:09 -0800)]
prevent lua crash upon init failure

panic() instead, so not much help to the player.

4 years agoQt close-window handling
PatR [Wed, 3 Feb 2021 21:42:17 +0000 (13:42 -0800)]
Qt close-window handling

Handle the unused variable 'ok' differently.

4 years agoQt follow-up bit
nhmall [Wed, 3 Feb 2021 20:36:00 +0000 (15:36 -0500)]
Qt follow-up bit

4 years agounused-but-set-variable warning in qt_main.cpp
nhmall [Wed, 3 Feb 2021 20:31:57 +0000 (15:31 -0500)]
unused-but-set-variable warning in qt_main.cpp

../win/Qt/qt_main.cpp: In member function ‘virtual void nethack_qt_::NetHackQtMainWindow::closeEvent(QCloseEvent*)’:
../win/Qt/qt_main.cpp:1377:9: warning: variable ‘ok’ set but not used [-Wunused-but-set-variable]
 1377 |     int ok = 0;
      |         ^~

4 years agoQt setChecked() takes a boolean argument
nhmall [Wed, 3 Feb 2021 20:19:49 +0000 (15:19 -0500)]
Qt setChecked() takes a boolean argument

4 years agoFix spelling error in Samurai quest
Patric Mueller [Wed, 3 Feb 2021 19:31:01 +0000 (20:31 +0100)]
Fix spelling error in Samurai quest

4 years agoensure build with old linux-qt5 hints
nhmall [Wed, 3 Feb 2021 18:46:13 +0000 (13:46 -0500)]
ensure build with old linux-qt5 hints

4 years agoremove debugging statement from warnings.h
nhmall [Wed, 3 Feb 2021 18:25:50 +0000 (13:25 -0500)]
remove debugging statement from warnings.h

4 years agoclear a number of Qt build warnings on linux related to compiler flags
nhmall [Wed, 3 Feb 2021 18:18:43 +0000 (13:18 -0500)]
clear a number of Qt build warnings on linux related to compiler flags

option ‘-Wimplicit’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
option ‘-Wmissing-parameter-type’ is valid for C/ObjC but not for C++
option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++
option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

4 years agovariable set but not used warning in qt_yndlg.cpp
nhmall [Wed, 3 Feb 2021 17:56:55 +0000 (12:56 -0500)]
variable set but not used warning in qt_yndlg.cpp

../win/Qt/qt_yndlg.cpp: In member function ‘char nethack_qt_::NetHackQtYnDialog::Exec()’:
../win/Qt/qt_yndlg.cpp:80:9: warning: variable ‘ch_per_line’ set but not used [-Wunused-but-set-variable]
   80 |     int ch_per_line=6;
      |         ^~~~~~~~~~~

4 years agoprevent a warning about a multi-line comment in qt_svsel.cpp
nhmall [Wed, 3 Feb 2021 17:51:26 +0000 (12:51 -0500)]
prevent a warning about a multi-line comment in qt_svsel.cpp

4 years agoQt c++ function name shadow warnings
nhmall [Wed, 3 Feb 2021 15:55:07 +0000 (10:55 -0500)]
Qt c++ function name shadow warnings

We have a struct called mkroom and a function called mkroom()
so c++ complains about the mkroom() function hiding the
initializer for the struct.

Similarly, we have a struct called attack and a function
called attack().

There may be a more elegant way of eliminating those two
warnings, but renaming mkroom() to do_mkroom() and
attack() to do_attack() was straightforward enough.

4 years agowording fix
nhmall [Wed, 3 Feb 2021 14:42:59 +0000 (09:42 -0500)]
wording fix

4 years agoextend the Qt clang fix pertaining to shadowing of global variables to g++
nhmall [Wed, 3 Feb 2021 14:22:57 +0000 (09:22 -0500)]
extend the Qt clang fix pertaining to shadowing of global variables to g++

4 years agoWindows format string bits
nhmall [Wed, 3 Feb 2021 02:53:13 +0000 (21:53 -0500)]
Windows format string bits

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
keni [Wed, 3 Feb 2021 01:46:54 +0000 (20:46 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agosrc/end.c: improve backtrace text spacing (see #K3259)
keni [Wed, 3 Feb 2021 01:45:45 +0000 (20:45 -0500)]
src/end.c: improve backtrace text spacing (see #K3259)

4 years agomore macOS whitelisting
nhmall [Wed, 3 Feb 2021 01:11:43 +0000 (20:11 -0500)]
more macOS whitelisting

X11, Qt, and util

also ensure the functional warnings.h macro definitions are used
with c++ clang compiler

4 years agowhitelist some macOS clang format-nonliteral warnings
nhmall [Wed, 3 Feb 2021 00:50:07 +0000 (19:50 -0500)]
whitelist some macOS clang format-nonliteral warnings

4 years agoenable -Wformat-nonliteral for linux and equivalent for windows compilers
nhmall [Wed, 3 Feb 2021 00:03:12 +0000 (19:03 -0500)]
enable -Wformat-nonliteral for linux and equivalent for windows compilers

Whitelist all the verified existing triggers:
makedefs.c: In function ‘name_file’
attrib.c: one compiler balks at a ? b : c for fmtstring
cmd.c: In function ‘extcmd_via_menu’
cmd.c: In function ‘wiz_levltyp_legend’
do.c: In function ‘goto_level’
do_name.c: In function ‘coord_desc’
dungeon.c: In function ‘overview_stats’
eat.c:  one compiler balks at a ? b : c for fmtstring
end.c:  one compiler balks at a ? b : c for fmtstring
engrave.c: In function ‘engr_stats’
hack:c one compiler balks at a ? b : c for fmtstring
hacklib.c: one compiler balks at a ? b : c for fmtstring
insight.c: one compiler balks at a ? b : c for fmtstring
invent.c: In function ‘let_to_name’
light.c: In function ‘light_stats’
mhitm.c: In function ‘missmm’
options.c: In function ‘handler_symset’
options.c: In function ‘basic_menu_colors’
options.c: In function ‘optfn_o_autopickup_exceptions’
options.c: In function ‘optfn_o_menu_colors’
options.c: In function ‘optfn_o_message_types’
options.c: In function ‘optfn_o_status_cond’
options.c: In function ‘optfn_o_status_hilites’
options.c: In function ‘doset’
options.c: In function ‘doset_add_menu’
options.c: In function ‘show_menu_controls’
options.c: In function ‘handle_add_list_remove’
pager.c: In function ‘do_supplemental_info’
pager.c: In function ‘dohelp’
region.c: In function ‘region_stats’
rumors.c: sscanf usage
sounds.c: In function ‘domonnoise’
spell.c: In function ‘dospellmenu’
timeout.c: In function ‘timer_stats’
topten.c: In function ‘outentry’, fscanf, sscanf, fprintf usage
windows.c: In function ‘genl_status_update’
zap.c: one compiler balks at a ? b : c for fmtstring
win/curses/cursstat.c: In function ‘curses_status_update’
win/tty/wintty.c: In function ‘tty_status_update’
win/win32/mswproc.c: In function ‘mswin_status_update’

4 years agoadd format string arg to Sprintf in hack.c
nhmall [Tue, 2 Feb 2021 22:20:41 +0000 (17:20 -0500)]
add format string arg to Sprintf in hack.c

4 years agowarning fix - missing format string in botl.c
nhmall [Tue, 2 Feb 2021 21:06:25 +0000 (16:06 -0500)]
warning fix - missing format string in botl.c

4 years agoresolve a warning in sounds.c
nhmall [Tue, 2 Feb 2021 01:02:12 +0000 (20:02 -0500)]
resolve a warning in sounds.c

sounds.c: In function ‘add_sound_mapping’:
sounds.c:1381:33: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
 1381 |         Sprintf(filespec, "%s/%s", sounddir, filename);
      |                                 ^
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from sounds.c:5:
../include/global.h:274:24: note: ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
  274 | #define Sprintf (void) sprintf
sounds.c:1381:9: note: in expansion of macro ‘Sprintf’
 1381 |         Sprintf(filespec, "%s/%s", sounddir, filename);
      |         ^~~~~~~

4 years agoclear some more format-overflow warnings
nhmall [Mon, 1 Feb 2021 21:36:17 +0000 (16:36 -0500)]
clear some more format-overflow warnings

clear some -Wformat-overflow warnings being experienced with
i586-pc-msdosdjgpp-gcc (GCC) 10.2.0 cross-compiler

--
Warnings log:

botl.c: In function 'status_hilite_menu_add':
botl.c:3661:38: warning: ' or ' directive writing 4 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
 3661 |                     Sprintf(obuf, "%s or %s",
      |                                      ^~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from botl.c:6:
../include/global.h:274:24: note: 'sprintf' output between 5 and 163 bytes into a destination of size 80
  274 | #define Sprintf (void) sprintf
botl.c:3661:21: note: in expansion of macro 'Sprintf'
 3661 |                     Sprintf(obuf, "%s or %s",
      |                     ^~~~~~~

do_name.c: In function 'getpos_menu':
do_name.c:594:37: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |                                     ^
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from do_name.c:6:
../include/global.h:274:24: note: 'sprintf' output 1 or more bytes (assuming 257) into a destination of size 256
  274 | #define Sprintf (void) sprintf
do_name.c:594:13: note: in expansion of macro 'Sprintf'
  594 |             Sprintf(fullbuf, "%s%s%s", firstmatch,
      |             ^~~~~~~

dungeon.c: In function 'print_dungeon':
dungeon.c:2172:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |                           ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 10 and 1427 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2172:13: note: in expansion of macro 'Sprintf'
 2172 |             Sprintf(buf, "%s: %s %d", dptr->dname, descr, dptr->depth_start);
      |             ^~~~~~~
dungeon.c:2169:27: warning: '%s' directive writing up to 1407 bytes into a region of size 256 [-Wformat-overflow=]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                           ^~
dungeon.c:2169:26: note: directive argument in the range [-21474836472147483646]
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |                          ^~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output 10 or more bytes (assuming 1427) into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:2169:13: note: in expansion of macro 'Sprintf'
 2169 |             Sprintf(buf, "%s: %s %d to %d", dptr->dname, makeplural(descr),
      |             ^~~~~~~
dungeon.c: In function 'print_mapseen':
dungeon.c:3185:33: warning: '%s' directive writing up to 255 bytes into a region of size 249 [-Wformat-overflow=]
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |                                 ^~                                ~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 37 and 292 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3185:9: note: in expansion of macro 'Sprintf'
 3185 |         Sprintf(outbuf, " (play %s to open or close drawbridge)", tmp);
      |         ^~~~~~~
dungeon.c:3350:35: warning: '%s' directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |                                   ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from dungeon.c:6:
../include/global.h:274:24: note: 'sprintf' output between 18 and 273 bytes into a destination of size 256
  274 | #define Sprintf (void) sprintf
dungeon.c:3350:9: note: in expansion of macro 'Sprintf'
 3350 |         Sprintf(buf, "%sThe castle%s.", PREFIX, tunesuffix(mptr, tmpbuf));
      |         ^~~~~~~

explode.c:541:69: warning: '%s' directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                                                                     ^~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from explode.c:5:
../include/global.h:274:24: note: 'sprintf' output 21 or more bytes (assuming 276) into a destination of size 256
  274 | #define Sprintf (void) sprintf
explode.c:541:21: note: in expansion of macro 'Sprintf'
  541 |                     Sprintf(g.killer.name, "caught %sself in %s own %s", uhim(),
      |                     ^~~~~~~

hacklib.c: In function 'yyyymmddhhmmss':
hacklib.c:1034:28: warning: '%02d' directive writing between 2 and 11 bytes into a region of size between 4 and 11 [-Wformat-overflow=]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                            ^~~~
hacklib.c:1034:22: note: directive argument in the range [-21474836472147483647]
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../include/config.h:631,
                 from ../include/hack.h:10,
                 from hacklib.c:7:
../include/global.h:274:24: note: 'sprintf' output between 15 and 67 bytes into a destination of size 15
  274 | #define Sprintf (void) sprintf
hacklib.c:1034:5: note: in expansion of macro 'Sprintf'
 1034 |     Sprintf(datestr, "%04ld%02d%02d%02d%02d%02d", datenum, lt->tm_mon + 1,
      |     ^~~~~~~

4 years agoyet-another typo
nhmall [Mon, 1 Feb 2021 18:46:54 +0000 (13:46 -0500)]
yet-another typo

4 years agofollow-up bit
nhmall [Mon, 1 Feb 2021 18:44:09 +0000 (13:44 -0500)]
follow-up bit

missed macro and a typo

4 years agomore warnings.h - macOS issue
nhmall [Mon, 1 Feb 2021 18:37:04 +0000 (13:37 -0500)]
more warnings.h - macOS issue

It turns out that macOS barked when a POP was issued without
a prior PUSH, so since the DISABLE_WARNING_CONDEXPR_IS_CONSTANT
expanded to an empty macro on that platform.

Include a corresponding
RESTORE_WARNING_CONDEXPR_IS_CONSTANT macro for use with that
particular warning.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Mon, 1 Feb 2021 18:24:08 +0000 (13:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agovisual studio project update; also recover.c
nhmall [Mon, 1 Feb 2021 18:24:14 +0000 (13:24 -0500)]
visual studio project update; also recover.c

4 years agoWindows nmake build warnings during compiles of Lua sources
nhmall [Mon, 1 Feb 2021 18:03:32 +0000 (13:03 -0500)]
Windows nmake build warnings during compiles of Lua sources

4 years agosuppress a particular warning for an individual function; useful for non-gcc
nhmall [Mon, 1 Feb 2021 17:54:19 +0000 (12:54 -0500)]
suppress a particular warning for an individual function; useful for non-gcc

Microsoft and other non-GNU compilers don't recognize gcc tricks
like  /*NOTREACHED*/ to suppress individual warnings. clang recognizes most
of them because it tries to be gcc-compatible. Because of that, a lot of
potentially useful warnings have had to be completely suppressed in the
past in all source files when using the non-gcc compatible compilers.

Now that the code is C99, take advantage of a way to suppress warnings for
individual functions, a big step up from suppressing the warnings
altogether.

Unfortunately, it does require a bit of ugliness caused by the
insertion of some macros in a few spots, but I'm not aware of
a cleaner alternative that still allows warnings to be enabled
in general, while suppressing a warning for known white-listed
instances.

Prior to the warning-tiggering function, place whichever one of
the following is needed to suppress the warning being encountered:

DISABLE_WARNING_UNREACHABLE_CODE
DISABLE_WARNING_CONDEXPR_IS_CONSTANT

After the warning-triggering function, place this:

RESTORE_WARNINGS

Under the hood, the compiler-appropriate warning-disabling
mechanics involve the use of C99 _Pragma, which can be used
in macros.

For unrecognized or inappropriate compilers, or if
DISABLE_WARNING_PRAGMAS is defined, the macros expand
to nothing.

4 years agounify code for extracting an object from a monster's inventory PR #455
nhmall [Mon, 1 Feb 2021 14:41:21 +0000 (09:41 -0500)]
unify code for extracting an object from a monster's inventory PR #455

Closes #455

4 years agoMerge branch 'copperwater-pr455-2' into NetHack-3.7
nhmall [Mon, 1 Feb 2021 14:40:11 +0000 (09:40 -0500)]
Merge branch 'copperwater-pr455-2' into NetHack-3.7

4 years agowording bit
nhmall [Mon, 1 Feb 2021 02:34:23 +0000 (21:34 -0500)]
wording bit

4 years agofixes37.0 catch up for macOS Xcode issue
nhmall [Mon, 1 Feb 2021 02:32:03 +0000 (21:32 -0500)]
fixes37.0 catch up for macOS Xcode issue

4 years agooutdated files in Xcode project
nhmall [Mon, 1 Feb 2021 02:18:48 +0000 (21:18 -0500)]
outdated files in Xcode project