Commit Graph

11703 Commits

Author SHA1 Message Date
Dean Luick
3da8dca836 Add missing fields in extcmdlist[] in cmd.c
This eliminates a compiler initializer warning.
2021-01-29 11:41:12 -06:00
Dean Luick
2f4f7d22d3 Fix align type mixup wth align mask
Fix two cases of missed conversion of an alignment to an align mask.

Change induced_align()'s return type to unsigned int since it returns
an align mask (unsigned), not an align type (signed).
2021-01-29 09:31:08 -06:00
Dean Luick
2c38749cab Update code style for ANSI function prototypes 2021-01-29 09:01:15 -06:00
Dean Luick
cf3ad240ac Fix X11 warnings 2021-01-28 21:12:06 -06:00
Dean Luick
8ddab09cab Fix set but not used warnings 2021-01-28 21:11:21 -06:00
PatR
407acbf987 fix class discovery for fully discovered class
This was caused by a post-3.6 change I made when adding sorting
capability to '`' (and to '\' but that wasn't affected).  Cited
case was lack of "water" when all potions had been discovered.
Some other classes (but not all) were vulnerable too.
2021-01-28 17:10:18 -08:00
PatR
41956e5798 fix #K3255 - "death wand"
Prevent a wish request of "death wand" (as alternate spelling
for "wand of death") from matching "Death" monster and yielding
a random wand.

"death finger" and "death finger spellbook" produce a "spellbook
of finger of death" even without a similar fix.
2021-01-28 17:00:13 -08:00
nhmall
5bd95649de fix some warnings seen by Microsoft Visual Studio compiler
../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'x1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'x' used
../src/nhlsel.c(467) : warning C4701: potentially uninitialized local variable 'y1' used
../src/nhlsel.c(591) : warning C4701: potentially uninitialized local variable 'y' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'x2' used
../src/nhlsel.c(469) : warning C4701: potentially uninitialized local variable 'y2' used
2021-01-28 09:45:16 -05:00
nhmall
0714ddcef8 update msdos djgpp cross-compiler gcc version 2021-01-28 08:02:45 -05:00
nhmall
f625a8c553 remove more FDECL, NDECL macro usage 2021-01-28 07:55:34 -05:00
Pasi Kallinen
b502a7d9b2 Remove leftover variables 2021-01-28 12:44:45 +02:00
nhmall
0b518d0cee Windows Makefile.msc update 2021-01-27 23:07:52 -05:00
nhmall
f01b4f0bf0 a couple of old-style function declarations in Windows code 2021-01-27 21:52:55 -05:00
nhmall
9d93e1e52a follow-up bits 2021-01-27 21:04:51 -05:00
nhmall
f963c5aca7 switch source tree from k&r to c99 2021-01-26 21:06:16 -05:00
PatR
a2a9cb7b4f X11 fancy status coloring cleanup
Fix a couple of warnings and do some reformatting.

Also tracks current color and attributes for each status field
and only updates them if they're being changed instead of every
time the value changes.  Not very thoroughly tested so far.

The only attribute being supported is inverse but tty-style
status supports the full set.  Also, changed values are always
highlighted in inverse even if there is no highlight rule.
That should probably only apply when 'statushilites' is 0,
giving the old fancy status highlighting when regular hilites
are turned off.
2021-01-26 13:54:43 -08:00
PatR
acbf423734 pull request #443 - X11 color status highlighting
for 'fancy status'.  This is from an emailed diff rather than
directly from git, and the git code has a bunch of commits,
so this may or may not match the latest.  It needs formatting
cleanup and triggers a couple of warnings on OSX.  Fix to follow.

Status highlight colors use the same names as menu coloring
but this uses different X11 colors for the two sets.  That
will have to be changed so that yellow either means yellow all
the time or goldenrod all the time instead of sometimes yellow
and sometimes goldenrod.

Adopts #443
2021-01-26 13:39:50 -08:00
nhmall
ea12c70e46 X11 warning on macOS 2021-01-26 10:27:51 -05:00
nhmall
939f20e2ea fix warning differently mklev.c 2021-01-26 08:48:38 -05:00
nhmall
62f25fd000 clear five warnings for "set but not used" variables
Note: the line numbers referenced in the warning messages below are not in sync
with the NetHack-3.7 branch and should be disregarded

files.c: In function 'get_saved_games':
files.c:1168:9: warning: unused variable 'n' [-Wunused-variable]
 1168 |     int n, j = 0;
      |         ^

