]> git.cameronkatri.com Git - bsdgames-darwin.git/log
bsdgames-darwin.git
12 years agoFix various format string mismatches.
joerg [Wed, 29 Feb 2012 23:39:53 +0000 (23:39 +0000)]
Fix various format string mismatches.

12 years agoMan page and usage cleanups from Bug Hunting in PR 46103.
wiz [Sun, 26 Feb 2012 21:06:59 +0000 (21:06 +0000)]
Man page and usage cleanups from Bug Hunting in PR 46103.

12 years agoFix conflicting variable definitions
matt [Sat, 18 Feb 2012 06:57:23 +0000 (06:57 +0000)]
Fix conflicting variable definitions

13 years agoPR/45842: Henning Petersen: compare fgets with NULL not 0
christos [Mon, 16 Jan 2012 17:38:16 +0000 (17:38 +0000)]
PR/45842: Henning Petersen: compare fgets with NULL not 0

13 years agogrumble.
dholland [Sun, 8 Jan 2012 18:17:41 +0000 (18:17 +0000)]
grumble.

13 years agoOops, I forgot to actually implement the checksumming code for the new
dholland [Sun, 8 Jan 2012 18:16:00 +0000 (18:16 +0000)]
Oops, I forgot to actually implement the checksumming code for the new
savefile format, so any savefiles generated yesterday can be tampered
with. Oh well. While here, tidy up the crc code.

13 years agoRedo save file handling. The old save files were unportable, had no
dholland [Sat, 7 Jan 2012 22:23:16 +0000 (22:23 +0000)]
Redo save file handling. The old save files were unportable, had no
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.

13 years agoMake this not crash on machines that are (a) 64 bit, or (b) have signed
dholland [Sat, 7 Jan 2012 18:08:35 +0000 (18:08 +0000)]
Make this not crash on machines that are (a) 64 bit, or (b) have signed
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.

13 years agoPer [1] the speed of light in a vaccum is exactly 299792458 m/s.
jakllsch [Tue, 6 Dec 2011 19:41:03 +0000 (19:41 +0000)]
Per [1] the speed of light in a vaccum is exactly 299792458 m/s.
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

13 years agohandle EOF in input
ahoka [Thu, 1 Dec 2011 07:05:52 +0000 (07:05 +0000)]
handle EOF in input

13 years agogrammar fix
jnemeth [Sat, 19 Nov 2011 20:44:58 +0000 (20:44 +0000)]
grammar fix

13 years agoremove duplicated #defines (in a usually unused part of the code)
drochner [Wed, 9 Nov 2011 20:17:44 +0000 (20:17 +0000)]
remove duplicated #defines (in a usually unused part of the code)

13 years agoUse tiparm instead of vtparm.
roy [Mon, 3 Oct 2011 12:32:15 +0000 (12:32 +0000)]
Use tiparm instead of vtparm.

13 years agoreinstate NULL cast by request, where the NULL was being passed as a vararg
plunky [Thu, 1 Sep 2011 07:18:50 +0000 (07:18 +0000)]
reinstate NULL cast by request, where the NULL was being passed as a vararg

13 years agoNULL does not need a cast
plunky [Wed, 31 Aug 2011 16:24:54 +0000 (16:24 +0000)]
NULL does not need a cast

13 years agoNo need to cast double to ubig (aka uintmax_t) through int.
jakllsch [Tue, 30 Aug 2011 02:58:04 +0000 (02:58 +0000)]
No need to cast double to ubig (aka uintmax_t) through int.

This change prevents a modulo by zero in a invocation such as:
primes 18446744073709551000 18446744073709551615
on a LP64 machine.

13 years agoUse __dead
joerg [Mon, 29 Aug 2011 20:30:36 +0000 (20:30 +0000)]
Use __dead

13 years agoMark error() as dead, so that validation for setclipped works correctly.
joerg [Sat, 27 Aug 2011 23:42:33 +0000 (23:42 +0000)]
Mark error() as dead, so that validation for setclipped works correctly.

13 years agoAvoid non-literal format strings.
tron [Fri, 26 Aug 2011 09:01:07 +0000 (09:01 +0000)]
Avoid non-literal format strings.

13 years agoUse __dead and __printflike instead of __attribute__.
dholland [Fri, 26 Aug 2011 06:18:16 +0000 (06:18 +0000)]
Use __dead and __printflike instead of __attribute__.

