Reformat .h files.

I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.

The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.
This commit is contained in:
Sean Hunt
2015-05-25 09:03:10 +09:00
parent 26ee7dc370
commit 8b57d96fd2
156 changed files with 10712 additions and 10701 deletions

View File

@@ -16,8 +16,8 @@
* Trailing NULs are present in the default values in order to make some
* extra room for patching longer values into an existing executable.
*/
#define Local_WIZARD "NHWIZARD\0\0\0\0"
#define Local_HACKDIR "DISK$USERS:[GAMES.NETHACK.3_5_X.PLAY]\0\0\0\0\0\0\0\0"
#define Local_WIZARD "NHWIZARD\0\0\0\0"
#define Local_HACKDIR "DISK$USERS:[GAMES.NETHACK.3_5_X.PLAY]\0\0\0\0\0\0\0\0"
/*
* This section cleans up the stuff done in config.h so that it
@@ -25,36 +25,37 @@
* config.h is actually edited, the changes won't impact us.
*/
#ifdef UNIX
# undef UNIX
#undef UNIX
#endif
#ifdef HACKDIR
# undef HACKDIR
#undef HACKDIR
#endif
#ifdef WIZARD_NAME
# undef WIZARD_NAME
#undef WIZARD_NAME
#endif
#define HACKDIR Local_HACKDIR
#define WIZARD_NAME Local_WIZARD
#ifndef SYSCF
# define SYSCF
#define SYSCF
#endif
/* filenames require punctuation to avoid redirection via logical names */
#undef RECORD
#define RECORD "record;1" /* scoreboard file (retains high scores) */
#define RECORD "record;1" /* scoreboard file (retains high scores) */
#undef LOGFILE
#define LOGFILE "logfile;0" /* optional file (records all games) */
#define LOGFILE "logfile;0" /* optional file (records all games) */
#undef SYSCF_FILE
#define SYSCF_FILE "sysconf;0"
#define HLOCK "perm;1" /* an empty file used for locking purposes */
#define HLOCK "perm;1" /* an empty file used for locking purposes */
/* want compression--for level & save files--performed within NetHack itself */
/* want compression--for level & save files--performed within NetHack itself
*/
#ifdef COMPRESS
# undef COMPRESS
#undef COMPRESS
#endif
#ifndef INTERNAL_COMP
# define INTERNAL_COMP
#define INTERNAL_COMP
#endif
/*
@@ -83,7 +84,7 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* Put the readonly data files into a single container rather than into
* separate files in the playground directory.
*/
#define DLB /* use data librarian code */
#define DLB /* use data librarian code */
/*
* Provide menu of saved games to choose from at start.
@@ -106,7 +107,8 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* If you define USE_QIO_INPUT, then you'll get raw characters from the
* keyboard, not unlike those of the unix version of Nethack. This will
* allow you to use the Escape key in normal gameplay, and the appropriate
* control characters in Wizard mode. It will work most like the unix version.
* control characters in Wizard mode. It will work most like the unix
* version.
* It will also avoid "<interrupt>" being displayed when ^Y is pressed.
*
* Otherwise, the VMS SMG calls will be used. These calls block use of
@@ -114,13 +116,13 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* the same, although the differences are fairly negligible. You must
* then use a VTxxx function key or two <escape>s to give an ESC response.
*/
#define USE_QIO_INPUT /* use SYS$QIOW instead of SMG$READ_KEYSTROKE */
#define USE_QIO_INPUT /* use SYS$QIOW instead of SMG$READ_KEYSTROKE */
/*
* Allow the user to decide whether to pause via timer or excess screen
* output for various display effects like explosions and moving objects.
*/
#define TIMED_DELAY /* enable the `timed_delay' run-time option */
#define TIMED_DELAY /* enable the `timed_delay' run-time option */
/*
* If you define MAIL, then NetHack will capture incoming broadcast
@@ -132,7 +134,7 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* If you undefine MAIL, broadcasts will go straight to the terminal,
* resulting in disruption of the screen display; use <ctrl/R> to redraw.
*/
#define MAIL /* enable broadcast trapping */
#define MAIL /* enable broadcast trapping */
/*
* SHELL enables the player to 'escape' into a spawned subprocess via
@@ -144,8 +146,8 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* to the parent process with the <ctrl/Z> command; this is not very
* close to Unix job control, but it's better than nothing.
*/
#define SHELL /* do not delete the '!' command */
#define SUSPEND /* don't delete the ^Z command, such as it is */
#define SHELL /* do not delete the '!' command */
#define SUSPEND /* don't delete the ^Z command, such as it is */
/*
* Some terminals or terminal emulators send two character sequence "ESC c"
@@ -154,13 +156,11 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
* ESC when it is waiting for a command, it will wait for another character
* (even if user intended that ESC to be standalone to cancel a count prefix).
*/
#define ALTMETA /* support altmeta run-time option */
#define ALTMETA /* support altmeta run-time option */
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
#define FCMASK 0660 /* file creation mask */
#define FCMASK 0660 /* file creation mask */
/*
* The remainder of the file should not need to be changed.
@@ -168,111 +168,113 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
/* data librarian defs */
#ifdef DLB
# define DLBFILE "nh-data.dlb"
/*
* Since we can do without case insensitive filename comparison,
* avoid enabling it because that requires compiling and linking
* src/hacklib into util/dlb_main.
*/
/* # define FILENAME_CMP strcmpi */ /* case insensitive */
#define DLBFILE "nh-data.dlb"
/*
* Since we can do without case insensitive filename comparison,
* avoid enabling it because that requires compiling and linking
* src/hacklib into util/dlb_main.
*/
/* # define FILENAME_CMP strcmpi */ /* case insensitive */
#endif
#if defined(VAXC) && !defined(ANCIENT_VAXC)
# ifdef volatile
# undef volatile
# endif
# ifdef const
# undef const
# endif
#ifdef volatile
#undef volatile
#endif
#ifdef const
#undef const
#endif
#endif
#ifdef __DECC
# define STRICT_REF_DEF /* used in lev_main.c */
#define STRICT_REF_DEF /* used in lev_main.c */
#endif
#ifdef STRICT_REF_DEF
# define DEFINE_OSPEED
#define DEFINE_OSPEED
#endif
#ifndef alloca
/* bison generated foo_yacc.c might try to use alloca() */
# ifdef __GNUC__
# define alloca __builtin_alloca
# else
# define ALLOCA_HACK /* used in util/panic.c */
# endif
/* bison generated foo_yacc.c might try to use alloca() */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#define ALLOCA_HACK /* used in util/panic.c */
#endif
#endif
#ifdef _DECC_V4_SOURCE
/* <types.h> excludes some necessary typedefs when _DECC_V4_SOURCE is defined */
/* <types.h> excludes some necessary typedefs when _DECC_V4_SOURCE is defined
*/
#include <types.h>
# ifndef __PID_T
# define __PID_T
#ifndef __PID_T
#define __PID_T
typedef __pid_t pid_t;
# endif
# ifndef __UID_T
# define __UID_T
#endif
#ifndef __UID_T
#define __UID_T
typedef __uid_t uid_t;
# endif
# ifndef __GID_T
# define __GID_T
#endif
#ifndef __GID_T
#define __GID_T
typedef __gid_t gid_t;
# endif
# ifndef __MODE_T
# define __MODE_T
#endif
#ifndef __MODE_T
#define __MODE_T
typedef __mode_t mode_t;
# endif
#endif /* _DECC_V4_SOURCE */
#endif
#endif /* _DECC_V4_SOURCE */
#include <time.h>
#if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
#if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
#include <file.h>
#else /* values needed from missing include file */
# define O_RDONLY 0
# define O_WRONLY 1
# define O_RDWR 2
# define O_CREAT 0x200
# define O_TRUNC 0x400
#else /* values needed from missing include file */
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_CREAT 0x200
#define O_TRUNC 0x400
#endif
#define tgetch vms_getchar
#include "system.h"
#define index strchr
#define rindex strrchr
#define index strchr
#define rindex strrchr
/* Use the high quality random number routines. */
#if defined(RANDOM)
#define Rand() 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 */
#define random nh_random
#define srandom nh_srandom
#define initstate nh_initstate
#define setstate nh_setstate
code to avoid having to deal with version-specific conditionalized builds
*/
#define random nh_random
#define srandom nh_srandom
#define initstate nh_initstate
#define setstate nh_setstate
#else
#define Rand() rand()
#define Rand() rand()
#endif
#ifndef __GNUC__
# ifndef bcopy
#define bcopy(s,d,n) memcpy((d),(s),(n)) /* vaxcrtl */
# endif
#ifndef bcopy
#define bcopy(s, d, n) memcpy((d), (s), (n)) /* vaxcrtl */
#endif
#define abort() vms_abort() /* vmsmisc.c */
#define creat(f,m) vms_creat(f,m) /* vmsfiles.c */
#define exit(sts) vms_exit(sts) /* vmsmisc.c */
#define getuid() vms_getuid() /* vmsunix.c */
#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 */
#endif
#define abort() vms_abort() /* vmsmisc.c */
#define creat(f, m) vms_creat(f, m) /* vmsfiles.c */
#define exit(sts) vms_exit(sts) /* vmsmisc.c */
#define getuid() vms_getuid() /* vmsunix.c */
#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 */
#ifdef VERYOLD_VMS
#define unlink(f0) delete(f0) /* vaxcrtl */
#define unlink(f0) delete (f0) /* vaxcrtl */
#else
#define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */
#define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */
#endif
#define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */
#define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */
/* VMS global names are case insensitive... */
#define An vms_an
@@ -284,9 +286,9 @@ typedef __mode_t mode_t;
/* used in several files which don't #include "extern.h" */
extern void FDECL(vms_exit, (int));
extern int FDECL(vms_open, (const char *,int,unsigned));
extern FILE *FDECL(vms_fopen, (const char *,const char *));
char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
extern int FDECL(vms_open, (const char *, int, unsigned));
extern FILE *FDECL(vms_fopen, (const char *, const char *));
char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
#endif /* VMSCONF_H */
#endif /* VMS */
#endif /* VMSCONF_H */
#endif /* VMS */