Skip to content

Commit

Permalink
Merge branch 'updates' into merges
Browse files Browse the repository at this point in the history
Fix up any fallthrough statements with the additional FALLTHROUGH introduced in this wave.
  • Loading branch information
elunna committed Dec 2, 2024
2 parents bbbed15 + d0d179e commit 3acb211
Show file tree
Hide file tree
Showing 131 changed files with 2,240 additions and 935 deletions.
45 changes: 24 additions & 21 deletions Cross-compiling
Original file line number Diff line number Diff line change
Expand Up @@ -361,41 +361,44 @@ Using the cross-compiler, build the following targets:
cross-compile and link with these compiler switches:
-DCROSSCOMPILE and -DCROSSCOMPILE_TARGET

core sources (2019): src/allmain.c, src/alloc.c, src/apply.c,
core sources (2024): src/allmain.c, src/alloc.c, src/apply.c,
src/artifact.c, src/attrib.c, src/ball.c,
src/bones.c, src/botl.c, src/cmd.c, src/dbridge.c,
src/bones.c, src/botl.c, src/calendar.c,
src/coloratt.c, src/cmd.c, src/dbridge.c,
src/decl.c, src/detect.c, src/dig.c, src/display.c,
src/dlb.c, src/do.c, src/do_name.c, src/do_wear.c,
src/dog.c, src/dogmove.c, src/dokick.c,
src/dothrow.c, src/drawing.c, src/dungeon.c,
src/eat.c, src/end.c, src/engrave.c, src/exper.c,
src/explode.c, src/extralev.c, src/files.c,
src/fountain.c, src/hack.c, src/hacklib.c,
src/insight.c, src/invent.c, src/isaac64.c,
src/light.c, src/lock.c, src/mail.c,
src/makemon.c, src/mcastu.c,
src/fountain.c, src/getpos.c, src/glyphs.c,
src/hack.c, src/hacklib.c, src/insight.c,
src/invent.c, src/isaac64.c, src/light.c,
src/lock.c, src/mail.c, src/makemon.c, src/mcastu.c,
src/mdlib.c, src/mhitm.c, src/mhitu.c, src/minion.c,
src/mklev.c, src/mkmap.c, src/mkmaze.c, src/mkobj.c,
src/mkroom.c, src/mon.c, src/mondata.c,
src/monmove.c, src/monst.c, src/mplayer.c,
src/mthrowu.c, src/muse.c, src/music.c,
src/nhlsel.c, src/nhlua.c, src/nhlobj.c,
src/o_init.c, src/objects.c, src/objnam.c,
src/options.c, src/pager.c, src/pickup.c,
src/pline.c, src/polyself.c, src/potion.c,
src/pray.c, src/priest.c, src/quest.c,
src/nhlua.c, src/nhlsel.c, src/nhlobj.c,
src/nhmd4.c, src/objects.c, src/o_init.c,
src/objnam.c, src/options.c, src/pager.c,
src/pickup.c, src/pline.c, src/polyself.c,
src/potion.c, src/pray.c, src/priest.c, src/quest.c,
src/questpgr.c, src/read.c, src/rect.c,
src/region.c, src/restore.c, src/rip.c, src/rnd.c,
src/role.c, src/rumors.c, src/save.c, src/sfstruct.c,
src/shk.c, src/shknam.c, src/sit.c, src/sounds.c,
src/sp_lev.c, src/spell.c, src/steal.c, src/steed.c,
src/region.c, src/report.c, src/restore.c,src/rip.c,
src/rnd.c, src/role.c, src/rumors.c, src/save.c,
src/selvar.c, src/sfstruct.c, src/shk.c,
src/shknam.c, src/sit.c, src/sounds.c, src/sp_lev.c,
src/spell.c, src/stairs.c, src/steal.c, src/steed.c,
src/symbols.c, src/sys.c, src/teleport.c,
src/timeout.c, src/topten.c, src/track.c,
src/trap.c, src/u_init.c, src/uhitm.c, src/vault.c,
src/version.c, src/vision.c,
src/weapon.c, src/were.c, src/wield.c, src/windows.c,
src/wizard.c, src/worm.c, src/worn.c, src/write.c,
src/zap.c, sys/share/cppregex.cpp
src/trap.c, src/u_init.c, src/uhitm.c,
src/utf8map.c, src/vault.c, src/version.c,
src/vision.c, src/weapon.c, src/were.c, src/wield.c,
src/windows.c, src/wizard.c, src/wizcmds.c,
src/worm.c, src/worn.c, src/write.c, src/zap.c,
sys/share/cppregex.cpp

