]> git.cameronkatri.com Git - bsdgames-darwin.git/log
bsdgames-darwin.git
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

15 years agoSprinkle some "bool". And don't use '\0' to mean 'false'.
dholland [Sat, 14 Mar 2009 20:04:43 +0000 (20:04 +0000)]
Sprinkle some "bool". And don't use '\0' to mean 'false'.

15 years agoUse \a instead of \7 for BEL.
dholland [Sat, 14 Mar 2009 19:57:14 +0000 (19:57 +0000)]
Use \a instead of \7 for BEL.

15 years agoPrune a comment referring to objects that (AFAICT) didn't even exist in -r1.1.
dholland [Sat, 14 Mar 2009 19:55:16 +0000 (19:55 +0000)]
Prune a comment referring to objects that (AFAICT) didn't even exist in -r1.1.

15 years agoDon't cast the return value of calloc().
dholland [Sat, 14 Mar 2009 19:36:42 +0000 (19:36 +0000)]
Don't cast the return value of calloc().

15 years agoLines <= 80 chars, remove trailing whitespace, other formatting adjustments.
dholland [Sat, 14 Mar 2009 19:35:13 +0000 (19:35 +0000)]
Lines <= 80 chars, remove trailing whitespace, other formatting adjustments.
No functional change.

15 years agoRemove some unnecessary casts.
dholland [Sat, 14 Mar 2009 18:41:21 +0000 (18:41 +0000)]
Remove some unnecessary casts.

15 years agoString buffer cleanup. sprintf bad.
dholland [Sat, 14 Mar 2009 18:32:47 +0000 (18:32 +0000)]
String buffer cleanup. sprintf bad.

15 years agoDon't use char for random state variables; use int or bool.
dholland [Sat, 14 Mar 2009 17:10:01 +0000 (17:10 +0000)]
Don't use char for random state variables; use int or bool.

15 years agoFix list markup. Use .Ic for key as suggested by wiz.
joerg [Wed, 11 Mar 2009 16:37:06 +0000 (16:37 +0000)]
Fix list markup. Use .Ic for key as suggested by wiz.

15 years agoFix preamble
joerg [Wed, 11 Mar 2009 13:06:10 +0000 (13:06 +0000)]
Fix preamble

15 years agoRemove redundant .br
joerg [Wed, 11 Mar 2009 13:05:59 +0000 (13:05 +0000)]
Remove redundant .br

15 years agoFix markup
joerg [Wed, 11 Mar 2009 13:05:46 +0000 (13:05 +0000)]
Fix markup

15 years agoFix preamble
joerg [Wed, 11 Mar 2009 13:01:49 +0000 (13:01 +0000)]
Fix preamble

15 years agoFix markup
joerg [Wed, 11 Mar 2009 13:00:37 +0000 (13:00 +0000)]
Fix markup

15 years agosprintf -> snprintf
dholland [Mon, 9 Mar 2009 04:38:39 +0000 (04:38 +0000)]
sprintf -> snprintf

15 years agoMove HISTORY to proper place.
dholland [Mon, 2 Mar 2009 10:16:54 +0000 (10:16 +0000)]
Move HISTORY to proper place.

15 years agoEdit. Sync with reality, at least partway. Bump date.
dholland [Mon, 2 Mar 2009 10:14:41 +0000 (10:14 +0000)]
Edit. Sync with reality, at least partway. Bump date.

15 years agoSort options. End sentence with a dot.
wiz [Mon, 2 Mar 2009 09:39:10 +0000 (09:39 +0000)]
Sort options. End sentence with a dot.

15 years agomdocify. Partly merged from OpenBSD. Not by any means perfect yet.
dholland [Mon, 2 Mar 2009 09:23:57 +0000 (09:23 +0000)]
mdocify. Partly merged from OpenBSD. Not by any means perfect yet.

15 years agoMore fixes from OpenBSD: use err instead of perror, don't hork on EOF
dholland [Mon, 2 Mar 2009 07:33:30 +0000 (07:33 +0000)]
More fixes from OpenBSD: use err instead of perror, don't hork on EOF
during the initial setup questions.

15 years agoCheck for failure of fgets when reading the captain's name, and don't
dholland [Mon, 2 Mar 2009 07:21:56 +0000 (07:21 +0000)]
Check for failure of fgets when reading the captain's name, and don't
allow it to be empty. From OpenBSD.

15 years agoUse errx() to send fatal error messages. From OpenBSD.
dholland [Mon, 2 Mar 2009 07:17:24 +0000 (07:17 +0000)]
Use errx() to send fatal error messages. From OpenBSD.

15 years agoUse errx/warnx instead of printing to stderr. From OpenBSD.
dholland [Mon, 2 Mar 2009 06:54:01 +0000 (06:54 +0000)]
Use errx/warnx instead of printing to stderr. From OpenBSD.

15 years agoUse err(3) and errx(3), not perror and fprintf to stderr. From OpenBSD.
dholland [Mon, 2 Mar 2009 06:44:22 +0000 (06:44 +0000)]
Use err(3) and errx(3), not perror and fprintf to stderr. From OpenBSD.

