1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

warning fixes, mostly type matching

This commit is contained in:
Bill Fumerola 2002-02-23 09:59:45 +00:00
parent b30325de41
commit c533148aab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91135
4 changed files with 10 additions and 10 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);