VMS updates from KevinS (1 of 2: core)
His changes add file_exists() to sys/vms/vmsfiles.c, which might be
needed in the future but is not useful here. Checking for 'gbd' and
'grep' for PANICTRACE support (which I had working on Alpha--and
ought to work on VAX, no idea about IA64--before losing access to vms)
is pointless since neither is used.
src/files.c
SYSCF support, parse_config_line():
#if VMS, ignore GDBPATH and GREPPATH if present in sysconf;
SYSCF support, assure_syscf_file():
#if VMS, force open()'s optional third argument since the macro
which redirects open to vms_open requires it.
src/sp_lev.c
selection_do_randline():
use configuration-specified 'Rand()' rather than raw 'rand()'.
This commit is contained in:
22
src/files.c
22
src/files.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1434425313 2015/06/16 03:28:33 $ $NHDT-Branch: master $:$NHDT-Revision: 1.182 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1441753940 2015/09/08 23:12:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.183 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2323,6 +2323,7 @@ int src;
|
||||
}
|
||||
sysopt.panictrace_gdb = n;
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "GDBPATH", 7)) {
|
||||
#ifndef VMS /* VMS panictrace support doesn't use gdb or grep */
|
||||
if (!file_exists(bufp)) {
|
||||
raw_printf("File specified in GDBPATH does not exist.");
|
||||
return 0;
|
||||
@@ -2330,7 +2331,9 @@ int src;
|
||||
if (sysopt.gdbpath)
|
||||
free(sysopt.gdbpath);
|
||||
sysopt.gdbpath = dupstr(bufp);
|
||||
#endif
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "GREPPATH", 7)) {
|
||||
#ifndef VMS /* VMS panictrace support doesn't use gdb or grep */
|
||||
if (!file_exists(bufp)) {
|
||||
raw_printf("File specified in GREPPATH does not exist.");
|
||||
return 0;
|
||||
@@ -2338,6 +2341,7 @@ int src;
|
||||
if (sysopt.greppath)
|
||||
free(sysopt.greppath);
|
||||
sysopt.greppath = dupstr(bufp);
|
||||
#endif /* !VMS */
|
||||
#endif /* PANICTRACE */
|
||||
#endif /* SYSCF */
|
||||
} else if (match_varname(buf, "BOULDER", 3)) {
|
||||
@@ -3289,10 +3293,22 @@ int ifd, ofd;
|
||||
void
|
||||
assure_syscf_file()
|
||||
{
|
||||
/* All we really care about is the end result - can we read the file?
|
||||
* So just check that directly. */
|
||||
int fd;
|
||||
|
||||
/*
|
||||
* All we really care about is the end result - can we read the file?
|
||||
* So just check that directly.
|
||||
*
|
||||
* Not tested on most of the old platforms (which don't attempt
|
||||
* to implement SYSCF).
|
||||
* Some ports don't like open()'s optional third argument;
|
||||
* VMS overrides open() usage with a macro which requires it.
|
||||
*/
|
||||
#ifndef VMS
|
||||
fd = open(SYSCF_FILE, O_RDONLY);
|
||||
#else
|
||||
fd = open(SYSCF_FILE, O_RDONLY, 0);
|
||||
#endif
|
||||
if (fd >= 0) {
|
||||
/* readable */
|
||||
close(fd);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1433553490 2015/06/06 01:18:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1441753941 2015/09/08 23:12:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -4015,8 +4015,8 @@ struct opvar *ov;
|
||||
my = ((y1 + y2) / 2);
|
||||
} else {
|
||||
do {
|
||||
dx = (rand() % rough) - (rough / 2);
|
||||
dy = (rand() % rough) - (rough / 2);
|
||||
dx = (Rand() % rough) - (rough / 2);
|
||||
dy = (Rand() % rough) - (rough / 2);
|
||||
mx = ((x1 + x2) / 2) + dx;
|
||||
my = ((y1 + y2) / 2) + dy;
|
||||
} while ((mx > COLNO - 1 || mx < 0 || my < 0 || my > ROWNO - 1));
|
||||
|
||||
Reference in New Issue
Block a user