]> git.cameronkatri.com Git - bsdgames-darwin.git/log
bsdgames-darwin.git
15 years agoUse random() instead of rand(), and seed with time instead of pid.
dholland [Mon, 20 Jul 2009 06:43:18 +0000 (06:43 +0000)]
Use random() instead of rand(), and seed with time instead of pid.

15 years agoAssorted minor cleanups, no functional change:
dholland [Mon, 20 Jul 2009 06:39:06 +0000 (06:39 +0000)]
Assorted minor cleanups, no functional change:
   - u_int* -> uint*
   - don't make private typedefs of system structures
   - use curses TRUE and FALSE only with curses booleans, otherwise
     true and false;
   - includes cleanup
   - group globals in extern.c by functionality

Object file diffs inspected.

15 years agoA bit more whitespace.
dholland [Mon, 20 Jul 2009 06:09:29 +0000 (06:09 +0000)]
A bit more whitespace.

15 years agoWhitespace.
dholland [Mon, 20 Jul 2009 06:00:56 +0000 (06:00 +0000)]
Whitespace.

15 years agoANSIfy. Use __dead. Object diffs checked.
dholland [Mon, 20 Jul 2009 05:44:02 +0000 (05:44 +0000)]
ANSIfy. Use __dead. Object diffs checked.

15 years agoANSIfy. Also, we now have RANDOM_MAX; use it. Object diffs checked...
dholland [Mon, 20 Jul 2009 05:33:35 +0000 (05:33 +0000)]
ANSIfy. Also, we now have RANDOM_MAX; use it. Object diffs checked...

15 years agoRename internal getline() function to get_line() so it does
roy [Mon, 13 Jul 2009 19:05:39 +0000 (19:05 +0000)]
Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.

15 years agoRemove config options for 4.2BSD and 4.3BSD, and associated code. Highly
dholland [Sat, 4 Jul 2009 07:51:34 +0000 (07:51 +0000)]
Remove config options for 4.2BSD and 4.3BSD, and associated code. Highly
obsolete, and I doubt most of it still worked anyway.

15 years agoRemove the non-curses screen handling, since it relies on knowing
dholland [Sat, 4 Jul 2009 07:10:22 +0000 (07:10 +0000)]
Remove the non-curses screen handling, since it relies on knowing
about various internals of SVR4 curses, old BSD curses, and/or other
unclean things. (Yes, the non-curses handling still used bits of
curses. Fie.)

15 years agoRemove config for the return type of signal handlers, which is also a
dholland [Sat, 4 Jul 2009 06:38:34 +0000 (06:38 +0000)]
Remove config for the return type of signal handlers, which is also a
long-dead issue.

15 years agoRemove references to config #defines for the thoroughly obsolete
dholland [Sat, 4 Jul 2009 06:31:31 +0000 (06:31 +0000)]
Remove references to config #defines for the thoroughly obsolete
4.2BSD syslog API.

15 years agomore whitespace
dholland [Sat, 4 Jul 2009 06:19:05 +0000 (06:19 +0000)]
more whitespace

15 years agoVarious minor fixes, mostly from OpenBSD.
dholland [Sat, 4 Jul 2009 06:15:27 +0000 (06:15 +0000)]
Various minor fixes, mostly from OpenBSD.

15 years agoNotes on the protocol used by hunt, from OpenBSD.
dholland [Sat, 4 Jul 2009 05:06:06 +0000 (05:06 +0000)]
Notes on the protocol used by hunt, from OpenBSD.

15 years agoWhitespace.
dholland [Sat, 4 Jul 2009 05:01:16 +0000 (05:01 +0000)]
Whitespace.

15 years agoWhitespace.
dholland [Sat, 4 Jul 2009 04:29:54 +0000 (04:29 +0000)]
Whitespace.

15 years agoSigh, more of the same (missed two)
dholland [Sat, 4 Jul 2009 03:29:20 +0000 (03:29 +0000)]
Sigh, more of the same (missed two)

15 years ago__attribute__((__noreturn__)) -> __dead
dholland [Sat, 4 Jul 2009 03:27:57 +0000 (03:27 +0000)]
__attribute__((__noreturn__)) -> __dead

15 years agoANSIfy function declarations.
dholland [Sat, 4 Jul 2009 01:58:57 +0000 (01:58 +0000)]
ANSIfy function declarations.

15 years agoRemove two more bogus casts. These *do* create object diffs on amd64,
dholland [Sat, 4 Jul 2009 01:44:28 +0000 (01:44 +0000)]
Remove two more bogus casts. These *do* create object diffs on amd64,
for no clear reason, but it looks like the diffs are harmless.

