summaryrefslogtreecommitdiffstats
path: root/adventure
Commit message (Collapse)AuthorAgeFilesLines
* games: remove trailing whitespace in *.c and *.hrillig2021-05-057-42/+42
|
* avoid leaving off the trailing nul in a literal string.mrg2021-04-131-3/+3
|
* Use PREFIX nowCameron Katri2021-03-281-2/+2
|
* Get all the games compiling for iOSCameron Katri2021-02-225-10/+26
|
* Minor tidyup.dholland2014-03-221-6/+6
|
* tag decl() __noinline, as inlining it would defeat its purposedholland2014-03-221-3/+3
| | | | (which is to not have interesting string literals appear in the compiled binary)
* Workaround a toolchain issue by renaming the 'setup' host tool to 'mkdata' ↵jmcneill2013-02-161-5/+5
| | | | to make UAC happy when building with Cygwin. As described here -- http://msdn.microsoft.com/en-us/library/windows/desktop/bb756960.aspx -- 32-bit executables whose filenames include the strings 'install', 'setup', 'update', 'patch', etc. by default will request admin privileges unless an application manifest is provided.
* fix previous, thanks asau@dholland2012-10-121-3/+3
|
* Pass -Wstrict-overflow.dholland2012-10-121-7/+7
|
* grumble.dholland2012-01-081-1/+2
|
* Oops, I forgot to actually implement the checksumming code for the newdholland2012-01-083-38/+65
| | | | savefile format, so any savefiles generated yesterday can be tampered with. Oh well. While here, tidy up the crc code.
* Redo save file handling. The old save files were unportable, had nodholland2012-01-071-46/+712
| | | | | | | | | | | | | | | | | | | | magic number or versioning, relied on random(3) never changing to a different implementation, and were also saving pointers to disk and reading them back again. It *looks* as if the pointers thus loaded were reset before being used, but it's not particularly clear as the main loop of this thing is goto-based FORTRAN translated lightly to C. I've changed the logic to null these pointers instead of saving and loading them, and things seem to still work. The new save files have a header, support versioning, write only sized types in network byte order, and for the toy encryption to discourage cheating do something self-contained instead of using random(3) as a stream cipher. Because between the original import from 4.4 until earlier today trying to save would result in SIGSEGV on most platforms, it's unlikely anyone has a save file, but just in case (since the pointer issue appears to be nonlethal) I've kept compat code for old save files.
* Make this not crash on machines that are (a) 64 bit, or (b) have signeddholland2012-01-071-9/+4
| | | | | | | chars by default (i.e., almost all machines). Makes it possible to save the game. This has been broken since 4.4 and probably ever since the FORTRAN -> C translation. Crash reported by Petri Laakso in private mail.
* NULL does not need a castplunky2011-08-311-3/+3
|
* Remove 3rd and 4th clauses in christos' license. OK christos.snj2009-10-211-6/+1
|
* Use __dead.dholland2009-08-251-3/+3
|
* Whn ths cd ws wrttn, thr ws bt shrtg nd vwls wr xtrml xpnsv. Nowadays,dholland2009-08-2510-195/+196
| | | | | however, we have an ample vowel budget, and bit shortages are a thing of the past (even in a down economy) so spend a bit to improve readability.
* ANSIfy a leftover function.dholland2009-08-251-3/+9
| | | | Also note some unportable code with a comment. Can't change it because it'd break save files, though.
* sprinkle staticdholland2009-08-129-74/+75
|
* Remove the \n and tabs from the __COPYRIGHT() strings.lukem2008-07-201-4/+4
|
* convert __attribute__s to applicable cdefs.h macrosperry2007-12-151-3/+3
|
* don't try to switch a char and have a case of EOF - use an int.mrg2006-05-181-5/+6
|
* Coverity CID 2737: Handle linked-lists properly. Use calloc instead of mallocchristos2006-03-211-7/+8
| | | | | so that we don't end up storing garbage accidentally and the next pointer is initialized. If there is an inconsistency in the file abort instead of dereferencing NULL.
* Coverity CID 570: Remove impossible check.christos2006-03-181-3/+3
|
* Coverity CID 1195: Check for possible negative index.christos2006-03-181-3/+6
|
* Coverity CID 777: Fix NULL pointer deref and de-obfuscate code.christos2006-03-181-7/+7
|
* don't access out of bounds element of static alloc array.rtr2006-03-181-3/+3
| | | | | found by Coverity, CID 1519 / Run 5 XXX possible that intention was to start with i = 0.
* KNF and WARNS=3jmc2005-07-0111-252/+236
|
* Remove uses of __P.jsm2004-01-272-77/+77
|
* Fix capitalisation of compass directions.jsm2004-01-011-3/+3
|
* Improve how various "simple" host tools are built and invoked.lukem2003-11-161-4/+5
|
* Rework how MAKEVERBOSE operates:lukem2003-10-211-5/+3
| | | | | | | | | | * Don't bother prefixing commands with a line of ${_MKCMD}\ and instead rely upon "make -s". This is less intrusive on all the Makefiles than the former. Idea from David Laight. * Rename the variables use to print messages. The scheme now is: _MKMSG_FOO Run _MKMSG 'foo' _MKTARGET_FOO Run _MKMSG_FOO ${.TARGET} From discussion with Alistair Crooks.
* rework to use the newer _MKMSGCREATE (et al) macroslukem2003-10-191-3/+3
|
* Support MAKEVERBOSE. (Some host tools still generate verbose runtime messages)lukem2003-10-191-1/+5
|
* off-by-one. aaron@openbsditojun2003-09-191-3/+3
|
* off-by-one. aaron@openbsditojun2003-09-191-3/+3
|
* Move UCB-licensed code from 4-clause to 3-clause licence.agc2003-08-0712-82/+34
| | | Patches provided by Joel Baker in PR 22269, verified by myself.
* No need to reference .OBJDIR here.thorpej2002-03-051-2/+2
|
* Ensure trailing newline is present on error and warning messages (lostjsm2001-08-291-3/+3
| | | in previous conversion from <err.h> functions to ISO C ones).
* eliminate redundant declschristos2001-02-052-5/+5
|
* Don't use <sys/cdefs.h> __COPYRIGHT/__RCSID macros or <err.h> err/errxsimonb2000-07-311-15/+20
| | | | | functions for host programs - use portable ANSI constructs instead. Patches from Chris Demetriou.
* More include additions for exit, abs, strcmp, etc.matt2000-07-033-6/+9
|
* Use setgid(), not setregid().mycroft2000-05-081-3/+3
|
* HOST_CC -> HOST_LINK.cpk2000-04-241-2/+2
|
* Use err(1, NULL) and warn(NULL) for `out of memory' error messages.jsm2000-01-092-8/+8
|
* This patch fixes adventure(6) to use `extern' on declarations ofhubertf1999-07-282-40/+100
| | | | | | | | | | | 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>
* Adventure(6) should check for errors (e.g. disk full or quotahubertf1999-07-171-3/+7
| | | | | exceeded) when writing out saved games. Do so! Patch supplied by Joseph Myers <jsm28@cam.ac.uk> in PR 8016
* This patch cleans up the handling of the variable `saved' inhubertf1999-07-164-11/+14
| | | | | | | | | | | | | | | | | | | | | 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>
* From PR 7985 by Joseph Myers <jsm28@cam.ac.uk>:hubertf1999-07-141-2/+5
| | | | | 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.
* Add __attribute__() to a variable. From PR 6557, after discussion withhubertf1999-02-101-3/+3
| | | Joseph S. Myers <jsm28@cam.ac.uk>