mhitm.c: In function 'mdamagem':
mhitm.c:843:13: warning: variable 'cancelled' set but not used [-Wunused-but-set-variable]
  843 |     boolean cancelled;
      |             ^~~~~~~~~

mhitu.c: In function 'hitmu':
mhitu.c:943:9: warning: variable 'uncancelled' set but not used [-Wunused-but-set-variable]
  943 |     int uncancelled;
      |         ^~~~~~~~~~~

mklev.c: In function 'place_branch':
mklev.c:1214:20: warning: variable 'br_room' set but not used [-Wunused-but-set-variable]
 1214 |     struct mkroom *br_room;
      |                    ^~~~~~~

monmove.c: In function 'm_move':
monmove.c:874:43: warning: variable 'doorbuster' set but not used [-Wunused-but-set-variable]
  874 |     boolean can_open = 0, can_unlock = 0, doorbuster = 0;
      |                                           ^~~~~~~~~~
2021-01-25 12:57:47 -05:00
PatR
8a965b8cf9 \#wizintrinsic timeout values
Tell/remind wizard mode player how to specify timeout amounts
when using #wizintrinsic to set temporary timeouts.
2021-01-24 13:55:19 -08:00
PatR
8af63bf1a4 fix github issue #447 - casting area-effect spell
at self when blind.  Spell targetting would let player pick
hero's own spot but casting would reject it when blind because
hero didn't sense any monster there.  The player wanted to cast
skilled fireball at self to cure being turned into slime but
wasn't allowed.  (Targetting an adjacent spot would work for
fireball, but is only feasible when telepathy reveals a monster
there.)

While testing the one-line fix, I noticed that the message line
(tty) showed stale data (autodescribe info for target spot) as
the fireball I cast (when not blind) bounced around the vicinity.
Normally that's cleared when a message is issued or the when the
next command is requested, but skilled fireball causes multiple
explosion animations before either of those situations.
2021-01-24 13:00:44 -08:00
PatR
35b343b50b options parsing one more time
Manually created and maintained prototypes for optfn_FOO()
aren't needed once the conditionals in optlist.h and options.c
match each other.
2021-01-23 18:46:03 -08:00
PatR
31046826f5 couple of missing Qt prototypes
Shut up two missing prototype warnings.
2021-01-23 15:58:23 -08:00
PatR
8affbf5a24 options parsing madness
I should have reenabled curses before committing an earlier change;
it broke compile.

Make all optfn_FOO() be static in options.c;
fix newly added prototype for optfn_cursesgraphics();
fix conditionals for optfn_palette(), both prototype and function.

Also, add missing prototype for a sound routine.
2021-01-23 15:42:00 -08:00
PatR
ab74ed2c20 SELECTSAVED handling
By default, enable the SELECTSAVED option for everyone instead
of just for Windows or Qt.  And make Qt obey the 'selectsaved'
run-time option.

It can be disabled in config.h if necessary.
2021-01-23 15:02:11 -08:00
PatR
a1eb06b462 cursesgraphics
Not sure whether it was because I hadn't build without curses
in a long time or because of recent changes in warning settings
in the hints, but optfn_cursesgraphics() first drew a complaint
about lack of prototype, then after I added one and made it be
static, about a static routine not being used.
2021-01-23 14:58:28 -08:00
Bart House
a124114bce NetHackW: fix rendering of animations
Animations render by changing map state and calling delay.  When we delay,
we must ensure map windoow has been updated to show latest state before
we delay.
2021-01-23 12:04:16 -08:00
Bart House
d6b435a1d8 NetHackW: fix focus flashing when using far look
Changed when we update the map window back buffer.  We now defer all
back buffer renderig until mswin_map_update is called.  We update
the window only within the main message loop thus we should only
get fully coherent map state rendered prior to getting input.
2021-01-23 11:44:35 -08:00
nhmall
093c53bead fix missing prototype warning for Qt SELECTSAVED
For whatever reason, Qt relies on late #define of SELECTSAVED
inside files.c.

The prototype in extern.h is therefore not picked up with
as a result of #include "hack.h"

Options were:
1. remove the conditional #if defined(SELECTSAVED) around the
   prototype in extern.h entirely
2. Move the forced #define of SELECTSAVED above the #include "hack.h"
3. Alter the conditional in extern.h to also include the condition for
   the forced #define of SELECTSAVED inside files.c

