warning fixes, mostly type matching
This commit is contained in:
parent
7ae0a1a66b
commit
adddfd0667
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user