dholland
8b5e597afa
Move ret_card() to cards.c, where it more rationally belongs. From OpenBSD.
2008-02-23 19:09:00 +00:00
dholland
32e86dd423
A few more whitespace/KNF. I keep hoping I've found them all...
2008-02-20 05:08:46 +00:00
dholland
1958cbf73e
Add the sizes to the extern array declarations. This may not be
...
necessary, but it's safe and reduces unnecessary divergence.
From OpenBSD.
2008-02-20 04:50:12 +00:00
dholland
a03fcca33d
Use random() rather than rand(). Suggested by diffing against OpenBSD.
2008-02-20 04:48:10 +00:00
dholland
72aa2a5043
Remove unused swap() macro.
2008-02-20 04:10:34 +00:00
dholland
fff414b851
Don't misuse random strings as printf formats, even where it's harmless.
...
Found by diffing against OpenBSD.
2008-02-20 04:10:01 +00:00
dholland
b63df5c6e0
One more (hopefully the last) whitespace fix.
2008-02-19 10:48:47 +00:00
dholland
3a2a525c4b
getinp() no longer magically treats the prompt arg as a printf format, so
...
don't escape % as %%. From OpenBSD.
2008-02-19 10:47:40 +00:00
dholland
e084c0089c
Move function heading comments to something vaguely like the right place.
2008-02-19 10:46:21 +00:00
dholland
16168c2070
KNF/whitespace nits. No functional changes.
2008-02-19 09:45:02 +00:00
dholland
eefb74f4dc
Fix bugs in debug printouts. From OpenBSD.
2008-02-19 09:34:40 +00:00
dholland
c4dc2f9e61
Don't use sprintf; use snprintf.
2008-02-19 09:32:34 +00:00
dholland
0419d05bfc
Don't use perror(); use err/warn instead.
...
Suggested by diffing against OpenBSD.
2008-02-19 09:30:26 +00:00
dholland
98ff506f59
Fix capitalization of street names. from pjanzen@openbsd
2008-02-19 09:28:05 +00:00
dholland
a7f37f4351
More typo fixes
2008-02-19 09:25:21 +00:00
dholland
b113ea6af6
Fix formatting bug apparently introduced when the page was mdoc'd. (Had
...
.Nm, should have been .Pp.)
Also bump date; for some reason this hadn't been done since the original
import.
2008-02-19 09:24:43 +00:00
dholland
df819b0896
Remove transient thingy that wasn't supposed to see the light of day, and
...
finish dealing with some local variables that shadow a global. (hi dholland)
2008-02-19 09:05:55 +00:00
dholland
5538b1cced
Fix (another) typo in comment
2008-02-19 08:26:10 +00:00
dholland
c1dc5a85f2
Fix typo in comment
2008-02-19 08:07:51 +00:00
dholland
591ca18c53
Split some code from moreobj.c into action.c, as per larn 12.2.
2008-02-19 06:05:26 +00:00
he
75194e6a79
Typo correction: s/than/that/ in one instance.
2008-02-15 09:24:52 +00:00
dholland
f5334b0815
More assorted cleanup merged from larn 12.2.
2008-02-04 01:07:01 +00:00
dholland
c310e89d2d
Once upon a time, larn 12.0 had functions named getchar() and putchar()
...
that conflicted with libc. We changed them to lgetchar() and xputchar()
respectively; larn 12.2 changed them to ttgetch() and ttputch(). After
reflecting on this for a while I've decided to adopt the larn 12.2
names; not so much for compatibility but for consistency going forward.
So, massrename them. Also make ttputch() static.
2008-02-03 21:24:58 +00:00
dholland
e87aa9031c
Don't create files mode 666 in /var. (The code in question is not enabled
...
by default, though.)
2008-02-03 20:41:53 +00:00
dholland
5c10491064
Larn does not need its own private versions of functions from <ctype.h>.
...
Also, remove the function gettokstr(), which is not used. From larn 12.2.
2008-02-03 20:11:04 +00:00
dholland
b6e0b3d3c9
A long time ago, larn had code to prohibit playing it during work hours.
...
Most of this code was removed ages ago, probably when dm(6) was invented;
long before -r1.1 in the NetBSD tree in any event.
Now remove the last fragment of it.
Also nuke the file of US holidays 1987-1993 that we've been carrying
around for no reason.
2008-02-03 20:01:24 +00:00
dholland
ef066a156b
Some assorted minor cleanups, from larn 12.2.
2008-02-03 19:29:50 +00:00
dholland
d7ba3de791
Make a bunch of functions static. Merged from larn 12.2.
2008-02-03 19:20:40 +00:00
dholland
ded3829627
Use mkstemp to make the temporary files used when you win.
2008-02-03 03:49:15 +00:00
dholland
511d1e002c
Since games are (now) setgid, not setuid, it is no longer necessary to
...
manipulate the effective uid, only the effective gid.
2008-02-03 03:45:55 +00:00
wiz
1b89543c7f
Document -d.
2008-02-03 03:29:17 +00:00
matt
c0033b9584
Add a -d flag so that primes will print the difference between the current
...
prime and the previous prime. [I needed that for some reason I don't recall
and these changes lying about. Since they might be useful/interesting to
someone, I might as well as commit them.]
2008-02-02 18:15:14 +00:00
matt
375a7f707b
Fix typo: sive -> sieve.
2008-02-02 17:45:05 +00:00
dholland
b67b08da79
Pedanticism about time_t (not really a bug, but now it won't show up when
...
audited.)
2008-01-31 05:22:45 +00:00
dholland
d64494c758
Fix y2038 bug: time_t != int.
2008-01-31 05:19:44 +00:00
dholland
d4f48e67da
Make the default WARNS for games 4. The only game that needs to set WARNS
...
to anything else now is rogue, so clear WARNS from the other makefiles.
2008-01-28 07:03:58 +00:00
dholland
d759c4a5e3
build with WARNS=4
2008-01-28 07:01:01 +00:00
dholland
3c439f438f
Make hack build with WARNS=4.
2008-01-28 06:55:41 +00:00
dholland
c074bb6654
Make this build with WARNS=4 by not reusing names from <math.h>.
2008-01-28 06:20:15 +00:00
dholland
0f032c1fb8
Make this build with WARNS=4 by not reusing names from ctype.h.
2008-01-28 06:18:23 +00:00
dholland
4e5cdff5fd
Make this build with WARNS=4.
2008-01-28 06:16:13 +00:00
dholland
712442be18
make mille build with WARNS=4
2008-01-28 05:55:10 +00:00
dholland
398690b6f4
Call srandom() as well as initializing the private random generator
...
(which is crappy and should be removed, but that's for another day...)
This way e.g. fortune cookies no longer appear always in the same order.
2008-01-28 05:48:57 +00:00
dholland
9cc7e27481
Larn now builds with WARNS=4.
2008-01-28 05:38:53 +00:00
dholland
3d81345939
Apparently the reason the printf arguments were all wrong is that larn
...
had its own private and not-quite-standard implementation of printf.
Remove it surgically with a chainsaw.
2008-01-28 04:04:17 +00:00
dholland
8ce4d17196
Add gcc printf format checking, and fix the abundant problems this revealed.
...
(It appears that someone sometime thought that you use %d to print a long.)
2008-01-28 03:39:30 +00:00
dholland
733dc966d8
clean for WARNS=4
2008-01-28 03:23:29 +00:00
dholland
3bf4735ba0
Work around gcc signedness warning: if you check for uid_t < 0, gcc warns
...
because it's unsigned, but I don't really want to rely on uid_t being
unsigned on every platform this code might propagate to.
2008-01-28 02:37:50 +00:00
dholland
a627b0395f
Build with WARNS=4. Sort out the game's shadowing of its own variables,
...
which fixes at least one bug.
2008-01-28 01:58:01 +00:00
dholland
bded8baaa8
Build with WARNS=4. (All fixes are cosmetic, except that it's definitely
...
bad karma to shadow a local variable with another of the same name in a
nested block...)
2008-01-28 01:38:59 +00:00