Commit Graph

33 Commits

Author SHA1 Message Date
hubertf ef49c17e92 This patch fixes adventure(6) to use `extern' on declarations of
objects in its header file, and to add corresponding definitions to
init.c accordingly.  (See the C standard - relying on linker commons
where there are multiple uninitialised declarations of an object in
the program traditionally works on Unix, but is not standard C.)

The patch also removes a bit-rotten code fragment under #ifdef
OLDSTUFF.

Patch submitted in PR 8105 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-28 23:23:39 +00:00
hubertf aac1ec24ab Adventure(6) should check for errors (e.g. disk full or quota
exceeded) when writing out saved games. Do so!

Patch supplied by Joseph Myers <jsm28@cam.ac.uk> in PR 8016
1999-07-17 20:02:48 +00:00
hubertf adf74b1e92 This patch cleans up the handling of the variable `saved' in
adventure(6).  The handling of this variable is somewhat confusing,
since it is used for two different purposes (controlling the time
required before a saved game can be restored, and controlling various
aspects of dwarf behaviour); in fact, it is also declared twice in
hdr.h.  Except possibly when saving a game fails, these uses can never
interfere; when used for controlling dwarf behaviour, we always have
saved == -1.  This can be better understood with reference to the
original PDP-10 FORTRAN source (URL in patch, since hdr.h references
the comments of the FORTRAN as still relevant to this version) of
which the C version is a direct translation: the wrong value for
`saved' meant that someone was cheating and had bypassed normal
initialisation.  Saving was done by halting and telling the user to
save their core image, so the question of carrying on after saving
failed to open the output file did not arise.

This patch separates the uses of `saved' into uses of two separate
variables.

Closes PR 8005 by Joseph Myers <jsm28@cam.ac.uk>
1999-07-16 01:38:20 +00:00
hubertf 76139748e2 From PR 7985 by Joseph Myers <jsm28@cam.ac.uk>:
games/adventure/setup.c fails to check for errors when writing its
output.  This means that, if the disk fills up at this point during a
build, it would nevertheless fail to return an error status.
1999-07-14 17:21:03 +00:00
hubertf 752e969da2 Add __attribute__() to a variable. From PR 6557, after discussion with
Joseph S. Myers <jsm28@cam.ac.uk>
1999-02-10 12:38:54 +00:00
hubertf c7bcded63e The patch below does some minor cleanup of adventure(6): an additional
use of const I missed in bin/6041; avoiding a signed/unsigned warning;
marking an unused parameter as such; revoking setgid privileges
(including the saved gid) rather than setuid ones; includes and
function prototypes in setup.c; the string passed to err() should not
end with a `.'.  Together with the patch sent concerning adventure's
EOF handling, this synchronises adventure(6) in NetBSD with the Linux
port of the NetBSD games.

Via PR 6557 by Joseph Myers <jsm28@cam.ac.uk>
1999-02-10 00:29:21 +00:00
hubertf 08ab0f321a The game adventure(6) handles EOF on standard input rather
ungracefully.  The patch, derived from OpenBSD, improves this
handling.

Sent in in PR 6556 by Joseph Myers <jsm28@cam.ac.uk>.
1999-02-10 00:11:28 +00:00
hubertf 006cc8ac96 return error on errors (PR#6147 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-14 09:29:08 +00:00
hubertf 878ef9cb13 check for malloc failures (PR#6136 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:24:09 +00:00
hubertf 9e7f2724b9 some cleanups as per PR#6082 by Joseph Myers <jsm28@cam.ac.uk> 1998-09-13 15:23:40 +00:00
hubertf dd397c841b remove unused function return values (PR#6079 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:21:36 +00:00
hubertf 4e1357c739 constify, per PR 6041 by Joseph Myers <jsm28@cam.ac.uk> 1998-09-13 00:07:24 +00:00
hubertf 4d8c1c95f9 add main() prototype 1998-09-11 14:51:18 +00:00
hubertf 4e2ece1035 remove main() prototype, as per PR 6867 1998-09-11 12:46:26 +00:00
hubertf d5ad059d0d Remove unused function and unnecessary prototypes, as per PR 6050 by
Joseph Myers <jsm28@cam.ac.uk>
1998-08-29 22:40:07 +00:00
hubertf ed8412ad2b Improved signal handling as per PR 6051 by
Joseph Myers <jsm@octomino.demon.co.uk>
1998-08-29 20:19:56 +00:00
hubertf 814a994a5e Replace some homegrown string-functions with standard-<string.h>-macros.
Reported by Joseph Myers <jsm28@cam.ac.uk> in PR 6028.
1998-08-24 22:26:23 +00:00
hubertf 5f3ed2ad7d Kill unused parameters, per PR 6023 by Joseph Myers <jsm28@cam.ac.uk>. 1998-08-24 22:07:37 +00:00
hubertf 0d6f96e6d0 Find setup-program even w/ obj dirs. 1998-08-01 23:02:35 +00:00
hubertf c81bbf322f Consider leap years, as per PR 5830 by Joseph Myers <jsm28@cam.ac.uk> 1998-07-24 23:18:07 +00:00
perry 75a6e03535 change includes to fix compiler warning 1998-02-03 04:55:59 +00:00
lukem ab046d9ff8 KNFify again 1997-10-11 01:55:27 +00:00
lukem 84f80fd691 KNFify 1997-10-11 01:53:21 +00:00
lukem 434abd72aa deprecate register, fixup .Nm usage 1997-10-10 11:59:26 +00:00
christos 690bee1083 PR/3964: Eric Fischer: Remove dependencies to traditional cpp...
While I was there add WARNS?= too.
1997-08-11 14:06:10 +00:00
thorpej bb38208013 Allow this to be cross-compiled. 1997-04-19 06:59:34 +00:00
mrg ef77d6a3ea oops, use <signal.h> not <sys/signal.h> (tholo@sigmasoft.com) 1996-05-21 21:53:05 +00:00
mrg dd34f9ec6f give up setuid-ness. we don't need it. while i'm here, include
<sys/signal.h> and use SIGINT rather than 2.
1996-05-21 10:48:07 +00:00
jtc 5224609738 Removed "extern int errno"; Added #include <errno.h> if not already present. 1996-02-06 22:47:06 +00:00
cgd c4816c32b3 Various changes to make games compile w/o warnings on the alpha:
Include appropriate includes, delete bogus function declarations,
change sizes of variables and casts.
1995-04-24 12:21:37 +00:00
cgd 43b952514b clean up RCS ids 1995-03-21 12:04:53 +00:00
cgd c4c01d75b2 specify man pages the new way. 1994-12-22 09:31:26 +00:00
jtc 107c0a28c5 adventure(6), from 44lite 1994-10-21 20:51:44 +00:00