makedefs: check input files for non-ASCII chars

If MAKEDEFS_FILTER_NONASCII is defined (which config.h now does by
default), it will check data.base, rumors.*, and {various}.txt for
characters outside the range of ' ' through '~'.  If it finds any, it
will warn about them and change them to '#'.

Tab handling is incomplete; the files that use tabs for indentation
will allow tabs anywhere, even though that's not wanted.  That could
be fixed but doesn't seem particularly urgent.  This is more about
spotting and repairing the special 3-char punctuation characters that
crept into data.base fairly recently.
This commit is contained in:
PatR
2023-12-18 17:16:33 -08:00
parent 90fcce8903
commit 5e9358b331
2 changed files with 131 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 config.h $NHDT-Date: 1693359531 2023/08/30 01:38:51 $ $NHDT-Branch: keni-crashweb2 $:$NHDT-Revision: 1.175 $ */
/* NetHack 3.7 config.h $NHDT-Date: 1702948586 2023/12/19 01:16:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -24,7 +24,7 @@
/* #define TOS */ /* define for Atari ST/TT */
/* #define STUPID */ /* avoid some complicated expressions if
your C compiler chokes on them */
* your C compiler chokes on them */
/* #define MINIMAL_TERM */
/* if a terminal handles highlighting or tabs poorly,
try this define, used in pager.c and termcap.c */
@@ -96,8 +96,8 @@
#ifdef QT_GRAPHICS
#ifndef DEFAULT_WC_TILED_MAP
#define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \
wc_ascii_map */
#define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't request
* wc_ascii_map */
#endif
#ifndef USE_XPM
#define USE_XPM /* Use XPM format for images (required) */
@@ -243,11 +243,11 @@
#ifndef CRASHREPORT
# ifdef MACOS
/* NB: This needs to be a full path unless it's in the playground. */
//#define CRASHREPORT "NetHackCrashReport.JavaScript"
/*#define CRASHREPORT "NetHackCrashReport.JavaScript"*/
# endif
# ifdef __linux__
/* NB: This expects to find the nhlua binary as "./nhlua" */
//#define CRASHREPORT "nhcrashreport.lua"
/*#define CRASHREPORT "nhcrashreport.lua"*/
# endif
#endif
@@ -262,6 +262,21 @@
many players, as it saves the player name and the game start time */
/* #define PANICLOG_FMT2 */
/*
* When building the program, whether the 'makedefs' utility
* checks for non-ASCII or non-printable (control) characters
* in various data files (data.base, rumors.tru, rumors.fal,
* {oracles,epitaphs,engravings,bogusmons}.txt and warns about them.
* They also get changed to '#' instead of possibly remaining
* unprintable.
*
* If you modify the data files to intentionally add accented
* letters or something comparable, comment this out. (Such things
* won't necessarily work as intended within nethack but at least
* makedefs wouldn't reject them.)
*/
#define MAKEDEFS_FILTER_NONASCII
/*
* PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
* These control the contents of 'record', the high-scores file.
@@ -599,13 +614,13 @@ typedef unsigned char uchar;
#if defined(DEBUG) && !defined(DEBUG_MIGRATING_MONS)
#define DEBUG_MIGRATING_MONS /* add a wizard-mode command to help debug
migrating monsters */
* migrating monsters */
#endif
/* SCORE_ON_BOTL is neither experimental nor inadequately tested,
but doesn't seem to fit in any other section... */
/* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to
show estimated score on status line */
* show estimated score on status line */
/* FREE_ALL_MEMORY is neither experimental nor inadequately tested,
but it isn't necessary for successful operation of the program */