summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>2002-02-23 09:59:45 +0000
committerbillf <billf@FreeBSD.org>2002-02-23 09:59:45 +0000
commita79402e12e0f01b5ada818d4126c191668d1740f (patch)
tree9da757747a2c09b909211186937c2ad27e532aed /games
parentd9e076081087f47dac817ee9b92ebabf51d8b8c2 (diff)
downloadFreeBSD-src-a79402e12e0f01b5ada818d4126c191668d1740f.zip
FreeBSD-src-a79402e12e0f01b5ada818d4126c191668d1740f.tar.gz
warning fixes, mostly type matching
Diffstat (limited to 'games')
-rw-r--r--games/adventure/crc.c2
-rw-r--r--games/adventure/hdr.h2
-rw-r--r--games/adventure/io.c2
-rw-r--r--games/adventure/save.c14
4 files changed, 10 insertions, 10 deletions
diff --git a/games/adventure/crc.c b/games/adventure/crc.c
index 0c9bd62..3c48d86 100644
--- a/games/adventure/crc.c
+++ b/games/adventure/crc.c
@@ -120,7 +120,7 @@ crc_start(void)
/* Process nr bytes at a time; ptr points to them */
u_long
-crc(const char *ptr, int nr)
+crc(const char *ptr, size_t nr)
{
int i;
const char *p;
diff --git a/games/adventure/hdr.h b/games/adventure/hdr.h
index 02d3ad2..6f6f8df 100644
--- a/games/adventure/hdr.h
+++ b/games/adventure/hdr.h
@@ -167,7 +167,7 @@ void caveclose (void);
void checkhints (void);
void ciao (void);
void closing (void);
-u_long crc (const char *ptr, int nr);
+u_long crc (const char *ptr, size_t nr);
void crc_start (void);
int dark (void);
void datime (int *d, int *t);
diff --git a/games/adventure/io.c b/games/adventure/io.c
index 36d6d49..04f17ee 100644
--- a/games/adventure/io.c
+++ b/games/adventure/io.c
@@ -526,7 +526,7 @@ pspeak(int m, int skip)
char *tbuf;
msg = &ptext[m];
- if ((tbuf=(char *) malloc(msg->txtlen + 1)) == 0)
+ if ((tbuf = malloc((unsigned int)(msg->txtlen + 1))) == 0)
errx(1, "Out of memory!");
memcpy(tbuf, msg->seekadr, (size_t)msg->txtlen + 1); /* Room to null */
s = tbuf;
diff --git a/games/adventure/save.c b/games/adventure/save.c
index 65a474e..234ce63 100644
--- a/games/adventure/save.c
+++ b/games/adventure/save.c
@@ -52,7 +52,7 @@ static const char rcsid[] =
struct savestruct
{
void *address;
- int width;
+ size_t width;
};
struct savestruct save_array[] =
@@ -129,13 +129,13 @@ save(const char *outfile)
FILE *out;
struct savestruct *p;
char *s;
- long sum;
- int i;
+ unsigned long sum;
+ size_t i;
crc_start();
for (p = save_array; p->address != NULL; p++)
sum = crc(p->address, p->width);
- srandom((int) sum);
+ srandom(sum);
if ((out = fopen(outfile, "wb")) == NULL)
{
@@ -162,8 +162,8 @@ restore(const char *infile)
FILE *in;
struct savestruct *p;
char *s;
- long sum, cksum;
- int i;
+ unsigned long sum, cksum;
+ size_t i;
cksum = 0;
if ((in = fopen(infile, "rb")) == NULL)
@@ -175,7 +175,7 @@ restore(const char *infile)
}
fread(&sum, sizeof(sum), 1, in); /* Get the seed */
- srandom((int) sum);
+ srandom(sum);
for (p = save_array; p->address != NULL; p++)
{
fread(p->address, p->width, 1, in);
OpenPOWER on IntegriCloud