tty sources: win/tty/getline.c, win/tty/termcap.c,
win/tty/topl.c, win/tty/wintty.c
Expand Down Expand Up @@ -695,7 +698,7 @@ Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html


+--------------------------------+
| B7. Case sample: mips |
| B7. Case sample: mips |
+--------------------------------+

Cross-compiler used: gcc-mipsel-linux-gnu, g++-mipsel-linux-gnu
Expand Down
5 changes: 5 additions & 0 deletions DEVEL/Developer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ NOTE: These instructions assume you are on the default branch; this _is_
NOTE: The following instructions require perl. If you do not have perl on
your system, please install it before proceeding.

NOTE: More information on nhgitset.pl is available before installation via:
perldoc DEVEL/nhgitset.pl
After installation, the same information is available with:
git nhhelp nhgitset

A. If you have never set up git on this machine before:
(This assumes you will only be using git for NetHack. If you are going to
use it for other projects as well, think before you type.)
Expand Down
44 changes: 4 additions & 40 deletions DEVEL/VERSION
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
4
Fixes:
- "nhcommit -a" has been fixed
- NHDT was hardwired in places
- no longer complain about a missing dat directory outside of the
NetHack source tree
- make update of gitinfo atomic
- Replace some hardwired directory separators with OS-dependent constructs

Backwards Incompatibilities:
- NH_DATESUB's DATE() is now Date() to match the other variables
- MSYS2 requires an additional Perl package - the MSYS2 docs have
been updated

New Help System:
- git nhhelp
This command mirrors "git help" for nh* commands.
- See git nhhelp nhsub for general help on substitution variables

New Substitution Variables:
-Brev()
An aBREViation of $PREFIX-Branch$:$PREFIX-Revision$ - this
may help get line length under control in file headers.
-Assert(TYPE=VALUE)
If TYPE does not match VALUE, do not substitute on this line.
TYPE P checks VALUE against nethack.substprefix
-Project(arg)
Returns nethack.projectname if there is no arg and an uppercase
version if arg is uc.

Other New Features:
- Add nethack.projectname
- Documentation updates - see "git nhhelp nhsub"
- On checkout or merge of a branch, check for nhgitset version updates
- Move NH_DATESUB substitutions here from cron job to keep dates in sync
- PREFIX-* keywords now available in NH_DATESUB templates
- Support use of nhgitset.pl from a different repo; note that update
checks will be dependent on keeping the original source repo up-to-date
and in the same location.

5
Please see "git log DEVEL" for previous changes.
Make documentation of nhgitset.pl easier to find and
find out about.
68 changes: 45 additions & 23 deletions DEVEL/nhgitset.pl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ BEGIN

&add_help('NHsubst', 'NHsubst');
&add_help('NHgithook', 'NHgithook.pm');
&add_help('nhgitset', 'gitsetdocs', '../../DEVEL/nhgitset.pl');


# removed at version 3
Expand Down Expand Up @@ -183,7 +184,7 @@ BEGIN

print STDERR "Running directories\n" if($opt_v);

# copy directories into .git (right now that's just hooks
# copy directories into .git (right now that's just hooks and nhgitset.pl)
my @gitadd = length($gitadddir)?glob("$gitadddir$DS*"):undef;
foreach my $dir ( (glob("$srcdir$DS*"), @gitadd) ){
next unless(-d $dir);
Expand All @@ -209,6 +210,7 @@ BEGIN
&process_override($enddir, "POST");
}
}
&do_file_nhgitset();

&check_gitvars; # for variable substitution

Expand All @@ -219,26 +221,31 @@ BEGIN

exit 0;

