-/* $NetBSD: save.c,v 1.13 2012/01/08 18:16:00 dholland Exp $ */
+/* $NetBSD: save.c,v 1.14 2014/03/22 22:04:40 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: save.c,v 1.13 2012/01/08 18:16:00 dholland Exp $");
+__RCSID("$NetBSD: save.c,v 1.14 2014/03/22 22:04:40 dholland Exp $");
#endif
#endif /* not lint */
#include "hdr.h"
#include "extern.h"
+#define __arraycount(a) (sizeof(a) / sizeof(*(a)))
+
struct savefile {
FILE *f;
const char *name;
bool warned;
- unsigned bintextpos;
+ size_t bintextpos;
uint32_t key;
struct crcstate crc;
unsigned char pad[8];
for (i=0; i<datalen; i++) {
val = val ^ 0xbadc0ffee;
val = (val << 4) | (val >> 60);
- val += udata[i] ^ 0xbeef;
+ val += udata[i] ^ 0xbeefU;
}
uval = (unsigned char *)&val;
struct compat_saveinfo {
void *address;
- int width;
+ size_t width;
};
static const struct compat_saveinfo compat_savearray[] =
const struct compat_saveinfo *p;
char *s;
long sum, cksum = 0;
- int i;
+ size_t i;
struct crcstate crc;
if ((in = fopen(infile, "rb")) == NULL) {