diff options
author | 1997-10-13 19:42:53 +0000 | |
---|---|---|
committer | 1997-10-13 19:42:53 +0000 | |
commit | 7e5c0c57606f0f1e9335aa74ef5ea8c8048a9b2c (patch) | |
tree | e32f911a4774980914f141c9b101745fb106eefe /sail/pl_1.c | |
parent | c1a3f2353b38d22d94cbc0101f3115b8e2eefc30 (diff) | |
download | bsdgames-darwin-7e5c0c57606f0f1e9335aa74ef5ea8c8048a9b2c.tar.gz bsdgames-darwin-7e5c0c57606f0f1e9335aa74ef5ea8c8048a9b2c.tar.zst bsdgames-darwin-7e5c0c57606f0f1e9335aa74ef5ea8c8048a9b2c.zip |
Warns fixes:
use varargs properly
use unsigned chars where appropriate
fix typos
eliminate gcc warnings
Diffstat (limited to 'sail/pl_1.c')
-rw-r--r-- | sail/pl_1.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/sail/pl_1.c b/sail/pl_1.c index 0abd1ac3..9c0e0100 100644 --- a/sail/pl_1.c +++ b/sail/pl_1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_1.c,v 1.3 1995/04/22 10:37:07 cgd Exp $ */ +/* $NetBSD: pl_1.c,v 1.4 1997/10/13 19:44:53 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)pl_1.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: pl_1.c,v 1.3 1995/04/22 10:37:07 cgd Exp $"; +__RCSID("$NetBSD: pl_1.c,v 1.4 1997/10/13 19:44:53 christos Exp $"); #endif #endif /* not lint */ @@ -53,6 +54,7 @@ static char rcsid[] = "$NetBSD: pl_1.c,v 1.3 1995/04/22 10:37:07 cgd Exp $"; * Of course, we don't do any more Sync()'s if we got here * because of a Sync() failure. */ +void leave(conditions) int conditions; { @@ -63,28 +65,24 @@ int conditions; (void) signal(SIGCHLD, SIG_IGN); if (done_curses) { - Signal("It looks like you've had it!", - (struct ship *)0); + Msg("It looks like you've had it!"); switch (conditions) { case LEAVE_QUIT: break; case LEAVE_CAPTURED: - Signal("Your ship was captured.", - (struct ship *)0); + Msg("Your ship was captured."); break; case LEAVE_HURRICAN: - Signal("Hurricane! All ships destroyed.", - (struct ship *)0); + Msg("Hurricane! All ships destroyed."); break; case LEAVE_DRIVER: - Signal("The driver died.", (struct ship *)0); + Msg("The driver died."); break; case LEAVE_SYNC: - Signal("Synchronization error.", (struct ship *)0); + Msg("Synchronization error."); break; default: - Signal("A funny thing happened (%d).", - (struct ship *)0, conditions); + Msg("A funny thing happened (%d).", conditions); } } else { switch (conditions) { @@ -106,7 +104,7 @@ int conditions; } if (ms != 0) { - log(ms); + logger(ms); if (conditions != LEAVE_SYNC) { makesignal(ms, "Captain %s relinquishing.", (struct ship *)0, mf->captain); @@ -119,14 +117,18 @@ int conditions; exit(0); } +/*ARGSUSED*/ void -choke() +choke(n) + int n; { leave(LEAVE_QUIT); } +/*ARGSUSED*/ void -child() +child(n) + int n; { union wait status; int pid; @@ -134,7 +136,7 @@ child() (void) signal(SIGCHLD, SIG_IGN); do { pid = wait3((int *)&status, WNOHANG, (struct rusage *)0); - if (pid < 0 || pid > 0 && !WIFSTOPPED(status)) + if (pid < 0 || (pid > 0 && !WIFSTOPPED(status))) hasdriver = 0; } while (pid > 0); (void) signal(SIGCHLD, child); |