15 years agoBraces around a nested if, for clarity; suggested by diffing against OpenBSD.
dholland [Mon, 2 Mar 2009 06:43:53 +0000 (06:43 +0000)]
Braces around a nested if, for clarity; suggested by diffing against OpenBSD.

16 years agoFix bogus conditional caught by today's make. It looks as if MKHIDEGAME
dholland [Sun, 18 Jan 2009 20:22:45 +0000 (20:22 +0000)]
Fix bogus conditional caught by today's make. It looks as if MKHIDEGAME
has never worked since it was introduced in 2002... clearly a lot of
people care about that.

It should work now, but because it's evidently never been tested it
may also require setlist adjustments.

16 years agouse %zu to print size_t
tnn [Sun, 18 Jan 2009 13:30:33 +0000 (13:30 +0000)]
use %zu to print size_t

16 years agofix -Wsign-compare issues
lukem [Sun, 18 Jan 2009 00:24:29 +0000 (00:24 +0000)]
fix -Wsign-compare issues

16 years agoFix fiance/fiancee confusion. Fix another typo.
wiz [Tue, 2 Dec 2008 14:21:26 +0000 (14:21 +0000)]
Fix fiance/fiancee confusion. Fix another typo.
Jason McIntyre <jmc@kerhand.co.uk>.

16 years agoFix insure -> ensure confusion. From Jason McIntyre <jmc@kerhand.co.uk>.
wiz [Tue, 2 Dec 2008 14:21:02 +0000 (14:21 +0000)]
Fix insure -> ensure confusion. From Jason McIntyre <jmc@kerhand.co.uk>.

16 years agoPR/39923: Valery Ushakov: trek(6) can spin, consuming 100% CPU on powerpc
christos [Fri, 14 Nov 2008 21:10:44 +0000 (21:10 +0000)]
PR/39923: Valery Ushakov: trek(6) can spin, consuming 100% CPU on powerpc
On systems where char is unsigned the number of black holes can end up being
very large (instead of negative).

16 years agomore MKSHARE == no fixes:
mrg [Thu, 30 Oct 2008 21:37:55 +0000 (21:37 +0000)]
more MKSHARE == no fixes:
- move installation of atf pkg-config files out of share/atf/
- don't install spell or ching share files
- update some directory entries to not have 'share' tag

now my MKLINT=no MKSHARE=no MKPROFILE=no builds work again.

16 years agoUse uint32_t and include <stdint.h>, instead of using u_int32_t
apb [Sun, 19 Oct 2008 07:56:42 +0000 (07:56 +0000)]
Use uint32_t and include <stdint.h>, instead of using u_int32_t
and including <sys/types.h>.

16 years agoMake this build on Mac OS X.
agc [Mon, 29 Sep 2008 12:30:12 +0000 (12:30 +0000)]
Make this build on Mac OS X.

16 years agoInstall unstr:
apb [Fri, 26 Sep 2008 18:56:43 +0000 (18:56 +0000)]
Install unstr:
* in games/fortune/Makefile, add unstr to SUBDIR;
* in games/fortune/unstr/Makefile, include ../../Makefile.inc;
* in games/fortune/strfile/Makefile, add MLINKS for unstr man page;
* in distrib/sets/lists/games/mi, add new files.

16 years agoBuild strfile both as a host tool and as an installed program:
apb [Fri, 26 Sep 2008 18:23:09 +0000 (18:23 +0000)]
Build strfile both as a host tool and as an installed program:
* in games/fortune/strfile/Makefile, build strfile as a
  regular program instead of as a host tool;
* add tools/strfile directory to build strfile as a host tool;
* in tools/Makefile, add strfile to SUBDIR list;
* in BSD.*.mk, define TOOL_STRFILE variable;
* in games/fortune/datfiles/Makefile, use TOOL_STRFILE when creating
  databases at build time;
* in distrib/sets/lists/games/mi, mention usr/games/strfile.

16 years agoMake this pass WARNS=4:
apb [Fri, 26 Sep 2008 13:46:48 +0000 (13:46 +0000)]
Make this pass WARNS=4:
* u_int32_t -> uint32_t, and remove ifdef test.
* add function prototypes.

16 years agoBoth legs of the conditional operator must return the same type.
gmcgarry [Fri, 29 Aug 2008 00:37:38 +0000 (00:37 +0000)]
Both legs of the conditional operator must return the same type.

16 years agoWrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags...
gmcgarry [Fri, 29 Aug 2008 00:02:21 +0000 (00:02 +0000)]
Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC.

16 years agoif initscr() fails, exit with a message rather than crash in the
drochner [Fri, 8 Aug 2008 16:10:47 +0000 (16:10 +0000)]
if initscr() fails, exit with a message rather than crash in the
next curses call

16 years agoRemove the \n and tabs from the __COPYRIGHT() strings.
lukem [Mon, 21 Jul 2008 13:24:38 +0000 (13:24 +0000)]
Remove the \n and tabs from the __COPYRIGHT() strings.

16 years agoRemove the \n and tabs from the __COPYRIGHT() strings.
lukem [Sun, 20 Jul 2008 00:52:39 +0000 (00:52 +0000)]
Remove the \n and tabs from the __COPYRIGHT() strings.