13 years agoadd printf attributes.
christos [Thu, 25 Aug 2011 16:18:28 +0000 (16:18 +0000)]
add printf attributes.

13 years agoUses non-literal format strings
joerg [Thu, 25 Aug 2011 15:50:45 +0000 (15:50 +0000)]
Uses non-literal format strings

13 years ago-Wno-shadow is no longer needed for HAVE_PCC, here
plunky [Wed, 24 Aug 2011 17:39:32 +0000 (17:39 +0000)]
-Wno-shadow is no longer needed for HAVE_PCC, here

13 years agouse const char [] for format.
christos [Sun, 21 Aug 2011 08:50:08 +0000 (08:50 +0000)]
use const char [] for format.

13 years agoRemove redundant set of prototypes for local functions, exposed by
dholland [Wed, 17 Aug 2011 18:17:40 +0000 (18:17 +0000)]
Remove redundant set of prototypes for local functions, exposed by
previous.

13 years agoMove some things around so declarations appear in a reasonable order.
dholland [Wed, 17 Aug 2011 18:16:51 +0000 (18:16 +0000)]
Move some things around so declarations appear in a reasonable order.

13 years agoUse __dead instead of __attribute__((__noreturn__)).
dholland [Tue, 16 Aug 2011 19:53:03 +0000 (19:53 +0000)]
Use __dead instead of __attribute__((__noreturn__)).

13 years agodocument non-literal string formats
christos [Tue, 16 Aug 2011 11:28:18 +0000 (11:28 +0000)]
document non-literal string formats

13 years agoavoid non-literal format string
christos [Tue, 16 Aug 2011 11:26:16 +0000 (11:26 +0000)]
avoid non-literal format string

13 years agoeliminate/document non-literal format strings
christos [Tue, 16 Aug 2011 11:19:41 +0000 (11:19 +0000)]
eliminate/document non-literal format strings

13 years agoeliminate non-literal format strings
christos [Tue, 16 Aug 2011 11:14:04 +0000 (11:14 +0000)]
eliminate non-literal format strings

13 years agoavoid non-literal format strings.
christos [Tue, 16 Aug 2011 11:10:54 +0000 (11:10 +0000)]
avoid non-literal format strings.

13 years agokill homebrew error functions
christos [Tue, 16 Aug 2011 11:06:34 +0000 (11:06 +0000)]
kill homebrew error functions

13 years agodocument non-literal format strings
christos [Tue, 16 Aug 2011 10:14:40 +0000 (10:14 +0000)]
document non-literal format strings

13 years ago- document non-literal format strings
christos [Tue, 16 Aug 2011 09:26:22 +0000 (09:26 +0000)]
- document non-literal format strings
- avoid strict aliasing violations, but adding an intermediate function.

13 years agoFix up some lint.
dholland [Sun, 7 Aug 2011 06:03:45 +0000 (06:03 +0000)]
Fix up some lint.

13 years agoFix up still more casts; use NULL instead of (char *)0.
dholland [Sat, 6 Aug 2011 20:42:43 +0000 (20:42 +0000)]
Fix up still more casts; use NULL instead of (char *)0.

13 years agoRemove *another* set of useless casts. sheesh
dholland [Sat, 6 Aug 2011 20:32:25 +0000 (20:32 +0000)]
Remove *another* set of useless casts. sheesh

13 years agoRemove more silly casts.
dholland [Sat, 6 Aug 2011 20:29:37 +0000 (20:29 +0000)]
Remove more silly casts.

13 years agodrop private (and wrong) definition of NULL
dholland [Sat, 6 Aug 2011 20:24:35 +0000 (20:24 +0000)]
drop private (and wrong) definition of NULL

13 years agoUse the right type for the malloc wrapper function, and don't cast the
dholland [Sat, 6 Aug 2011 20:18:26 +0000 (20:18 +0000)]
Use the right type for the malloc wrapper function, and don't cast the
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.)

13 years agoRemove silly casts.
dholland [Sat, 6 Aug 2011 20:00:33 +0000 (20:00 +0000)]
Remove silly casts.

13 years ago<sys/wait.h> is standard, so just use it instead of fiddling about with
dholland [Sat, 6 Aug 2011 19:53:24 +0000 (19:53 +0000)]
<sys/wait.h> is standard, so just use it instead of fiddling about with
ifdefs for long-dead systems. While here, remove union wait.

