From: PatR Date: Sat, 30 Nov 2019 01:19:37 +0000 (-0800) Subject: more lua notice from makedefs.c to mdlib.c X-Git-Tag: NetHack-3.7.0_WIP~201 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5226726c99d152eb71e9c432117159f6b01562a0;p=nethack more lua notice from makedefs.c to mdlib.c Add missing dependency of makedefs needing src/mdlib.c to unix Makefile.src. --- diff --git a/src/mdlib.c b/src/mdlib.c index ff776ad93..812bc1e73 100644 --- a/src/mdlib.c +++ b/src/mdlib.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mdlib.c $NHDT-Date: 1574646946 2019/11/25 01:55:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ */ +/* NetHack 3.7 mdlib.c $NHDT-Date: 1575076762 2019/11/30 01:19:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -52,9 +52,9 @@ static char *FDECL(bannerc_string, (char *, const char *)); static void FDECL(opt_out_words, (char *, int *)); static void NDECL(build_savebones_compat_string); static int idxopttext, done_runtime_opt_init_once = 0; -#define MAXOPT 30 +#define MAXOPT 40 static char rttimebuf[MAXOPT]; -static char *opttext[ROWNO] = {0}; +static char *opttext[120] = { 0 }; char optbuf[BUFSZ]; static struct version_info version; static const char opt_indent[] = " "; @@ -328,19 +328,25 @@ static void build_savebones_compat_string() { #ifdef VERSION_COMPATIBILITY - unsigned long uver = VERSION_COMPATIBILITY; + unsigned long uver = VERSION_COMPATIBILITY, + cver = (((unsigned long) VERSION_MAJOR << 24) + | ((unsigned long) VERSION_MINOR << 16) + | ((unsigned long) PATCHLEVEL << 8)); #endif + Strcpy(save_bones_compat_buf, "save and bones files accepted from version"); #ifdef VERSION_COMPATIBILITY - Sprintf(eos(save_bones_compat_buf), "s %lu.%lu.%lu through %d.%d.%d", - ((uver & 0xFF000000L) >> 24), ((uver & 0x00FF0000L) >> 16), - ((uver & 0x0000FF00L) >> 8), VERSION_MAJOR, VERSION_MINOR, - PATCHLEVEL); -#else - Sprintf(eos(save_bones_compat_buf), " %d.%d.%d only", VERSION_MAJOR, - VERSION_MINOR, PATCHLEVEL); -#endif + if (uver != cver) + Sprintf(eos(save_bones_compat_buf), "s %lu.%lu.%lu through %d.%d.%d", + ((uver >> 24) & 0x0ffUL), + ((uver >> 16) & 0x0ffUL), + ((uver >> 8) & 0x0ffUL), + VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL); + else +#endif + Sprintf(eos(save_bones_compat_buf), " %d.%d.%d only", + VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL); } static const char *build_opts[] = { @@ -627,11 +633,39 @@ build_options() idxopttext++; optbuf[0] = '\0'; +#if defined(MAKEDEFS_C) || (defined(CROSSCOMPILE) && defined(CROSSCOMPILE_TARGET)) + { + static const char *lua_info[] = { + "", "NetHack 3.7.* uses the 'Lua' interpreter to process some data:", "", + " About Lua: Copyright (c) 1994-2017 Lua.org, PUC-Rio.", "", + /* 1 2 3 4 5 6 7 + 1234567890123456789012345678901234567890123456789012345678901234567890123456 + */ + " \"Permission is hereby granted, free of charge, to any person obtaining", + " a copy of this software and associated documentation files (the ", + " \"Software\"), to deal in the Software without restriction including", + " without limitation the rights to use, copy, modify, merge, publish,", + " distribute, sublicense, and/or sell copies of the Software, and to ", + " permit persons to whom the Software is furnished to do so, subject to", + " the following conditions:", + " The above copyright notice and this permission notice shall be", + " included in all copies or substantial portions of the Software.\"", + (const char *) 0 + }; + + /* add lua copyright notice */ + for (i = 0; lua_info[i]; ++i) { + opttext[idxopttext] = strdup(lua_info[i]); + if (idxopttext < (MAXOPT - 1)) + idxopttext++; + } + } +#endif /* MAKEDEFS_C || (CROSSCOMPILE && CROSSCOMPILE_TARGET) */ + /* end with a blank line */ - opttext[idxopttext] = strdup(optbuf); + opttext[idxopttext] = strdup(""); if (idxopttext < (MAXOPT - 1)) idxopttext++; - optbuf[0] = '\0'; return; } diff --git a/src/version.c b/src/version.c index 3c30657d2..a4e2c5157 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 version.c $NHDT-Date: 1575072301 2019/11/30 00:05:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.62 $ */ +/* NetHack 3.6 version.c $NHDT-Date: 1575076767 2019/11/30 01:19:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.63 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -458,7 +458,7 @@ void store_version(nhfp) NHFILE *nhfp; { -#if !defined(CROSSCOMPILE) || (defined(CROSSCOMPILE) && defined(CROSSCOMPILE_HOST)) +#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST) static const struct version_info version_data = { VERSION_NUMBER, VERSION_FEATURES, VERSION_SANITY1, VERSION_SANITY2, VERSION_SANITY3 diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index d2d3ee377..4ed03277e 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.src $NHDT-Date: 1575071867 2019/11/29 23:57:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.78 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1575076770 2019/11/30 01:19:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.79 $ # Copyright (c) 2018 by Pasi Kallinen # NetHack may be freely redistributed. See license for details. @@ -636,7 +636,8 @@ qt4yndlg.moc : ../win/Qt4/qt4yndlg.h # build monst.o and objects.o before executing '$(MAKE) makedefs' $(MAKEDEFS): $(FIRSTOBJ) \ - ../util/makedefs.c $(CONFIG_H) ../include/permonst.h \ + ../util/makedefs.c ../src/mdlib.c $(CONFIG_H) \ + ../include/permonst.h \ ../include/objclass.h ../include/monsym.h \ ../include/artilist.h ../include/dungeon.h ../include/obj.h \ ../include/monst.h ../include/you.h ../include/flag.h \ diff --git a/util/makedefs.c b/util/makedefs.c index 835d2e1b5..e9f55f8fc 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 makedefs.c $NHDT-Date: 1575072306 2019/11/30 00:05:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.166 $ */ +/* NetHack 3.6 makedefs.c $NHDT-Date: 1575076769 2019/11/30 01:19:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.167 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -1311,24 +1311,7 @@ void do_options() { const char *optline; - int i, infocontext = 0; - const char *lua_info[] = { - "NetHack 3.7.* uses the 'Lua' interpreter to process some data:\n", - " About Lua: Copyright (c) 1994-2017 Lua.org, PUC-Rio.\n", - /* 1 2 3 4 5 6 7 - 1234567890123456789012345678901234567890123456789012345678901234567890123456 - */ - " \"Permission is hereby granted, free of charge, to any person obtaining", - " a copy of this software and associated documentation files (the ", - " \"Software\"), to deal in the Software without restriction including", - " without limitation the rights to use, copy, modify, merge, publish,", - " distribute, sublicense, and/or sell copies of the Software, and to ", - " permit persons to whom the Software is furnished to do so, subject to", - " the following conditions:", - " The above copyright notice and this permission notice shall be", - " included in all copies or substantial portions of the Software.\"", - (const char *) 0 - }; + int infocontext = 0; windowing_sanity(); filename[0] = '\0'; @@ -1342,8 +1325,6 @@ do_options() } while ((optline = do_runtime_info(&infocontext)) != 0) Fprintf(ofp, "%s\n", optline); - for (i = 0; (optline = lua_info[i]) != 0; ++i) - Fprintf(ofp, "%s\n", optline); Fclose(ofp); return; }