# @files: [0] is the name under .git/hooks; others are places to
# check during configuration
sub add_help {
my($cmd, $file) = @_;
my($cmd, @files) = @_;

&add_config("nethack.aliashelp.$cmd", $file);
&add_config("nethack.aliashelp.$cmd", $files[0]);
# pull out =for nhgitset CMD description...
my $desc = '';
open my $fh, "<", "$DEVhooksdir/$file";
if($fh){
while(<$fh>){
m/^=for\s+nhgitset\s+\Q$cmd\E\s+(.*)/ && do {
$desc = $1;
last;
my $desc;
foreach my $file (@files){
open my $fh, "<", "$DEVhooksdir/$file";
if($fh){
while(<$fh>){
m/^=for\s+nhgitset\s+\Q$cmd\E\s+(.*)/ && do {
$desc = $1;
goto found;
}
}
close $fh;
} else {
warn "Can't open: '$DEVhooksdir/$file' ($!)\n";
}
close $fh;
} else {
warn "Can't open: '$DEVhooksdir/$file' ($!)\n";
}
found:

if(length $desc){
if($desc){
&add_config("nethack.aliasdesc.$cmd", $desc);
} else {
&add_config("nethack.aliasdesc.$cmd", "(no description available)");
Expand Down Expand Up @@ -344,13 +351,25 @@ sub do_dir_hooksdir {
}
}

__END__
(can we change the .gitattributes syntax to include a comment character?)
maybe [comment] attr.c:parse_attr_line
grr - looks like # is the comment character
sub do_file_nhgitset {
my $infile = "DEVEL/nhgitset.pl";
my $outfile = ".git/hooks/gitsetdocs";
open IN, "<", $infile or die "Can't open $infile:$!";
open OUT, ">", $outfile or die "Can't open $outfile:$!";
my $started;
print IN "die \"DO NOT RUN THIS FILE\n\"";
while(<IN>){
m/^__END__/ && do {$started =1; next};
print OUT if($started);
}
close OUT;
close IN;
}

#(can we change the .gitattributes syntax to include a comment character?)
#maybe [comment] attr.c:parse_attr_line
#grr - looks like # is the comment character
__END__
=head1 NAME
nhgitset.pl - Setup program for NetHack git repositories
Expand All @@ -363,9 +382,10 @@ =head1 SYNOPSIS
=head1 DESCRIPTION
nhgitset.pl installs NetHack-specific setup after a C<git clone> (or after
changes to the desired configuration, which are installed by re-running
nhgitset.pl).
nhgitset.pl installs NetHack-specific setup after a C<git clone> or after
changes to the setup, which are installed by re-running nhgitset.pl. If
an upgrade is needed, you will be informed during a C<git pull> or similar
operation.
The following options are available:
Expand Down Expand Up @@ -445,3 +465,5 @@ =head1 EXIT STATUS
1 Fail.
2 Intervention required.
=for nhgitset nhgitset NetHack git helper installer
36 changes: 20 additions & 16 deletions Files
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Porting README azure-pipelines.yml

DEVEL:
(files for people developing changes to NetHack)
Developer.txt code_features.txt code_style.txt git_recipes.txt
gitinfo.pl nhgitset.pl
Developer.txt VERSION code_features.txt code_style.txt
git_recipes.txt gitinfo.pl nhgitset.pl

DEVEL/DOTGIT:
(file for people developing changes to NetHack)
Expand All @@ -23,11 +23,11 @@ DEVEL/hooksdir:
(files for people developing changes to NetHack)
NHadd NHgithook.pm NHsubst
NHtext TARGET applypatch-msg
commit-msg nhsub post-applypatch
post-checkout post-commit post-merge
post-rewrite pre-applypatch pre-auto-gc
pre-commit pre-push pre-rebase
prepare-commit-msg
commit-msg nhhelp nhsub
post-applypatch post-checkout post-commit
post-merge post-rewrite pre-applypatch
pre-auto-gc pre-commit pre-push
pre-rebase prepare-commit-msg

dat:
(files for all versions)
Expand Down Expand Up @@ -93,15 +93,15 @@ dlb.h dungeon.h engrave.h extern.h flag.h
fnamesiz.h func_tab.h global.h hack.h hacklib.h
integer.h isaac64.h lint.h mail.h mextra.h
mfndpos.h micro.h mkroom.h monattk.h mondata.h
monflag.h monst.h monsters.h nhmd4.h obj.h
objclass.h objects.h optlist.h patchlevel.h pcconf.h
permonst.h prop.h quest.h rect.h region.h
rm.h seffects.h selvar.h skills.h sndprocs.h
sp_lev.h spell.h stairs.h sym.h sys.h
tcap.h tileset.h timeout.h tradstdc.h trap.h
unixconf.h vision.h vmsconf.h warnings.h winami.h
wincurs.h windconf.h winprocs.h wintype.h you.h
youprop.h
monflag.h monst.h monsters.h nhmd4.h nhregex.h
obj.h objclass.h objects.h optlist.h patchlevel.h
pcconf.h permonst.h prop.h quest.h rect.h
region.h rm.h seffects.h selvar.h skills.h
sndprocs.h sp_lev.h spell.h stairs.h sym.h
sys.h tcap.h tileset.h timeout.h tradstdc.h
trap.h unixconf.h vision.h vmsconf.h warnings.h
winami.h wincurs.h windconf.h winprocs.h wintype.h
you.h youprop.h

(file for tty versions)
wintty.h
Expand Down Expand Up @@ -532,6 +532,10 @@ sys/windows/vs/hacklib:
(file for Visual Studio 2019 or 2022 Community Edition builds)
hacklib.vcxproj

sys/windows/vs/lualib:
(file for Visual Studio 2019 or 2022 Community Edition builds)
lualib.vcxproj

sys/windows/vs/makedefs:
(files for Visual Studio 2019 or 2022 Community Edition builds)
aftermakedefs.proj makedefs.vcxproj
Expand Down
1 change: 0 additions & 1 deletion doc/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.6 NHSUBST
*.7 NHSUBST
fixes* NHSUBST
*.txt NHSUBST
config.nh NHSUBST
Guidebook.txt NH_header=no
tmac.n NH_header=no
Expand Down
1 change: 0 additions & 1 deletion doc/Guidebook.mn
Original file line number Diff line number Diff line change
Expand Up @@ -6680,4 +6680,3 @@ Izchak Miller Mike Stephenson
.sm "Brand and product names are trademarks or registered trademarks \
of their respective holders."
.\"EOF
changes
12 changes: 11 additions & 1 deletion doc/fixes3-7-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,14 @@ a pet with the hides-under attribute could "move reluctantly over" a cursed
object and then hide under it
prevent monster generation in the sokoban trap hallway
change MSGHANDLER from compile-time to sysconf option
allow changing extended command autocompletions via #optionsfull
if eating a tin's contents caused the hero to choke to death or turn to stone,
resulting bones would contain the tin still intact
when hero who is poly'd into metallivore form eats a tin, bypass "smells like
<monster>" feedback and the "Eat it?" prompt; just eat the contents
along with the tin without asking
digging in ice was handled inconsistently, particularly if done at the span
spot in front of closed drawbridge


Fixes to 3.7.0-x General Problems Exposed Via git Repository
Expand Down Expand Up @@ -2206,7 +2214,7 @@ curses: if user's terminal was set to 'application keypad mode' (DEC VTxxx
"ESC SPC G"), nethack wasn't recognizing number pad keys
curses: change petattr attributes, dropping support for curses-only ones
curses: swap the grey and no-color color initialization
curses: allow changing default colors with the 'palette' config option
curses+Qt: allow changing default colors with the 'palette' config option
(only if compiled with CHANGE_COLOR)
curses: if messages have been issued during start-up (for instance, warnings
about issues in run-time config file), prompt user to press <return>
Expand Down Expand Up @@ -2914,6 +2922,8 @@ split "cannot_push" on moverock_done() into a separate function (pr #1282
by argrath)
split making pits on do_earthquake() into a separate function and
eliminate some gotos on do_earthquake() (pr #1287 by argrath)
update the WASM cross-compile to work with the current
code (pr #1331 by guillaumebrunerie)


Code Cleanup and Reorganization
Expand Down
4 changes: 2 additions & 2 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@

#ifdef CRASHREPORT
# ifndef DUMPLOG_CORE
# define DUMPLOG_CORE // required to get ^P info
# define DUMPLOG_CORE // required to get ^P info
# endif
# ifdef MACOS
# define PANICTRACE
Expand Down Expand Up @@ -463,7 +463,7 @@
*/
#define INSURANCE /* allow crashed game recovery */

#ifndef MAC
#if !defined(MAC) && !defined(SHIM_GRAPHICS)
#define CHDIR /* delete if no chdir() available */
#endif

Expand Down
Loading

0 comments on commit 3acb211

Please sign in to comment.