summaryrefslogtreecommitdiffstats
path: root/sail
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-03-14 17:10:01 +0000
committerdholland <dholland@NetBSD.org>2009-03-14 17:10:01 +0000
commit8e56f6b8823a74c576682b4191df9d6182d0001d (patch)
tree25efd121bffe5ea4ae4e3af6bd87f6cabe341a8f /sail
parentcfa461ff44440ac1e3ff1b1121af688cd3cbba04 (diff)
downloadbsdgames-darwin-8e56f6b8823a74c576682b4191df9d6182d0001d.tar.gz
bsdgames-darwin-8e56f6b8823a74c576682b4191df9d6182d0001d.tar.zst
bsdgames-darwin-8e56f6b8823a74c576682b4191df9d6182d0001d.zip
Don't use char for random state variables; use int or bool.
Diffstat (limited to 'sail')
-rw-r--r--sail/dr_2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sail/dr_2.c b/sail/dr_2.c
index 72c6ef7e..e082a72b 100644
--- a/sail/dr_2.c
+++ b/sail/dr_2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_2.c,v 1.20 2009/03/02 06:43:53 dholland Exp $ */
+/* $NetBSD: dr_2.c,v 1.21 2009/03/14 17:10:01 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,10 +34,11 @@
#if 0
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_2.c,v 1.20 2009/03/02 06:43:53 dholland Exp $");
+__RCSID("$NetBSD: dr_2.c,v 1.21 2009/03/14 17:10:01 dholland Exp $");
#endif
#endif /* not lint */
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -48,7 +49,7 @@ __RCSID("$NetBSD: dr_2.c,v 1.20 2009/03/02 06:43:53 dholland Exp $");
static int str_end(const char *);
static int score(struct ship *, struct ship *, char *, int);
-static void move_ship(struct ship *, const char *, unsigned char *, short *, short *, char *);
+static void move_ship(struct ship *, const char *, unsigned char *, short *, short *, int *);
static void try(struct ship *, struct ship *, char *, char *, int, int, int, int, int, int *, int);
static void rmend(char *);
@@ -58,7 +59,7 @@ void
thinkofgrapples(void)
{
struct ship *sp, *sq;
- char friendly;
+ bool friendly;
foreachship(sp) {
if (sp->file->captain[0] || sp->file->dir == 0)
@@ -158,7 +159,7 @@ closeon(struct ship *from, struct ship *to, char *command, int ta, int ma, int a
static int
score(struct ship *ship, struct ship *to, char *movement, int onlytemp)
{
- char drift;
+ int drift;
int row, col, dir, total, ran;
struct File *fp = ship->file;
@@ -187,7 +188,7 @@ score(struct ship *ship, struct ship *to, char *movement, int onlytemp)
}
static void
-move_ship(struct ship *ship, const char *p, unsigned char *dir, short *row, short *col, char *drift)
+move_ship(struct ship *ship, const char *p, unsigned char *dir, short *row, short *col, int *drift)
{
int dist;
char moved = 0;