From 8a328ff7eb5f7452150d17ce9fb8b79e0970edac Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 17 Aug 2019 12:55:48 -0400 Subject: [PATCH 1/3] quite some Xcode warnings --- src/mkmaze.c | 2 +- src/shk.c | 2 +- sys/unix/NetHack.xcodeproj/project.pbxproj | 1 + win/curses/cursstat.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mkmaze.c b/src/mkmaze.c index a9d0c1461..9079b1e4f 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1400,7 +1400,7 @@ movebubbles() struct bubble *b; struct container *cons; struct trap *btrap; - int x, y, i, j, bcpin; + int x, y, i, j, bcpin = 0; /* set up the portal the first time bubbles are moved */ if (!wportal) diff --git a/src/shk.c b/src/shk.c index fa29b1f31..f5c42bacd 100644 --- a/src/shk.c +++ b/src/shk.c @@ -4828,7 +4828,7 @@ void globby_bill_fixup(obj_absorber, obj_absorbed) struct obj *obj_absorber, *obj_absorbed; { - int x, y; + int x = 0, y = 0; struct bill_x *bp, *bp_absorber = (struct bill_x *) 0; struct monst *shkp = 0; struct eshk *eshkp; diff --git a/sys/unix/NetHack.xcodeproj/project.pbxproj b/sys/unix/NetHack.xcodeproj/project.pbxproj index 78b618ce9..94d7eacc0 100644 --- a/sys/unix/NetHack.xcodeproj/project.pbxproj +++ b/sys/unix/NetHack.xcodeproj/project.pbxproj @@ -1158,6 +1158,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 3189576821A1FCC100FB2ABE; productRefGroup = 3189577221A1FCC100FB2ABE /* Products */; diff --git a/win/curses/cursstat.c b/win/curses/cursstat.c index 4847308f0..664b9e31e 100644 --- a/win/curses/cursstat.c +++ b/win/curses/cursstat.c @@ -907,7 +907,7 @@ curs_HPbar(char *text, /* pre-padded with trailing spaces if short */ { #ifdef STATUS_HILITES #ifdef TEXTCOLOR - int coloridx; + int coloridx = 0; #endif #endif /* STATUS_HILITES */ int k, bar_pos; From b7b8c7a44637b7253d1723a30bca8d541e3c240c Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 20 Aug 2019 17:16:57 -0700 Subject: [PATCH 2/3] sys/unix/hints/*: mkfontdir and cp -n Change all the POSTINSTALL 'mkfontdir' to 'mkfontdir -x .lev' although the mkfontdir version on my system didn't think $(HACKDIR)/*.lev were font files when I built without dlb. Also change the PREINSTALL 'cp -n win/X11/nethack.rc ~/.nethackrc' to keep going if it fails. The linux hints use 'cp -n' for sysconf but since it is doing so for the playground directory and 'make install' starts out by clearing away everything in that directory, it shouldn't fail. But some extra bullet proofing there may be warranted. Only the initial cp is protected against clobbering an existing file; the ownership+permission fixups that are applied to the copy of original file still get applied to an existing one. --- sys/unix/hints/linux-qt4 | 4 ++-- sys/unix/hints/linux-qt5 | 4 ++-- sys/unix/hints/linux-x11 | 4 ++-- sys/unix/hints/macosx | 9 ++++----- sys/unix/hints/macosx10.10 | 9 +++++---- sys/unix/hints/macosx10.10-qt | 10 +++++----- sys/unix/hints/macosx10.14 | 6 +++--- sys/unix/hints/macosx10.5 | 9 +++++---- sys/unix/hints/macosx10.7 | 9 +++++---- sys/unix/hints/macosx10.8 | 8 ++++---- 10 files changed, 37 insertions(+), 35 deletions(-) diff --git a/sys/unix/hints/linux-qt4 b/sys/unix/hints/linux-qt4 index 804118562..910345ed1 100644 --- a/sys/unix/hints/linux-qt4 +++ b/sys/unix/hints/linux-qt4 @@ -1,5 +1,5 @@ # -# NetHack 3.6 linux-qt4 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +# NetHack 3.6 linux-qt4 $NHDT-Date: 1566346592 2019/08/21 00:16:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.27 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -18,7 +18,7 @@ VARDIR = $(HACKDIR) POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); CFLAGS=-g -O -I../include -DNOTPARMDECL CFLAGS+=-DHACKDIR=\"$(HACKDIR)\" diff --git a/sys/unix/hints/linux-qt5 b/sys/unix/hints/linux-qt5 index 9a561130f..c1b13d890 100644 --- a/sys/unix/hints/linux-qt5 +++ b/sys/unix/hints/linux-qt5 @@ -1,5 +1,5 @@ # -# NetHack 3.6 linux-qt5 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +# NetHack 3.6 linux-qt5 $NHDT-Date: 1566346602 2019/08/21 00:16:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.27 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -18,7 +18,7 @@ VARDIR = $(HACKDIR) POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir -x .lev); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); CFLAGS=-g -O -I../include -DNOTPARMDECL CFLAGS+=-DHACKDIR=\"$(HACKDIR)\" diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index 3b1caf8d9..2f340e981 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -1,5 +1,5 @@ # -# NetHack 3.6 linux-x11 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +# NetHack 3.6 linux-x11 $NHDT-Date: 1566346602 2019/08/21 00:16:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.24 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -18,7 +18,7 @@ VARDIR = $(HACKDIR) POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir -x .lev); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); CFLAGS=-g -O -I../include -DNOTPARMDECL CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" diff --git a/sys/unix/hints/macosx b/sys/unix/hints/macosx index 0cd98b3fa..573473249 100644 --- a/sys/unix/hints/macosx +++ b/sys/unix/hints/macosx @@ -1,13 +1,12 @@ # -# NetHack 3.6 macosx $NHDT-Date: 1447844580 2015/11/18 11:03:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ +# NetHack 3.6 macosx $NHDT-Date: 1566346603 2019/08/21 00:16:43 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.20 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.4.10 (Darwin 8.10). If this doesn't work for some -# other version of either Darwin or Mac OS X, make a new file for that OS, -# don't change this one. And let us know about it. +# This is for Mac OS X 10.4 (Darwin 8.10). Use one of the more specific +# hints files for later versions. # Useful info: http://www.opensource.apple.com/darwinsource/index.html # This hints file can build several different types of installations. @@ -72,7 +71,7 @@ WINOBJ += $(WINX11OBJ) WINLIB += $(WINX11LIB) LFLAGS=-L/usr/X11R6/lib VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir) +POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ) CFLAGS += -DX11_GRAPHICS endif diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index e53a80d77..279a15ec3 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -1,11 +1,11 @@ # -# NetHack 3.6 macosx10.11 $NHDT-Date: 1546220383 2018/12/31 01:39:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.51 $ +# NetHack 3.6 macosx10.11 $NHDT-Date: 1566346603 2019/08/21 00:16:43 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.53 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.10 or later, and has been tested on 10.11 +# This is for Mac OS X 10.10 through 10.13, and has been tested on 10.11 # (El Capitan) and 10.13. If this doesn't work for some other # version of Mac OS X, make a new file for that OS, don't change this one. # And let us know about it. @@ -108,7 +108,8 @@ endif ifdef WANT_WIN_X11 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir); +# -x: if built without dlb, some versions of mkfontdir think *.lev are fonts +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev ); # separate from CFLAGS so that we don't pass it to every file X11CFLAGS = -I/opt/X11/include CFLAGS += -DX11_GRAPHICS @@ -204,7 +205,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/macosx10.10-qt b/sys/unix/hints/macosx10.10-qt index 3d9747649..865c2d20a 100644 --- a/sys/unix/hints/macosx10.10-qt +++ b/sys/unix/hints/macosx10.10-qt @@ -1,12 +1,12 @@ # -# NetHack 3.6 macosx10.11 $NHDT-Date: 1515549543 2018/01/10 01:59:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ +# NetHack 3.6 macosx10.11 $NHDT-Date: 1566346604 2019/08/21 00:16:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.51 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.10 or later, and has been tested on 10.11 -# (El Capitan). If this doesn't work for some other +# This is for the Qt interface on Mac OS X 10.10 through 10.13, and has +# been tested on 10.11 (El Capitan). If this doesn't work for some other # version of Mac OS X, make a new file for that OS, don't change this one. # And let us know about it. # Useful info: http://www.opensource.apple.com/darwinsource/index.html @@ -106,7 +106,7 @@ WINOBJ0 += $(WINX11OBJ) WINLIB += $(WINX11LIB) LFLAGS += -L/opt/X11/lib VARDATND += x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev ); CFLAGS += -DX11_GRAPHICS -I/opt/X11/include # avoid repeated complaints about _X_NONNULL(args...) in CFLAGS += -Wno-variadic-macros @@ -184,7 +184,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/macosx10.14 b/sys/unix/hints/macosx10.14 index c5e5a0cf1..751ba7774 100644 --- a/sys/unix/hints/macosx10.14 +++ b/sys/unix/hints/macosx10.14 @@ -1,5 +1,5 @@ # -# NetHack 3.6 macosx10.14 $NHDT-Date: 1546225353 2018/12/31 03:02:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ +# NetHack 3.6 macosx10.14 $NHDT-Date: 1566346605 2019/08/21 00:16:45 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. # NetHack may be freely redistributed. See license for details. # @@ -108,7 +108,7 @@ endif ifdef WANT_WIN_X11 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev ); # separate from CFLAGS so that we don't pass it to every file X11CFLAGS = -I/opt/X11/include CFLAGS += -DX11_GRAPHICS @@ -204,7 +204,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index f6d9e5483..3cbe335be 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -1,11 +1,12 @@ # -# NetHack 3.6 macosx10.5 $NHDT-Date: 1546082882 2018/12/29 11:28:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ +# NetHack 3.6 macosx10.5 $NHDT-Date: 1566346606 2019/08/21 00:16:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.32 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.5.3 (Darwin 9.3). If this doesn't work for some +# This is for Mac OS X 10.5 (Darwin 9.3) and also 10.6. +# If this doesn't work for some # other version of either Darwin or Mac OS X, make a new file for that OS, # don't change this one. And let us know about it. # Useful info: http://www.opensource.apple.com/darwinsource/index.html @@ -78,7 +79,7 @@ endif # !WANT_WIN_TTY ifdef WANT_WIN_X11 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); CFLAGS += -DX11_GRAPHICS ifdef USE_XPM CFLAGS += -DUSE_XPM @@ -176,7 +177,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index 776cb4b81..4937c64dc 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -1,11 +1,12 @@ # -# NetHack 3.6 macosx10.7 $NHDT-Date: 1546082882 2018/12/29 11:28:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $ +# NetHack 3.6 macosx10.7 $NHDT-Date: 1566346606 2019/08/21 00:16:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.36 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.7.2. If this doesn't work for some other version +# This is for Mac OS X 10.7. +# If this doesn't work for some other version # of Mac OS X, make a new file for that OS, don't change this one. And # let us know about it. # Useful info: http://www.opensource.apple.com/darwinsource/index.html @@ -95,7 +96,7 @@ endif # !WANT_WIN_TTY ifdef WANT_WIN_X11 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); CFLAGS += -DX11_GRAPHICS ifdef USE_XPM CFLAGS += -DUSE_XPM @@ -194,7 +195,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/macosx10.8 b/sys/unix/hints/macosx10.8 index 87d0e8305..a6e9c4d3c 100644 --- a/sys/unix/hints/macosx10.8 +++ b/sys/unix/hints/macosx10.8 @@ -1,11 +1,11 @@ # -# NetHack 3.6 macosx10.8 $NHDT-Date: 1546220385 2018/12/31 01:39:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.36 $ +# NetHack 3.6 macosx10.8 $NHDT-Date: 1566346607 2019/08/21 00:16:47 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.38 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # #-PRE # Mac OS X (Darwin) hints file -# This is for Mac OS X 10.8, Mountain Lion. +# This is for Mac OS X 10.8, Mountain Lion, and also 10.9. # # X11 is no longer included with OSX. # To regain X11, download and install XQuartz. (Attempting to run X11.app @@ -103,7 +103,7 @@ endif # !WANT_WIN_TTY ifdef WANT_WIN_X11 WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm -POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; (cd $(INSTDIR); mkfontdir); +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev ); # separate from CFLAGS so that we don't pass it to every file X11CFLAGS = -I/opt/X11/include CFLAGS += -DX11_GRAPHICS @@ -206,7 +206,7 @@ VARFILEPERM = 0600 VARDIRPERM = 0700 ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists -PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc +PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true endif # WANT_WIN_X11 POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE From 3e0d029a45969d86a2febc99a527c989e68e22e3 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 30 Aug 2019 18:11:43 -0700 Subject: [PATCH 3/3] fix #H9164 - crash during restore when swallowed Subject was "display crash while in curses mode". Restoring with perm_invent set in config file or NETHACKOPTIONS when the save was made while swallowed (regardless of perm_invent at that time) resulted in a crash when invalid u.ustuck was referenced before restoration had done its pointer fixups. init_nhwindows() is called with perm_invent On; restgamestate() temporarily turns it Off (3.6.2 restore hack); if/when update_inventory() gets called, curses notices that the persistent window has been disabled so it tears down all its windows in order to redraw the screen without that one; docrt() sees non-Null u.ustuck and calls swallowed(); swallowed() tries to use the value of that pointer rather than just Null/non-Null but the value is from the previous game session, not valid for the current session; crash. Make yet another attempt to prevent update_inventory() from being called during restore. curses won't try to redraw and the crash won't happen. But the invalid pointer is still lurking (until an eventual fixup later during restore). An earlier fix for update_inventory() during restore actually handled this problem (for the most common trigger, setworn(), but not in general), so the 3.6.2 behavior is a regression. --- doc/fixes36.3 | 7 ++++++- include/extern.h | 3 ++- include/winprocs.h | 4 ++-- src/display.c | 10 ++++++---- src/invent.c | 22 +++++++++++++++++++++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 5f8b0815a..8677345fb 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.103 $ $NHDT-Date: 1565833748 2019/08/15 01:49:08 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.104 $ $NHDT-Date: 1567213888 2019/08/31 01:11:28 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -125,6 +125,8 @@ when a shape-shifted sandestin was turned to stone, it died and reverted to sandestins are immune to stoning; net result was monster dying twice, triggering "dmonsfree: N removed doesn't match N+1 pending" warning; instead of dying, make it revert to sandestin form with full health +toggling perm_invent (where supported) while swallowed or underwater didn't + necessarily update the persistent inventory window right away Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository @@ -214,6 +216,9 @@ curses+'perm_invent': if too many entries for window height, last one which curses+'perm_invent': top line was wasted (left blank) when borders Off curses+'perm_invent': don't highlight inventory letters since nothing is selectable from the menu comprising the persistent inventory window +curses+'perm_invent': could crash during restore if game was saved while + hero was swallowed (invalid u.ustuck pointer; suppressing attempts to + update persistent inventory window during restore hides the problem) curses+'popup_dialog': show the text cursor at the end of prompts for single character input curses+DUMPLOG: pass along old messages from save file and quest message diff --git a/include/extern.h b/include/extern.h index 90548cf37..7c37297b3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1562114349 2019/07/03 00:39:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.715 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1567213888 2019/08/31 01:11:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.728 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1013,6 +1013,7 @@ E int FDECL(identify, (struct obj *)); E int FDECL(count_unidentified, (struct obj *)); E void FDECL(identify_pack, (int, BOOLEAN_P)); E void NDECL(learn_unseen_invent); +E void NDECL(update_inventory); E void FDECL(prinv, (const char *, struct obj *, long)); E char *FDECL(xprname, (struct obj *, const char *, CHAR_P, BOOLEAN_P, long, long)); diff --git a/include/winprocs.h b/include/winprocs.h index 36962750e..cc3b4046c 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 winprocs.h $NHDT-Date: 1553204011 2019/03/21 21:33:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.47 $ */ +/* NetHack 3.6 winprocs.h $NHDT-Date: 1567213890 2019/08/31 01:11:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.50 $ */ /* Copyright (c) David Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -112,7 +112,7 @@ extern #define end_menu (*windowprocs.win_end_menu) #define select_menu (*windowprocs.win_select_menu) #define message_menu (*windowprocs.win_message_menu) -#define update_inventory (*windowprocs.win_update_inventory) + #define mark_synch (*windowprocs.win_mark_synch) #define wait_synch (*windowprocs.win_wait_synch) #ifdef CLIPPING diff --git a/src/display.c b/src/display.c index 70a008a0a..7d948deae 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 display.c $NHDT-Date: 1560085863 2019/06/09 13:11:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.104 $ */ +/* NetHack 3.6 display.c $NHDT-Date: 1567213890 2019/08/31 01:11:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.106 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1368,15 +1368,15 @@ docrt() if (u.uswallow) { swallowed(1); - return; + goto post_map; } if (Underwater && !Is_waterlevel(&u.uz)) { under_water(1); - return; + goto post_map; } if (u.uburied) { under_ground(1); - return; + goto post_map; } /* shut down vision */ @@ -1403,6 +1403,8 @@ docrt() /* overlay with monsters */ see_monsters(); + post_map: + /* perm_invent */ update_inventory(); diff --git a/src/invent.c b/src/invent.c index fe21fa7b4..1f8bae8c4 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 invent.c $NHDT-Date: 1562203850 2019/07/04 01:30:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.261 $ */ +/* NetHack 3.6 invent.c $NHDT-Date: 1567213892 2019/08/31 01:11:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.262 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2398,6 +2398,26 @@ learn_unseen_invent() update_inventory(); } +/* persistent inventory window is maintained by interface code; + 'update_inventory' used to be a macro for + (*windowprocs.win_update_inventory) but the restore hackery + was getting out of hand; this is now a central call point */ +void +update_inventory() +{ + if (restoring) + return; + + /* + * Ought to check (windowprocs.wincap2 & WC2_PERM_INVENT) here.... + * + * We currently don't skip this call when iflags.perm_invent is False + * because curses uses that to disable a previous perm_invent window + * (after toggle via 'O'; perhaps the options code should handle that). + */ + (*windowprocs.win_update_inventory)(); +} + /* should of course only be called for things in invent */ STATIC_OVL char obj_to_let(obj)