15 years agoRemove bogus casts. Two object file diffs inspected and found to be harmless.
dholland [Sat, 4 Jul 2009 01:23:55 +0000 (01:23 +0000)]
Remove bogus casts. Two object file diffs inspected and found to be harmless.

15 years agoRemove a pile of bogus casts. One object file diff, crosschecked and
dholland [Sat, 4 Jul 2009 01:01:18 +0000 (01:01 +0000)]
Remove a pile of bogus casts. One object file diff, crosschecked and
found harmless.

15 years agoFix two serious string-handling bugs (one exploitable, one probably
dholland [Mon, 29 Jun 2009 23:05:33 +0000 (23:05 +0000)]
Fix two serious string-handling bugs (one exploitable, one probably
exploitable) and also add proper checking/paranoia in several other
places.

15 years agosprintf -> snprintf
dholland [Sun, 28 Jun 2009 21:12:10 +0000 (21:12 +0000)]
sprintf -> snprintf

15 years agoFix possible remote DoS of a running hunt game, and prevent a possible
dholland [Sun, 28 Jun 2009 18:59:37 +0000 (18:59 +0000)]
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.

15 years agoa bit more const
dholland [Sun, 7 Jun 2009 21:04:54 +0000 (21:04 +0000)]
a bit more const

15 years agosprinkle some more const
dholland [Sun, 7 Jun 2009 20:31:10 +0000 (20:31 +0000)]
sprinkle some more const

15 years agoremove unnecessary casts
dholland [Sun, 7 Jun 2009 20:25:38 +0000 (20:25 +0000)]
remove unnecessary casts

15 years agosprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate
dholland [Sun, 7 Jun 2009 20:13:18 +0000 (20:13 +0000)]
sprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate
XXX: there's still one sprintf left which will take some hacking to expunge.

15 years agoANSIfy function declarations. All object file diffs inspected.
dholland [Sun, 7 Jun 2009 18:30:39 +0000 (18:30 +0000)]
ANSIfy function declarations. All object file diffs inspected.

15 years agoRectify non-compiling code that appears when DEBUG is defined.
dholland [Thu, 4 Jun 2009 07:01:16 +0000 (07:01 +0000)]
Rectify non-compiling code that appears when DEBUG is defined.

15 years agoSet WARNS=4 here. This got missed on my previous WARNS sweep in games.
dholland [Thu, 4 Jun 2009 06:51:11 +0000 (06:51 +0000)]
Set WARNS=4 here. This got missed on my previous WARNS sweep in games.
Everything appears to compile ok with WARNS=4 anyway though.

15 years agoRemove global scratch string buffer. Don't zoom off the end while reading
dholland [Thu, 4 Jun 2009 06:47:36 +0000 (06:47 +0000)]
Remove global scratch string buffer. Don't zoom off the end while reading
user input, either.

15 years agoRemove remaining references to sprintf.
dholland [Thu, 4 Jun 2009 06:41:50 +0000 (06:41 +0000)]
Remove remaining references to sprintf.

15 years agoMake a couple of the logging/printing functions printf-alikes. This removes
dholland [Thu, 4 Jun 2009 06:27:47 +0000 (06:27 +0000)]
Make a couple of the logging/printing functions printf-alikes. This removes
most of the calls to sprintf.

15 years agoattribute noreturn -> __dead
dholland [Thu, 4 Jun 2009 05:52:30 +0000 (05:52 +0000)]
attribute noreturn -> __dead

15 years agosprintf -> snprintf
dholland [Thu, 4 Jun 2009 05:51:12 +0000 (05:51 +0000)]
sprintf -> snprintf

15 years agoIncrease spending on vowels. No object file diffs.
dholland [Thu, 4 Jun 2009 05:43:29 +0000 (05:43 +0000)]
Increase spending on vowels. No object file diffs.

15 years agoANSIfy function declarations.x
dholland [Thu, 4 Jun 2009 05:27:04 +0000 (05:27 +0000)]
ANSIfy function declarations.x

15 years agosprintf -> snprintf
dholland [Thu, 4 Jun 2009 04:48:04 +0000 (04:48 +0000)]
sprintf -> snprintf

15 years agoDon't use a variable-size array here. There's not really that much point.
dholland [Mon, 1 Jun 2009 04:03:26 +0000 (04:03 +0000)]
Don't use a variable-size array here. There's not really that much point.

15 years agoRearrange where the alternate definition of __dead goes.
dholland [Wed, 27 May 2009 17:44:38 +0000 (17:44 +0000)]
Rearrange where the alternate definition of __dead goes.
It can't be before "include.h" as that includes a bunch of system headers,
but it can't be after either as it also includes a bunch of local headers.
Therefore, it needs to be *in* include.h.

15 years agoEdit some.
dholland [Tue, 26 May 2009 01:34:32 +0000 (01:34 +0000)]
Edit some.

15 years agoAssorted fixes (mostly grammar, some markup) from OpenBSD.
dholland [Tue, 26 May 2009 00:58:59 +0000 (00:58 +0000)]
Assorted fixes (mostly grammar, some markup) from OpenBSD.

15 years agoParanoia about lengths of login names. From pjanzen of OpenBSD.
dholland [Tue, 26 May 2009 00:30:16 +0000 (00:30 +0000)]
Paranoia about lengths of login names. From pjanzen of OpenBSD.

15 years agoAvoid SIGSEGV on users not in password file. From pjanzen of OpenBSD.
dholland [Tue, 26 May 2009 00:27:23 +0000 (00:27 +0000)]
Avoid SIGSEGV on users not in password file. From pjanzen of OpenBSD.

15 years agosprintf -> snprintf
dholland [Tue, 26 May 2009 00:00:56 +0000 (00:00 +0000)]
sprintf -> snprintf

15 years agoattribute noreturn -> __dead
dholland [Mon, 25 May 2009 23:48:32 +0000 (23:48 +0000)]
attribute noreturn -> __dead

15 years agoWe don't need a private #define "unsgn" for "unsigned", especially since
dholland [Mon, 25 May 2009 23:44:04 +0000 (23:44 +0000)]
We don't need a private #define "unsgn" for "unsigned", especially since
it was used exactly once.

15 years agoUse the time to call srandom(), not getpid().
dholland [Mon, 25 May 2009 23:41:23 +0000 (23:41 +0000)]
Use the time to call srandom(), not getpid().

15 years agoKNF/whitespace: format preprocessor directives correctly.
dholland [Mon, 25 May 2009 23:34:50 +0000 (23:34 +0000)]
KNF/whitespace: format preprocessor directives correctly.

15 years agoANSIfy function declarations. Object file diffs checked.
dholland [Mon, 25 May 2009 23:24:54 +0000 (23:24 +0000)]
ANSIfy function declarations. Object file diffs checked.

15 years agosprintf -> snprintf
dholland [Mon, 25 May 2009 23:14:33 +0000 (23:14 +0000)]
sprintf -> snprintf

15 years agoANSIfy function declarations. Object file diffs cross-checked.
dholland [Mon, 25 May 2009 23:08:45 +0000 (23:08 +0000)]
ANSIfy function declarations. Object file diffs cross-checked.

15 years agoattribute noreturn -> __dead
dholland [Mon, 25 May 2009 22:35:01 +0000 (22:35 +0000)]
attribute noreturn -> __dead

15 years agoClean up scorefile handling.
dholland [Mon, 25 May 2009 08:33:57 +0000 (08:33 +0000)]
Clean up scorefile handling.

This was writing time_t to disk. Worse, the time_t member was at an
unaligned offset in the structure in question, so after the time_t
change the structure layout depended on compiler-inserted structure
padding. This gives three legacy formats: one with 32-bit time, one
with 64-bit time, and one with 64-bit time and 4 bytes of structure
padding.

And of course the file didn't have a header or version coding or
anything.

The new code writes a structure of well-defined size that should not
receive unexpected padding, and gives the file a header and version
number. It reads that format and any of the three legacy formats,
figuring out which one it's dealing with by inspecting the file
contents. For good measure, it also now handles opposite-endian files,
doesn't bail out unceremoniously unless necessary, and won't croak if
the file is corrupt and e.g. contains unterminated strings.

(Was it worth going to this length? Maybe not. But it didn't seem
right to just leave it, and it's not clear where to stop halfway.)

15 years agoANSIfy function declarations.
dholland [Mon, 25 May 2009 04:33:53 +0000 (04:33 +0000)]
ANSIfy function declarations.

Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)

15 years agoRemove description of -a option and optional log file name, since
dholland [Mon, 25 May 2009 00:53:46 +0000 (00:53 +0000)]
Remove description of -a option and optional log file name, since
neither has done anything in a long long time. Add previously
undocumented -s/-f (slow vs. fast) options, although I question the
utility thereof and suspect they should just be removed.

Bump date (first time since 1993)

15 years agosprintf -> snprintf
dholland [Mon, 25 May 2009 00:46:01 +0000 (00:46 +0000)]
sprintf -> snprintf

15 years agosprintf -> snprintf.
dholland [Mon, 25 May 2009 00:43:34 +0000 (00:43 +0000)]
sprintf -> snprintf.

15 years ago"abbreviation" has two Bs.
dholland [Mon, 25 May 2009 00:39:45 +0000 (00:39 +0000)]
"abbreviation" has two Bs.

15 years agoUse random() instead of rand(), so we get something like random
dholland [Mon, 25 May 2009 00:37:27 +0000 (00:37 +0000)]
Use random() instead of rand(), so we get something like random
numbers out.

This changes the "tournament codes"; that is, the same code will give
you a different game now from what it used to. (This is because the
codes are basically random seeds.) I really really doubt anyone cares
about this, especially since the tournament feature appears to be
undocumented.

15 years agoRemove obviously botched test for "fast mode" based on terminal speed.
dholland [Mon, 25 May 2009 00:29:08 +0000 (00:29 +0000)]
Remove obviously botched test for "fast mode" based on terminal speed.
Default to "fast mode" as ~nobody has a 300 baud terminal any more.
("Fast mode" apparently controls whether short-range scans are printed
by default at certain times.)

15 years agoUse getopt to handle the remaining (all currently undocumented) options.
dholland [Mon, 25 May 2009 00:25:58 +0000 (00:25 +0000)]
Use getopt to handle the remaining (all currently undocumented) options.

15 years agoRemove last traces of undocumented -p option (apparently related to
dholland [Mon, 25 May 2009 00:20:22 +0000 (00:20 +0000)]
Remove last traces of undocumented -p option (apparently related to
process priority) and documented -a option, neither of which have
done anything since CSRG days.

15 years agoDon't give special privileges to uid 13107.
dholland [Mon, 25 May 2009 00:12:32 +0000 (00:12 +0000)]
Don't give special privileges to uid 13107.

15 years ago__attribute__((__noreturn__)) -> __dead
dholland [Mon, 25 May 2009 00:07:14 +0000 (00:07 +0000)]
__attribute__((__noreturn__)) -> __dead

15 years agoNull for pointers, not 0.
dholland [Mon, 25 May 2009 00:05:56 +0000 (00:05 +0000)]
Null for pointers, not 0.

15 years agoFix score printing so columns line up.
dholland [Mon, 25 May 2009 00:03:18 +0000 (00:03 +0000)]
Fix score printing so columns line up.

15 years agoAbolish cgetc(). It contained one line of code, which was wrong.
dholland [Sun, 24 May 2009 23:20:22 +0000 (23:20 +0000)]
Abolish cgetc(). It contained one line of code, which was wrong.
Call getchar() directly, and handle EOF properly instead of looping
(in some cases) or pretending that EOF is 0 (which it isn't).

15 years agoRemove unnecessary initialization that silenced a compiler warning in 1997.
dholland [Sun, 24 May 2009 23:00:46 +0000 (23:00 +0000)]
Remove unnecessary initialization that silenced a compiler warning in 1997.

15 years agoSprinkle some blank lines for readability.
dholland [Sun, 24 May 2009 22:57:37 +0000 (22:57 +0000)]
Sprinkle some blank lines for readability.

15 years agoSplit up lines > 80 chars. Object files unchanged.
dholland [Sun, 24 May 2009 22:55:03 +0000 (22:55 +0000)]
Split up lines > 80 chars. Object files unchanged.

15 years agoDon't use literal ^G's in string constants. Use \a.
dholland [Sun, 24 May 2009 21:55:24 +0000 (21:55 +0000)]
Don't use literal ^G's in string constants. Use \a.

15 years agoKNF: brace and comment placement. Object files identical.
dholland [Sun, 24 May 2009 21:44:56 +0000 (21:44 +0000)]
KNF: brace and comment placement. Object files identical.

15 years agowhitespace
dholland [Sun, 24 May 2009 20:43:09 +0000 (20:43 +0000)]
whitespace

15 years agoKNF: fix formatting of preprocessor directives
dholland [Sun, 24 May 2009 20:39:43 +0000 (20:39 +0000)]
KNF: fix formatting of preprocessor directives

15 years agoANSIfy function declarations. No object file diffs except for two functions
dholland [Sun, 24 May 2009 19:18:44 +0000 (19:18 +0000)]
ANSIfy function declarations. No object file diffs except for two functions
whose K&R declaration didn't fully match the prototype (char vs. int) and
the diff of the disassembly of those looks plausible.

15 years agoKNF. No change to .o file.
dholland [Sun, 24 May 2009 18:22:27 +0000 (18:22 +0000)]
KNF. No change to .o file.

15 years agoChange getdate() to getdatestr() since the former maybe present on systems
ginsbach [Wed, 6 May 2009 02:59:12 +0000 (02:59 +0000)]
Change getdate() to getdatestr() since the former maybe present on systems
supporting X/Open System Interfaces Extension (XSI) getdate() in <time.h>.
This prevents a function prototype conflict.

15 years agoRemove trailing whitespace.
wiz [Mon, 4 May 2009 20:37:28 +0000 (20:37 +0000)]
Remove trailing whitespace.

15 years agodefine YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160
drochner [Mon, 20 Apr 2009 16:05:29 +0000 (16:05 +0000)]
define YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160

15 years agoSort sections.
wiz [Sun, 12 Apr 2009 18:31:47 +0000 (18:31 +0000)]
Sort sections.

15 years agoDon't nest displays.
joerg [Sun, 12 Apr 2009 16:58:57 +0000 (16:58 +0000)]
Don't nest displays.

15 years agoConvert to mdoc markup. With input from wiz.
joerg [Sun, 12 Apr 2009 16:57:02 +0000 (16:57 +0000)]
Convert to mdoc markup. With input from wiz.

15 years ago\@ is not a valid escape sequence.
joerg [Thu, 9 Apr 2009 03:52:54 +0000 (03:52 +0000)]
\@ is not a valid escape sequence.

15 years agoAvoid hardcoded "too large" constant that caused FPE on the vax.
christos [Tue, 31 Mar 2009 18:48:16 +0000 (18:48 +0000)]
Avoid hardcoded "too large" constant that caused FPE on the vax.
XXX: Should pullup to 5.0

15 years agoSimplify previous; suggested by Paul Goyette
dholland [Sun, 15 Mar 2009 22:19:23 +0000 (22:19 +0000)]
Simplify previous; suggested by Paul Goyette

15 years agoFix sign-compare problem that crept in due to working from an old tree.
dholland [Sun, 15 Mar 2009 20:11:24 +0000 (20:11 +0000)]
Fix sign-compare problem that crept in due to working from an old tree.
Whoops. won't happen again...

15 years agogrammar fix
jnemeth [Sun, 15 Mar 2009 05:44:57 +0000 (05:44 +0000)]
grammar fix

15 years agoRework curses handling.
dholland [Sun, 15 Mar 2009 03:33:56 +0000 (03:33 +0000)]
Rework curses handling.

The most visible change is that the scrolling buffer of messages now
actually scrolls and keeps history, and you type on the bottom line only.
For now you can page through the history with ^P/^N; that's not ideal but
one can't fix everything all at once.

Use resizeable array code (roughly the same that I floated a while ago
in connection with make) to hold the scroll.

15 years agoMove newturn() from pl_7 to pl_2.
dholland [Sun, 15 Mar 2009 00:50:47 +0000 (00:50 +0000)]
Move newturn() from pl_7 to pl_2.
pl_7 was mostly curses/display stuff, is going to be all display stuff.
pl_2 is where the main loop lives.

15 years agoMove all curses bits to pl_7.c.
dholland [Sun, 15 Mar 2009 00:35:42 +0000 (00:35 +0000)]
Move all curses bits to pl_7.c.

15 years agoFix usage message
dholland [Sat, 14 Mar 2009 23:51:35 +0000 (23:51 +0000)]
Fix usage message

15 years agochdir to /var/games/sail while running, to simplify name handling.
dholland [Sat, 14 Mar 2009 23:47:18 +0000 (23:47 +0000)]
chdir to /var/games/sail while running, to simplify name handling.

15 years agoDon't crosswire the two kinds of path names, and don't croak on
dholland [Sat, 14 Mar 2009 23:12:20 +0000 (23:12 +0000)]
Don't crosswire the two kinds of path names, and don't croak on
scenario numbers > 99.

15 years agoTurns out the W_FILE message wasn't ever used.
dholland [Sat, 14 Mar 2009 22:54:05 +0000 (22:54 +0000)]
Turns out the W_FILE message wasn't ever used.

15 years agoCreate some abstraction for sending messages.
dholland [Sat, 14 Mar 2009 22:52:52 +0000 (22:52 +0000)]
Create some abstraction for sending messages.
Make a send and receive function for each possible message.
Make these have useful argument signatures.
Hide the list of message codes inside sync.c.

15 years agoDon't use perror()
dholland [Sat, 14 Mar 2009 20:14:56 +0000 (20:14 +0000)]
Don't use perror()

15 years agoconstify the version string
dholland [Sat, 14 Mar 2009 20:10:43 +0000 (20:10 +0000)]
constify the version string