This goes with option #3.
2021-01-23 09:37:47 -05:00
nhmall
4487c1014f fix warning in restore.c
restore.c:909:1: warning: no previous prototype for ‘rest_stairs’ [-Wmissing-prototypes]
  909 | rest_stairs(nhfp)
      | ^~~~~~~~~~~
2021-01-23 09:15:15 -05:00
nhmall
0a85a9c731 fix warning in invent.c
invent.c:1459:1: warning: no previous prototype for ‘mime_action’ [-Wmissing-prototypes]
 1459 | mime_action(word)
      | ^~~~~~~~~~~
2021-01-23 09:07:33 -05:00
nhmall
3334f51a74 unused variable in files.c 2021-01-23 08:58:59 -05:00
nhmall
8e7612a49c fix a warning in display.c
display.c: In function ‘redraw_map’:
display.c:1460:15: warning: variable ‘glyph’ set but not used [-Wunused-but-set-variable]
 1460 |     int x, y, glyph;
      |               ^~~~~
2021-01-23 08:49:04 -05:00
Pasi Kallinen
a3c8dead91 Remove unused function 2021-01-23 15:19:34 +02:00
Pasi Kallinen
0516fa9e35 Fix leftover variables from trap refactor 2021-01-23 11:32:54 +02:00
Pasi Kallinen
0dd6960cb1 Fix article used for steed when stepping on trap
This was caused by the trap code refactor I did a month ago.
2021-01-23 11:25:53 +02:00
Pasi Kallinen
2b525aab02 Fix missing proto 2021-01-23 10:56:56 +02:00
nhmall
96ee175ce8 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2021-01-22 16:52:55 -05:00
nhw_cron
d76e13e057 This is cron-daily v1-Jan-20-2020. files updated: Files 2021-01-22 16:52:23 -05:00
nhmall
18a4a41b15 compiler settings alignment between macOS.2020 and linux.2020
get the warning flags on linux and macOS into better alignment

move the compiler flags into hints/include/compiler.2020 so that
maintenance changes can be made there and take effect for both
linux and macOS

this will likely trigger some initial new code warnings to be
investigated on either or both platforms
2021-01-22 16:05:30 -05:00
Michael Meyer
77d4b4c955 Allow custom increment amounts in #wizintrinsic
Let users of #wizintrinsic set a specific amount by which they want to
increment each particular timeout, by entering a count/typing in
numerals before selecting the item in the list.  I think doing it this
way should be pretty intuitive to players who are familiar with the
'enter count -> make selection' flow of normal inventory menus in
NetHack, and is simpler than using a separate prompt, as was mentioned
as a possibility in a comment.

When an intrinsic is selected without entering a count, the increment
will continue to default to the previous value of 30; this value is set
via the DEFAULT_TIMEOUT_INCR macro.

I also deleted a redundant declaration of wiz_intrinsic; the duplicate
seems to have been added by mistake in ff6139c6c5.
2021-01-22 22:34:54 +02:00
Pasi Kallinen
ad0c701127 Fix unused param 2021-01-22 18:16:08 +02:00
Pasi Kallinen
8681aec71b Fix uninitialized variable 2021-01-22 17:58:54 +02:00
Patric Mueller
f4e9104957 Bones levels information in xlogfile and enlightenment
- record number of encountered bones levels in xlogfile
  - add bonesless to extended conducts field in xlogfile
  - show bones levels information in enlightenment at end of game or in
    explore and wizmode
2021-01-22 00:22:09 +01:00
Pasi Kallinen
44bb68fe82 Curses: Select menu items via mouse 2021-01-21 12:53:02 +02:00
Dean Luick
3a30038b49 Add a missing fall-through comment
This eliminates a gcc warning.
2021-01-20 22:39:08 -06:00
Dean Luick
f63d435c6d Fix text replacement warning
Using strncpy to cut off copying a terminating NUL yields a gcc
warning.  Just use memcpy instead.
2021-01-20 22:37:37 -06:00
Dean Luick
5dc5ece412 Remove left-over valid file checking
Commit 7054e06e42 ("NetHack minor release checklist items - savefiles")
consolidated valid file checking into the function viable_nhfile().  This
commit removes unused variables left over from that change.
2021-01-20 22:34:07 -06:00
Dean Luick
16ba1a583a Update nhUse
There is no longer any compiler reason to disable nhUse - remove
nhUse's conditional definition.

Update the nhUse definition to "use" a variable without it needing
to be an integer.

This change removes some gcc compiler unused variable and parameter
warnings.
2021-01-20 22:18:34 -06:00