13 years agoabolish references to index/rindex
dholland [Sat, 6 Aug 2011 19:47:54 +0000 (19:47 +0000)]
abolish references to index/rindex

13 years agoRemove the PYRAMID_BUG code. I don't think Pyramids are coming back, nor
dholland [Sat, 6 Aug 2011 19:32:58 +0000 (19:32 +0000)]
Remove the PYRAMID_BUG code. I don't think Pyramids are coming back, nor
do we care if their compiler vomits trying to decrement a bitfield.

13 years agoDon't refer to index() in comments; use strchr().
dholland [Sat, 6 Aug 2011 19:23:38 +0000 (19:23 +0000)]
Don't refer to index() in comments; use strchr().

13 years agoInclude system headers before private headers. Avoids various possible
dholland [Wed, 20 Jul 2011 07:04:30 +0000 (07:04 +0000)]
Include system headers before private headers. Avoids various possible
symbol conflicts.

13 years agoapply some -O0 with gcc 4.5 and vax.
mrg [Sun, 3 Jul 2011 15:29:34 +0000 (15:29 +0000)]
apply some -O0 with gcc 4.5 and vax.

13 years agouse DBL_MIN from <float.h> instead of a hard coded small value (that
mrg [Sun, 3 Jul 2011 06:44:01 +0000 (06:44 +0000)]
use DBL_MIN from <float.h> instead of a hard coded small value (that
becomes zero for vax fp.)

13 years agoinclude sys/time.h earlier (rather than implicitly via fcntl.h) so that
mrg [Sat, 2 Jul 2011 02:10:33 +0000 (02:10 +0000)]
include sys/time.h earlier (rather than implicitly via fcntl.h) so that
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

13 years agorename a variable from "time" to "stime" (it's a string)
mrg [Sat, 2 Jul 2011 02:09:08 +0000 (02:09 +0000)]
rename a variable from "time" to "stime" (it's a string)

13 years agoapply some -Wno-error and/or -fno-strict-aliasing.
mrg [Wed, 22 Jun 2011 02:49:41 +0000 (02:49 +0000)]
apply some -Wno-error and/or -fno-strict-aliasing.

all of this should be looked at closer, but some of them are not
very trivial.

13 years agoUse consistent sign in compare, the function is only called with
joerg [Mon, 30 May 2011 03:11:15 +0000 (03:11 +0000)]
Use consistent sign in compare, the function is only called with
constants as third argument anyway.

13 years agoMap RCSID to __RCSID
joerg [Mon, 23 May 2011 23:06:41 +0000 (23:06 +0000)]
Map RCSID to __RCSID

13 years agoANSIfy
joerg [Mon, 23 May 2011 23:03:38 +0000 (23:03 +0000)]
ANSIfy

13 years agoDon't use variables as format string.
joerg [Mon, 23 May 2011 23:02:07 +0000 (23:02 +0000)]
Don't use variables as format string.

13 years agoKill some pointer indirections. Don't use variables as format strings.
joerg [Mon, 23 May 2011 23:01:17 +0000 (23:01 +0000)]
Kill some pointer indirections. Don't use variables as format strings.

13 years agoANSIfy
joerg [Mon, 23 May 2011 22:59:27 +0000 (22:59 +0000)]
ANSIfy

13 years ago#if 0 some unused code.
joerg [Mon, 23 May 2011 22:58:44 +0000 (22:58 +0000)]
#if 0 some unused code.

13 years agoDon't use variables as format string.
joerg [Mon, 23 May 2011 22:56:11 +0000 (22:56 +0000)]
Don't use variables as format string.

13 years agoCorrectly print variables as strings, not as format string.
joerg [Mon, 23 May 2011 22:53:25 +0000 (22:53 +0000)]
Correctly print variables as strings, not as format string.

13 years agoProperly print string.
joerg [Mon, 23 May 2011 22:49:59 +0000 (22:49 +0000)]
Properly print string.

13 years agoDon't use variables as format strings.
joerg [Mon, 23 May 2011 22:48:52 +0000 (22:48 +0000)]
Don't use variables as format strings.

13 years agoANSIfy
joerg [Mon, 23 May 2011 22:47:22 +0000 (22:47 +0000)]
ANSIfy

13 years agoDon't use strings from arrays as format string.
joerg [Mon, 23 May 2011 22:46:35 +0000 (22:46 +0000)]
Don't use strings from arrays as format string.

13 years agoDon't use return value of a function as format string.
joerg [Mon, 23 May 2011 22:44:18 +0000 (22:44 +0000)]
Don't use return value of a function as format string.

13 years agoBug fix: in a game with 26 planes, the last one to be allocated wouldn't
is [Tue, 15 Feb 2011 08:25:25 +0000 (08:25 +0000)]
Bug fix: in a game with 26 planes, the last one to be allocated wouldn't
be allocated if it was the only eligible one.
From Jonathan David Amery via Debian Bug report 214626.

13 years agoFix spelling: it's *Jef* Raskin, not Jeff Raskin.
dyoung [Mon, 24 Jan 2011 15:30:54 +0000 (15:30 +0000)]
Fix spelling: it's *Jef* Raskin, not Jeff Raskin.

14 years agoavoid unnecessary cast (hi wiz)
dholland [Wed, 5 Jan 2011 15:52:20 +0000 (15:52 +0000)]
avoid unnecessary cast (hi wiz)

14 years agoFix fd leak in error cases. Found by cppcheck.
wiz [Wed, 5 Jan 2011 15:48:00 +0000 (15:48 +0000)]
Fix fd leak in error cases. Found by cppcheck.

14 years agoFix realloc error. Found by cppcheck.
wiz [Wed, 5 Jan 2011 15:40:55 +0000 (15:40 +0000)]
Fix realloc error. Found by cppcheck.

14 years agoDon't use the same name for two parameters.
joerg [Wed, 8 Dec 2010 17:08:07 +0000 (17:08 +0000)]
Don't use the same name for two parameters.

14 years agoUse __c99inline from sys/cdefs.h
joerg [Wed, 8 Dec 2010 17:06:35 +0000 (17:06 +0000)]
Use __c99inline from sys/cdefs.h

14 years agoFix a few of the games to use getprogname() in their usage() functions.
pgoyette [Sun, 5 Dec 2010 04:34:22 +0000 (04:34 +0000)]
Fix a few of the games to use getprogname() in their usage() functions.

Suggested by Joerg.

XXX There are probably many more that have their progname hard-coded, but
XXX I'm not up for a wholesale roto-till at the moment.

14 years agoSince this game is installed as 'boggle', fix the usage() text to match.
pgoyette [Sun, 5 Dec 2010 04:11:51 +0000 (04:11 +0000)]
Since this game is installed as 'boggle', fix the usage() text to match.

14 years agoadd one i saw on irc today
pooka [Thu, 25 Nov 2010 13:51:26 +0000 (13:51 +0000)]
add one i saw on irc today

14 years agoAvoid undefined behavior, from Chris Spiegel in PR 43860.
dholland [Sun, 26 Sep 2010 21:12:23 +0000 (21:12 +0000)]
Avoid undefined behavior, from Chris Spiegel in PR 43860.

14 years agoRework the game startup so it uses curses nicely. There are now menus
dholland [Fri, 6 Aug 2010 09:14:40 +0000 (09:14 +0000)]
Rework the game startup so it uses curses nicely. There are now menus
and stuff for picking scenarios and ships and all that.

14 years agoDon't define esc-[ as a custom key sequence because it steps on vt
dholland [Fri, 6 Aug 2010 03:10:26 +0000 (03:10 +0000)]
Don't define esc-[ as a custom key sequence because it steps on vt
function keys.

14 years agoFix some additional typos/grammar slips.
dholland [Sat, 29 May 2010 22:56:01 +0000 (22:56 +0000)]
Fix some additional typos/grammar slips.

14 years agoFix dog-Latin. The plural of wumpus could be wumpi, wumpus, or even wumpora,
dholland [Sat, 29 May 2010 22:53:49 +0000 (22:53 +0000)]
Fix dog-Latin. The plural of wumpus could be wumpi, wumpus, or even wumpora,
but not 'wumpii'. Where does this -ii crap come from?

14 years agoFollow the Fundamental Theory of Algebra. Disallow factorising of
joerg [Sat, 15 May 2010 21:22:39 +0000 (21:22 +0000)]
Follow the Fundamental Theory of Algebra. Disallow factorising of
numbers less than 2 as it is not
- naturally unique (negative numbers)
- finite (0)
- non-empty (1)

Discussed with the kristaps and wiz

14 years ago\\ -> \e
joerg [Fri, 14 May 2010 19:02:28 +0000 (19:02 +0000)]
\\ -> \e

14 years agocast isblank(3)'s argument to unsigned char.
tnozaki [Thu, 13 May 2010 17:52:11 +0000 (17:52 +0000)]
cast isblank(3)'s argument to unsigned char.

14 years agorename pollard_pminus1->pollard_rho for consistency
drochner [Wed, 28 Apr 2010 18:04:31 +0000 (18:04 +0000)]
rename pollard_pminus1->pollard_rho for consistency

14 years ago-Fix an old bug in the "pollard" code: it gets its argument passed
drochner [Tue, 27 Apr 2010 18:11:19 +0000 (18:11 +0000)]
-Fix an old bug in the "pollard" code: it gets its argument passed
 by reference, and changes the value behind the pointer under some
 circumstances (basically if it finds more than 2 different factors).
 It also calls itself if it finds a factor which is not considered prime
 (by openssl's miller-rabin check) and uses the call argument afterwards.
 This doesn't work -- we need to copy the argument into its own storage.
-Modify the code to do the "rho" algorithm as was initially announced.
 It takes somewhat longer in rare cases, but still works in cases where
 the "p-1" algorithm is unusable. This might fix PR misc/43192
 by Luiz Henrique de Figueiredo.
-Add some optional debug support, minor cleanup.

14 years agoDocument the options that actually exist, instead of some other
dholland [Sat, 24 Apr 2010 01:13:37 +0000 (01:13 +0000)]
Document the options that actually exist, instead of some other
completely unrelated set. Bump date. (first time since 1993!)

14 years agoHandle the "diedtime" field of the player log (which is not the high
dholland [Sat, 24 Apr 2010 00:56:14 +0000 (00:56 +0000)]
Handle the "diedtime" field of the player log (which is not the high
scores file, the append-only log of all games) as int32_t instead of
time_t. Log files from before the 64-bit time_t change can now be read
again; however, log files from the last year of -current are hosed.
All none of you who play larn, take note...

14 years agofflush the score file while signals are blocked to decrease the chance of
dholland [Sat, 24 Apr 2010 00:38:30 +0000 (00:38 +0000)]
fflush the score file while signals are blocked to decrease the chance of
it getting corrupted.

14 years agofix an obvious flaw in bounds check: the array of precomputed primes
drochner [Thu, 22 Apr 2010 14:28:48 +0000 (14:28 +0000)]
fix an obvious flaw in bounds check: the array of precomputed primes
could be overrun if its last entry (65537) was a factor of the input
(this does not affect PR misc/43192 -- the factors are much larger
here: 7742394596501*159455563099482401)

14 years agoAdd backslash before a dash to get a minus.
wiz [Thu, 22 Apr 2010 06:57:13 +0000 (06:57 +0000)]
Add backslash before a dash to get a minus.

14 years agoSync with reality. Bump date.
dholland [Thu, 22 Apr 2010 04:42:21 +0000 (04:42 +0000)]
Sync with reality. Bump date.

14 years agohandle ctime returning NULL.
christos [Sun, 4 Apr 2010 00:08:49 +0000 (00:08 +0000)]
handle ctime returning NULL.

14 years agoctime can return NULL.
christos [Fri, 2 Apr 2010 21:40:00 +0000 (21:40 +0000)]
ctime can return NULL.

14 years agofix typo.
christos [Fri, 2 Apr 2010 19:34:44 +0000 (19:34 +0000)]
fix typo.

14 years agohandle ctime returning NULL.
christos [Fri, 2 Apr 2010 15:34:16 +0000 (15:34 +0000)]
handle ctime returning NULL.

14 years agoremove #ifdef SVR4
dholland [Mon, 29 Mar 2010 05:16:08 +0000 (05:16 +0000)]
remove #ifdef SVR4

14 years agoSome improvements to the new UI.
dholland [Mon, 29 Mar 2010 04:28:47 +0000 (04:28 +0000)]
Some improvements to the new UI.

14 years agoreorg for clarity and exposition.
dholland [Mon, 29 Mar 2010 04:00:03 +0000 (04:00 +0000)]
reorg for clarity and exposition.

14 years agoBetter user interface. From OpenBSD, written by Paul Janzen quite a
dholland [Mon, 29 Mar 2010 03:51:55 +0000 (03:51 +0000)]
Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.