summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Per [1] the speed of light in a vaccum is exactly 299792458 m/s.jakllsch2011-12-061-1/+1
| | | | | | | | | | | | | | | | | | Per [2] a furlong is 220 yards and a yard is exactly 0.9144 m. Per [3] a fortnight is 14 days. As I didn't find a good authority for what definition of a day a fortnight is measured in, I'll assume here a day is 86400 SI seconds. Thus, the speed of light in a vaccum is approximately 1.80*10^12 furlongs per fortnight. 1.80*10^12 = 299792458*86400*14/(220*0.9144) [1] Resolution 1 of the 17th meeting of the CGPM (1983) http://www.bipm.org/en/CGPM/db/17/1/ [2] Weights and Measures Act 1985 http://www.legislation.gov.uk/ukpga/1985/72 [3] The Concise Oxford Dictionary, 5th Edition, 1964, p. 480
* handle EOF in inputahoka2011-12-012-7/+12
|
* grammar fixjnemeth2011-11-191-1/+1
|
* remove duplicated #defines (in a usually unused part of the code)drochner2011-11-091-5/+2
|
* Use tiparm instead of vtparm.roy2011-10-033-13/+13
|
* reinstate NULL cast by request, where the NULL was being passed as a varargplunky2011-09-018-26/+26
|
* NULL does not need a castplunky2011-08-3122-78/+77
|
* No need to cast double to ubig (aka uintmax_t) through int.jakllsch2011-08-301-5/+4
| | | | | This change prevents a modulo by zero in a invocation such as: primes 18446744073709551000 18446744073709551615 on a LP64 machine.
* Use __deadjoerg2011-08-297-22/+19
|
* Mark error() as dead, so that validation for setclipped works correctly.joerg2011-08-271-2/+2
|
* Avoid non-literal format strings.tron2011-08-262-8/+8
|
* Use __dead and __printflike instead of __attribute__.dholland2011-08-2615-74/+62
|
* add printf attributes.christos2011-08-251-4/+4
|
* Uses non-literal format stringsjoerg2011-08-251-1/+4
|
* -Wno-shadow is no longer needed for HAVE_PCC, hereplunky2011-08-241-5/+1
|
* use const char [] for format.christos2011-08-211-3/+3
|
* Remove redundant set of prototypes for local functions, exposed bydholland2011-08-171-11/+2
| | | previous.
* Move some things around so declarations appear in a reasonable order.dholland2011-08-171-33/+32
|
* Use __dead instead of __attribute__((__noreturn__)).dholland2011-08-161-3/+3
|
* document non-literal string formatschristos2011-08-161-1/+3
|
* avoid non-literal format stringchristos2011-08-161-8/+8
|
* eliminate/document non-literal format stringschristos2011-08-162-13/+14
|
* eliminate non-literal format stringschristos2011-08-163-8/+8
|
* avoid non-literal format strings.christos2011-08-161-7/+4
|
* kill homebrew error functionschristos2011-08-161-43/+24
|
* document non-literal format stringschristos2011-08-161-1/+3
|
* - document non-literal format stringschristos2011-08-164-37/+46
| | | - avoid strict aliasing violations, but adding an intermediate function.
* Fix up some lint.dholland2011-08-0714-53/+63
|
* Fix up still more casts; use NULL instead of (char *)0.dholland2011-08-0614-55/+55
|
* Remove *another* set of useless casts. sheeshdholland2011-08-062-28/+28
|
* Remove more silly casts.dholland2011-08-0613-48/+48
|
* drop private (and wrong) definition of NULLdholland2011-08-061-6/+2
|
* Use the right type for the malloc wrapper function, and don't cast thedholland2011-08-0615-49/+48
| | | | | | | | return value. (XXX: Except for a pile of allocation macros that produce typed pointer results; there the typechecking of the result assignment is more valuable than the warning if the alloc function isn't declared properly. These macros should go away.)
* Remove silly casts.dholland2011-08-065-50/+50
|
* <sys/wait.h> is standard, so just use it instead of fiddling about withdholland2011-08-062-23/+4
| | | ifdefs for long-dead systems. While here, remove union wait.
* abolish references to index/rindexdholland2011-08-062-10/+3
|
* Remove the PYRAMID_BUG code. I don't think Pyramids are coming back, nordholland2011-08-062-12/+3
| | | do we care if their compiler vomits trying to decrement a bitfield.
* Don't refer to index() in comments; use strchr().dholland2011-08-061-3/+3
|
* Include system headers before private headers. Avoids various possibledholland2011-07-202-8/+8
| | | symbol conflicts.
* apply some -O0 with gcc 4.5 and vax.mrg2011-07-031-1/+5
|
* use DBL_MIN from <float.h> instead of a hard coded small value (thatmrg2011-07-031-3/+4
| | | becomes zero for vax fp.)
* include sys/time.h earlier (rather than implicitly via fcntl.h) so thatmrg2011-07-021-1/+2
| | | | | | | the "u" variable doesn't shadow stuff, found later in time.h inlines. kind of a hack, but i don't want to modify time.h either. XXX: seems kind of annoying
* rename a variable from "time" to "stime" (it's a string)mrg2011-07-021-5/+5
|
* apply some -Wno-error and/or -fno-strict-aliasing.mrg2011-06-221-1/+6
| | | | all of this should be looked at closer, but some of them are not very trivial.
* Use consistent sign in compare, the function is only called withjoerg2011-05-302-5/+5
| | | constants as third argument anyway.
* Map RCSID to __RCSIDjoerg2011-05-231-4/+3
|
* ANSIfyjoerg2011-05-231-22/+13
|