Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-03-08 10:38:18 -05:00
11 changed files with 1080 additions and 1638 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 config1.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.6 config1.h $NHDT-Date: 1552007489 2019/03/08 01:11:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -146,7 +146,9 @@
#undef UNIX
#ifdef __DECC
#ifndef __DECC_VER /* buggy early versions want widened prototypes */
#define NOTSTDC /* except when typedefs are involved */
#define NOTSTDC /* except when typedefs are involved */
/* [25 or so years later... That was probably uchar widening to */
/* 'unsigned int' rather than anything to do with typedefs. pr] */
#define USE_VARARGS
#else
#define NHSTDC
@@ -200,10 +202,10 @@
/* Because:
* #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
* #define FOO 1 or on command-line -DFOO
* => defined(1) => (-1 != - 1 - 1) => 1
* => defined(1) => (-1 != - 1 - 1) => 1
* if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
* for -DFOO, oh well.
* => defined(0) => (-1 != - 0 - 1) => 0
* => defined(0) => (-1 != - 0 - 1) => 0
*
* But:
* defined("") => (-1 != - "" - 1)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 integer.h $NHDT-Date: 1524689514 2018/04/25 20:51:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.0 $ */
/* NetHack 3.6 integer.h $NHDT-Date: 1551901047 2019/03/06 19:37:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) 2016 by Michael Allison */
/* NetHack may be freely redistributed. See license for details. */
@@ -32,21 +32,33 @@
#ifndef INTEGER_H
#define INTEGER_H
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L)
/* DEC C (aka Compaq C for a while, HP C these days) for VMS is
classified as a freestanding implementation rather than a hosted one
and even though it claims to be C99, it does not provide <stdint.h>. */
#if defined(__DECC) && defined(VMS) && !defined(HAS_STDINT_H)
#define HAS_INTTYPES_H
#else /*!__DECC*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
&& !defined(HAS_STDINT_H)
/* The compiler claims to conform to C99. Use stdint.h */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
#else
# if defined(HAS_STDINT_H)
/* Some compilers have stdint.h but don't conform to all of C99. */
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
# endif
# if defined(__GNUC__) && defined(__INT64_MAX__)
# include <stdint.h>
# define SKIP_STDINT_WORKAROUND
# endif
#define HAS_STDINT_H
#endif
#if defined(__GNUC__) && defined(__INT64_MAX__) && !defined(HAS_STDINT_H)
#define HAS_STDINT_H
#endif
#endif /*?__DECC*/
#ifdef HAS_STDINT_H
#include <stdint.h>
#define SKIP_STDINT_WORKAROUND
#else /*!stdint*/
#ifdef HAS_INTTYPES_H
#include <inttypes.h>
#define SKIP_STDINT_WORKAROUND
#endif
#endif /*?stdint*/
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */
/*
@@ -59,8 +71,8 @@ typedef unsigned short uint16_t;
#if defined(__WATCOMC__) && !defined(__386__)
/* Open Watcom providing a 16 bit build for MS-DOS or OS/2 */
/* int is 16 bits; use long for 32 bits */
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long int int32_t;
typedef unsigned long int uint32_t;
#else
/* Otherwise, assume either a 32- or 64-bit compiler */
/* long may be 64 bits; use int for 32 bits */
@@ -68,8 +80,13 @@ typedef int int32_t;
typedef unsigned int uint32_t;
#endif
typedef long long int64_t;
typedef unsigned long long uint64_t;
/* The only place where nethack cares about 64-bit integers is in the
Isaac64 random number generator. If your environment can't support
64-bit integers, you should comment out USE_ISAAC64 in config.h so
that the previous RNG gets used instead. Then this file will be
inhibited and it won't matter what the int64_t and uint64_t lines are. */
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* !C99 */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 tradstdc.h $NHDT-Date: 1545270756 2018/12/20 01:52:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $ */
/* NetHack 3.6 tradstdc.h $NHDT-Date: 1552007504 2019/03/08 01:11:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -278,12 +278,16 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#endif
/*
* According to ANSI, prototypes for old-style declarations must widen the
* arguments to int. However, the MSDOS compilers accept shorter arguments
* (char, short, etc.) in prototypes and do typechecking with them. Therefore
* this mess to allow the better typechecking while also allowing some
* prototypes for the ANSI compilers so people quit trying to fix the
* prototypes to match the standard and thus lose the typechecking.
* According to ANSI C, prototypes for old-style function definitions like
* int func(arg) short arg; { ... }
* must specify widened arguments (char and short to int, float to double),
* int func(int);
* same as how narrow arguments get passed when there is no prototype info.
* However, various compilers accept shorter arguments (char, short, etc.)
* in prototypes and do typechecking with them. Therefore this mess to
* allow the better typechecking while also allowing some prototypes for
* the ANSI compilers so people quit trying to fix the prototypes to match
* the standard and thus lose the typechecking.
*/
#if defined(MSDOS) && !defined(__GO32__)
#define UNWIDENED_PROTOTYPES
@@ -332,7 +336,9 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#ifdef WIDENED_PROTOTYPES
#define CHAR_P int
#define SCHAR_P int
#ifndef UCHAR_P
#define UCHAR_P int
#endif
#define XCHAR_P int
#define SHORT_P int
#define BOOLEAN_P int

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 unixconf.h $NHDT-Date: 1550532737 2019/02/18 23:32:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.6 unixconf.h $NHDT-Date: 1552007506 2019/03/08 01:11:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.40 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -271,6 +271,13 @@
#endif
#endif
/* Digital Unix/HP Tru64 -- see vmsconf.h for explanation */
#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
#define UCHAR_P unsigned int
#else
#define UCHAR_P int
#endif
/*
* BSD/ULTRIX systems are normally the only ones that can suspend processes.
* Suspending NetHack processes cleanly should be easy to add to other systems

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 vmsconf.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */
/* NetHack 3.6 vmsconf.h $NHDT-Date: 1552007507 2019/03/08 01:11:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -160,6 +160,12 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
/* config.h defines USE_ISAAC64; we'll use it on Alpha or IA64 but not VAX;
it overrides RANDOM */
#if (defined(VAX) || defined(vax) || defined(__vax)) && defined(USE_ISAAC64)
#undef ISAAC64
#endif
#define FCMASK 0660 /* file creation mask */
/*
@@ -186,6 +192,21 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
#endif
#endif
/* ANSI C uses "value preserving rules", where 'unsigned char' and
'unsigned short' promote to 'int' if signed int is big enough to hold
all possible values, rather than traditional "sign preserving rules"
where 'unsigned char' and 'unsigned short' promote to 'unsigned int'.
However, the ANSI C rules aren't binding on non-ANSI compilers.
When DEC C (aka Compaq C, then HP C) is in non-standard 'common' mode
it supports prototypes that expect widened types, but it uses the old
sign preserving rules for how to widen narrow unsigned types. (In its
default 'relaxed' mode, __STDC__ is 1 and uchar widens to 'int'.) */
#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
#define UCHAR_P unsigned int
#else
#define UCHAR_P int
#endif
#ifdef __DECC
#define STRICT_REF_DEF /* used in lev_main.c */
#endif
@@ -237,6 +258,12 @@ typedef __mode_t mode_t;
#define tgetch vms_getchar
#if defined(__DECC_VER) && (__DECC_VER >= 50000000)
/* for cc/Standard=ANSI89, suppress notification that '$' in identifiers
is an extension; sys/vms/*.c needs it regardless of strict ANSI mode */
#pragma message disable DOLLARID
#endif
#include "system.h"
#define index strchr
@@ -247,8 +274,7 @@ typedef __mode_t mode_t;
# if defined(RANDOM)
# define Rand() random()
/* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
code to avoid having to deal with version-specific conditionalized builds
*/
code to avoid having to deal with version-specific conditionalized builds */
# define random nh_random
# define srandom nh_srandom
# define initstate nh_initstate
@@ -270,7 +296,7 @@ typedef __mode_t mode_t;
#define link(f1, f2) vms_link(f1, f2) /* vmsfiles.c */
#define open(f, k, m) vms_open(f, k, m) /* vmsfiles.c */
#define fopen(f, m) vms_fopen(f, m) /* vmsfiles.c */
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
#ifdef VERYOLD_VMS
#define unlink(f0) delete (f0) /* vaxcrtl */
#else