diff options
author | Bill Fumerola <billf@FreeBSD.org> | 2002-02-23 09:59:45 +0000 |
---|---|---|
committer | Bill Fumerola <billf@FreeBSD.org> | 2002-02-23 09:59:45 +0000 |
commit | c533148aab5eaf52382986bcd121a1f7996a8122 (patch) | |
tree | 9da757747a2c09b909211186937c2ad27e532aed | |
parent | b30325de41dfb24656fff9ed62ae396988b8386f (diff) |
warning fixes, mostly type matching
Notes
Notes:
svn path=/head/; revision=91135
-rw-r--r-- | games/adventure/crc.c | 2 | ||||
-rw-r--r-- | games/adventure/hdr.h | 2 | ||||
-rw-r--r-- | games/adventure/io.c | 2 | ||||
-rw-r--r-- | games/adventure/save.c | 14 |
4 files changed, 10 insertions, 10 deletions
diff --git a/games/adventure/crc.c b/games/adventure/crc.c index 0c9bd62db5f4..3c48d8645b74 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 02d3ad2d9d0f..6f6f8df0af71 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 36d6d498b41d..04f17ee1fca9 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 65a474e46338..234ce63f6fb4 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); |