summaryrefslogtreecommitdiffstats
path: root/sail
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-04-24 12:21:37 +0000
committercgd <cgd@NetBSD.org>1995-04-24 12:21:37 +0000
commita65a873e56c35780711e9f73872c4fe0254589b0 (patch)
tree5e3a2578839def2becc14922977dc641dfd01c20 /sail
parentd7c608df67f7b99aee31ddf6c13d8870695f6827 (diff)
downloadbsdgames-darwin-a65a873e56c35780711e9f73872c4fe0254589b0.tar.gz
bsdgames-darwin-a65a873e56c35780711e9f73872c4fe0254589b0.tar.zst
bsdgames-darwin-a65a873e56c35780711e9f73872c4fe0254589b0.zip
Various changes to make games compile w/o warnings on the alpha:
Include appropriate includes, delete bogus function declarations, change sizes of variables and casts.
Diffstat (limited to 'sail')
-rw-r--r--sail/dr_1.c10
-rw-r--r--sail/dr_2.c6
-rw-r--r--sail/externs.h3
-rw-r--r--sail/pl_4.c6
-rw-r--r--sail/pl_5.c6
-rw-r--r--sail/pl_main.c8
-rw-r--r--sail/sync.c16
7 files changed, 29 insertions, 26 deletions
diff --git a/sail/dr_1.c b/sail/dr_1.c
index 75605b37..de4c8c5f 100644
--- a/sail/dr_1.c
+++ b/sail/dr_1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_1.c,v 1.3 1995/04/22 10:36:46 cgd Exp $ */
+/* $NetBSD: dr_1.c,v 1.4 1995/04/24 12:25:10 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: dr_1.c,v 1.3 1995/04/22 10:36:46 cgd Exp $";
+static char rcsid[] = "$NetBSD: dr_1.c,v 1.4 1995/04/24 12:25:10 cgd Exp $";
#endif
#endif /* not lint */
@@ -187,7 +187,7 @@ int key;
makesignal(from, "boarders from %s repelled", to);
(void) sprintf(message, "killed in melee: %d. %s: %d",
totalto, from->shipname, totalfrom);
- Write(W_SIGNAL, to, 1, (int) message, 0, 0, 0);
+ Write(W_SIGNAL, to, 1, (long) message, 0, 0, 0);
if (key)
return 1;
} else if (strengthto >= fromstrength * 3) {
@@ -219,10 +219,10 @@ int key;
}
(void) sprintf(message, "captured by the %s!",
to->shipname);
- Write(W_SIGNAL, from, 1, (int) message, 0, 0, 0);
+ Write(W_SIGNAL, from, 1, (long) message, 0, 0, 0);
(void) sprintf(message, "killed in melee: %d. %s: %d",
totalto, from->shipname, totalfrom);
- Write(W_SIGNAL, to, 1, (int) message, 0, 0, 0);
+ Write(W_SIGNAL, to, 1, (long) message, 0, 0, 0);
mento = 0;
return 0;
}
diff --git a/sail/dr_2.c b/sail/dr_2.c
index 1e76dc6f..fbe58ba4 100644
--- a/sail/dr_2.c
+++ b/sail/dr_2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_2.c,v 1.3 1995/04/22 10:36:48 cgd Exp $ */
+/* $NetBSD: dr_2.c,v 1.4 1995/04/24 12:25:12 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: dr_2.c,v 1.3 1995/04/22 10:36:48 cgd Exp $";
+static char rcsid[] = "$NetBSD: dr_2.c,v 1.4 1995/04/24 12:25:12 cgd Exp $";
#endif
#endif /* not lint */
@@ -116,7 +116,7 @@ prizecheck()
continue;
if (sp->specs->crew1 + sp->specs->crew2 + sp->specs->crew3 > sp->file->pcrew * 6) {
Write(W_SIGNAL, sp, 1,
- (int)"prize crew overthrown", 0, 0, 0);
+ (long)"prize crew overthrown", 0, 0, 0);
Write(W_POINTS, sp->file->captured, 0, sp->file->captured->file->points - 2 * sp->specs->pts, 0, 0, 0);
Write(W_CAPTURED, sp, 0, -1, 0, 0, 0);
}
diff --git a/sail/externs.h b/sail/externs.h
index 0894881d..ad28a387 100644
--- a/sail/externs.h
+++ b/sail/externs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: externs.h,v 1.3 1995/04/22 10:36:55 cgd Exp $ */
+/* $NetBSD: externs.h,v 1.4 1995/04/24 12:25:15 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,6 +37,7 @@
#include <stdio.h>
#include <signal.h>
+#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include "machdep.h"
diff --git a/sail/pl_4.c b/sail/pl_4.c
index b5ea560e..535ed86b 100644
--- a/sail/pl_4.c
+++ b/sail/pl_4.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_4.c,v 1.3 1995/04/22 10:37:10 cgd Exp $ */
+/* $NetBSD: pl_4.c,v 1.4 1995/04/24 12:25:17 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: pl_4.c,v 1.3 1995/04/22 10:37:10 cgd Exp $";
+static char rcsid[] = "$NetBSD: pl_4.c,v 1.4 1995/04/24 12:25:17 cgd Exp $";
#endif
#endif /* not lint */
@@ -80,7 +80,7 @@ acceptsignal()
;
p[-1] = '"';
*p = 0;
- Write(W_SIGNAL, ms, 1, (int)buf, 0, 0, 0);
+ Write(W_SIGNAL, ms, 1, (long)buf, 0, 0, 0);
}
lookout()
diff --git a/sail/pl_5.c b/sail/pl_5.c
index 938f0e87..f8df3291 100644
--- a/sail/pl_5.c
+++ b/sail/pl_5.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_5.c,v 1.3 1995/04/22 10:37:12 cgd Exp $ */
+/* $NetBSD: pl_5.c,v 1.4 1995/04/24 12:25:21 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: pl_5.c,v 1.3 1995/04/22 10:37:12 cgd Exp $";
+static char rcsid[] = "$NetBSD: pl_5.c,v 1.4 1995/04/24 12:25:21 cgd Exp $";
#endif
#endif /* not lint */
@@ -145,7 +145,7 @@ acceptmove()
(void) strcpy(movebuf, buf);
else
(void) strcpy(movebuf, "d");
- Write(W_MOVE, ms, 1, (int)movebuf, 0, 0, 0);
+ Write(W_MOVE, ms, 1, (long)movebuf, 0, 0, 0);
Signal("Helm: %s.", (struct ship *)0, movebuf);
}
diff --git a/sail/pl_main.c b/sail/pl_main.c
index f31ef33e..9bd466a6 100644
--- a/sail/pl_main.c
+++ b/sail/pl_main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_main.c,v 1.4 1995/04/22 10:37:20 cgd Exp $ */
+/* $NetBSD: pl_main.c,v 1.5 1995/04/24 12:25:25 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: pl_main.c,v 1.4 1995/04/22 10:37:20 cgd Exp $";
+static char rcsid[] = "$NetBSD: pl_main.c,v 1.5 1995/04/24 12:25:25 cgd Exp $";
#endif
#endif /* not lint */
@@ -211,7 +211,7 @@ reprint:
captain[strlen(captain) - 1] = '\0';
}
captain[sizeof captain - 1] = '\0';
- Write(W_CAPTAIN, ms, 1, (int)captain, 0, 0, 0);
+ Write(W_CAPTAIN, ms, 1, (long)captain, 0, 0, 0);
for (n = 0; n < 2; n++) {
char buf[10];
@@ -247,6 +247,6 @@ reprint:
initscreen();
draw_board();
(void) sprintf(message, "Captain %s assuming command", captain);
- Write(W_SIGNAL, ms, 1, (int)message, 0, 0, 0);
+ Write(W_SIGNAL, ms, 1, (long)message, 0, 0, 0);
newturn();
}
diff --git a/sail/sync.c b/sail/sync.c
index ec4fc61d..20ab46cd 100644
--- a/sail/sync.c
+++ b/sail/sync.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sync.c,v 1.3 1995/04/22 10:37:26 cgd Exp $ */
+/* $NetBSD: sync.c,v 1.4 1995/04/24 12:25:28 cgd Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)sync.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: sync.c,v 1.3 1995/04/22 10:37:26 cgd Exp $";
+static char rcsid[] = "$NetBSD: sync.c,v 1.4 1995/04/24 12:25:28 cgd Exp $";
#endif
#endif /* not lint */
@@ -61,6 +61,7 @@ makesignal(from, fmt, ship, a, b, c)
struct ship *from;
char *fmt;
register struct ship *ship;
+ long a, b, c;
{
char message[80];
@@ -70,7 +71,7 @@ makesignal(from, fmt, ship, a, b, c)
(void) sprintf(message, fmt,
ship->shipname, colours(ship),
sterncolour(ship), a, b, c);
- Write(W_SIGNAL, from, 1, (int)message, 0, 0, 0);
+ Write(W_SIGNAL, from, 1, (long)message, 0, 0, 0);
}
#include <sys/types.h>
@@ -125,7 +126,7 @@ Write(type, ship, isstr, a, b, c, d)
int type;
struct ship *ship;
char isstr;
- int a, b, c, d;
+ long a, b, c, d;
{
if (isstr)
(void) sprintf(sync_bp, "%d %d %d %s\n",
@@ -145,7 +146,8 @@ Sync()
{
sig_t sighup, sigint;
register n;
- int type, shipnum, isstr, a, b, c, d;
+ int type, shipnum, isstr;
+ long a, b, c, d;
char buf[80];
char erred = 0;
extern errno;
@@ -200,7 +202,7 @@ Sync()
*p = 0;
for (p = buf; *p == ' '; p++)
;
- a = (int)p;
+ a = (long)p;
b = c = d = 0;
} else
if (fscanf(sync_fp, "%d%d%d%d", &a, &b, &c, &d) != 4)
@@ -232,7 +234,7 @@ out:
sync_update(type, ship, a, b, c, d)
int type;
register struct ship *ship;
- int a, b, c, d;
+ long a, b, c, d;
{
switch (type) {
case W_DBP: {