All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit ebc4c413 authored by Mike Hibler's avatar Mike Hibler

Move a little closer to being pedantic ansi:

- add some missing casts
- avoid void * arithmetic
- change "q" printf formats to "ll"

Still not there yet by any means.  Note that the version of the NTFS library
we use won't compile with "-pedantic -ansi" so those are not part of the
default CFLAGS.
parent fc92b2b3
...@@ -115,7 +115,7 @@ union mapsect { ...@@ -115,7 +115,7 @@ union mapsect {
}; };
#define MSECT_S_SIZE 512 #define MSECT_S_SIZE 512
static inline u_int32_t static __inline u_int32_t
getsector(sectaddr_t *sect) getsector(sectaddr_t *sect)
{ {
int flags = (sect->device & DEVFLAGS) & ~HARD_DISK; int flags = (sect->device & DEVFLAGS) & ~HARD_DISK;
...@@ -146,7 +146,7 @@ getsector(sectaddr_t *sect) ...@@ -146,7 +146,7 @@ getsector(sectaddr_t *sect)
return sector; return sector;
} }
static inline void static __inline void
putsector(sectaddr_t *sect, u_int32_t sector, int device, int nsect) putsector(sectaddr_t *sect, u_int32_t sector, int device, int nsect)
{ {
int flags = (device & DEVFLAGS) & ~HARD_DISK; int flags = (device & DEVFLAGS) & ~HARD_DISK;
...@@ -168,7 +168,7 @@ putsector(sectaddr_t *sect, u_int32_t sector, int device, int nsect) ...@@ -168,7 +168,7 @@ putsector(sectaddr_t *sect, u_int32_t sector, int device, int nsect)
#define LILO_CKSUM 0xabcd #define LILO_CKSUM 0xabcd
static inline uint16_t static __inline uint16_t
lilocksum(union idescriptors *idp, uint16_t sum) lilocksum(union idescriptors *idp, uint16_t sum)
{ {
uint16_t *up = (uint16_t *)idp; uint16_t *up = (uint16_t *)idp;
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2003 University of Utah and the Flux Group. * Copyright (c) 2003, 2004 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -60,7 +60,8 @@ read_fatslice(int slice, int stype, u_int32_t start, u_int32_t size, ...@@ -60,7 +60,8 @@ read_fatslice(int slice, int stype, u_int32_t start, u_int32_t size,
return 1; return 1;
} }
if (readfat(infd, &boot, boot.ValidFat >= 0 ?: 0, &fat) != FSOK) if (readfat(infd, &boot,
boot.ValidFat >= 0 ? boot.ValidFat : 0, &fat) != FSOK)
return 1; return 1;
free(fat); free(fat);
......
...@@ -214,7 +214,7 @@ read_bsdpartition(int infd, struct disklabel *dlabel, int part) ...@@ -214,7 +214,7 @@ read_bsdpartition(int infd, struct disklabel *dlabel, int part)
fs.fs_cstotal.cs_nffree; fs.fs_cstotal.cs_nffree;
if (debug) { if (debug) {
fprintf(stderr, " bfree %9qd, bsize %9d, cgsize %9d\n", fprintf(stderr, " bfree %9lld, bsize %9d, cgsize %9d\n",
fs.fs_cstotal.cs_nbfree, fs.fs_bsize, fs.fs_cgsize); fs.fs_cstotal.cs_nbfree, fs.fs_bsize, fs.fs_cgsize);
} }
assert(fs.fs_cgsize <= MAXBSIZE); assert(fs.fs_cgsize <= MAXBSIZE);
...@@ -229,7 +229,7 @@ read_bsdpartition(int infd, struct disklabel *dlabel, int part) ...@@ -229,7 +229,7 @@ read_bsdpartition(int infd, struct disklabel *dlabel, int part)
if (devlseek(infd, sectobytes(cgoff), SEEK_SET) < 0) { if (devlseek(infd, sectobytes(cgoff), SEEK_SET) < 0) {
warn("BSD Partition '%c': " warn("BSD Partition '%c': "
"Could not seek to cg %d at %qd", "Could not seek to cg %d at %lld",
BSDPARTNAME(part), i, sectobytes(cgoff)); BSDPARTNAME(part), i, sectobytes(cgoff));
return 1; return 1;
} }
...@@ -372,14 +372,14 @@ static int ...@@ -372,14 +372,14 @@ static int
read_bsdcg(struct fs *fsp, struct cg *cgp, unsigned int dbstart) read_bsdcg(struct fs *fsp, struct cg *cgp, unsigned int dbstart)
{ {
int i, max; int i, max;
char *p; u_int8_t *p;
int count, j; int count, j;
max = fsp->fs_fpg; max = fsp->fs_fpg;
p = cg_blksfree(cgp); p = cg_blksfree(cgp);
/* paranoia: make sure we stay in the buffer */ /* paranoia: make sure we stay in the buffer */
assert(&p[max/NBBY] <= (char *)cgp + fsp->fs_cgsize); assert(&p[max/NBBY] <= (u_int8_t *)cgp + fsp->fs_cgsize);
/* /*
* XXX The bitmap is fragments, not FS blocks. * XXX The bitmap is fragments, not FS blocks.
......
...@@ -245,26 +245,26 @@ dumpfile(char *name, int fd) ...@@ -245,26 +245,26 @@ dumpfile(char *name, int fd)
if (detail > 0) if (detail > 0)
printf("\n"); printf("\n");
printf(" %qu bytes of overhead/wasted space (%5.2f%% of image file)\n", printf(" %llu bytes of overhead/wasted space (%5.2f%% of image file)\n",
wasted, (double)wasted / filesize * 100); wasted, (double)wasted / filesize * 100);
if (relocs) if (relocs)
printf(" %d relocations covering %qu bytes\n", printf(" %d relocations covering %llu bytes\n",
relocs, relocbytes); relocs, relocbytes);
printf(" %qu bytes of compressed data\n", printf(" %llu bytes of compressed data\n",
cbytes); cbytes);
printf(" %5.2fx compression of allocated data (%qu bytes)\n", printf(" %5.2fx compression of allocated data (%llu bytes)\n",
(double)dbytes / cbytes, dbytes); (double)dbytes / cbytes, dbytes);
printf(" %5.2fx compression of total known disk size (%qu bytes)\n", printf(" %5.2fx compression of total known disk size (%llu bytes)\n",
(double)tbytes / cbytes, tbytes); (double)tbytes / cbytes, tbytes);
if (franges) if (franges)
printf(" %d free ranges: %qu/%qu/%qu ave/min/max size\n", printf(" %d free ranges: %llu/%llu/%llu ave/min/max size\n",
franges, SECTOBYTES(sectfree)/franges, franges, SECTOBYTES(sectfree)/franges,
SECTOBYTES(fmin), SECTOBYTES(fmax)); SECTOBYTES(fmin), SECTOBYTES(fmax));
if (aranges) { if (aranges) {
int maxsz, i; int maxsz, i;
printf(" %d allocated ranges: %qu/%qu/%qu ave/min/max size\n", printf(" %d allocated ranges: %llu/%llu/%llu ave/min/max size\n",
aranges, SECTOBYTES(sectinuse)/aranges, aranges, SECTOBYTES(sectinuse)/aranges,
SECTOBYTES(amin), SECTOBYTES(amax)); SECTOBYTES(amin), SECTOBYTES(amax));
printf(" size distribution:\n"); printf(" size distribution:\n");
......
...@@ -65,7 +65,7 @@ struct hashinfo { ...@@ -65,7 +65,7 @@ struct hashinfo {
typedef struct readbuf { typedef struct readbuf {
queue_chain_t chain; queue_chain_t chain;
struct region region; struct region region;
char data[0]; unsigned char data[0];
} readbuf_t; } readbuf_t;
static unsigned long maxreadbufmem = MAXREADBUFMEM; static unsigned long maxreadbufmem = MAXREADBUFMEM;
...@@ -88,10 +88,10 @@ static void dumphash(char *name, struct hashinfo *hinfo); ...@@ -88,10 +88,10 @@ static void dumphash(char *name, struct hashinfo *hinfo);
static int createhash(char *name, struct hashinfo **hinfop); static int createhash(char *name, struct hashinfo **hinfop);
static int hashimage(char *name, struct hashinfo **hinfop); static int hashimage(char *name, struct hashinfo **hinfop);
static int hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop); static int hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop);
static char *spewhash(char *h); static char *spewhash(unsigned char *h);
static int imagecmp(char *ifile, char *dev); static int imagecmp(char *ifile, char *dev);
static int datacmp(uint32_t off, uint32_t size, char *idata); static int datacmp(uint32_t off, uint32_t size, unsigned char *idata);
static int startreader(char *name, struct hashinfo *hinfo); static int startreader(char *name, struct hashinfo *hinfo);
static void stopreader(void); static void stopreader(void);
...@@ -278,7 +278,8 @@ readhashinfo(char *name, struct hashinfo **hinfop) ...@@ -278,7 +278,8 @@ readhashinfo(char *name, struct hashinfo **hinfop)
free(hname); free(hname);
return -1; return -1;
} }
if (strcmp(hi.magic, HASH_MAGIC) != 0 || hi.version != HASH_VERSION) { if (strcmp((char *)hi.magic, HASH_MAGIC) != 0 ||
hi.version != HASH_VERSION) {
fprintf(stderr, "%s: not a valid signature file\n", hname); fprintf(stderr, "%s: not a valid signature file\n", hname);
goto bad; goto bad;
} }
...@@ -303,7 +304,7 @@ readhashinfo(char *name, struct hashinfo **hinfop) ...@@ -303,7 +304,7 @@ readhashinfo(char *name, struct hashinfo **hinfop)
static void static void
addhash(struct hashinfo **hinfop, int chunkno, uint32_t start, uint32_t size, addhash(struct hashinfo **hinfop, int chunkno, uint32_t start, uint32_t size,
char hash[HASH_MAXSIZE]) unsigned char hash[HASH_MAXSIZE])
{ {
struct hashinfo *hinfo = *hinfop; struct hashinfo *hinfo = *hinfop;
int nreg; int nreg;
...@@ -347,7 +348,7 @@ dumphash(char *name, struct hashinfo *hinfo) ...@@ -347,7 +348,7 @@ dumphash(char *name, struct hashinfo *hinfo)
} }
static char * static char *
spewhash(char *h) spewhash(unsigned char *h)
{ {
static char hbuf[33]; static char hbuf[33];
uint32_t *foo = (uint32_t *)h; uint32_t *foo = (uint32_t *)h;
...@@ -390,7 +391,7 @@ createhash(char *name, struct hashinfo **hinfop) ...@@ -390,7 +391,7 @@ createhash(char *name, struct hashinfo **hinfop)
* Write the image file * Write the image file
*/ */
hinfo = *hinfop; hinfo = *hinfop;
strcpy(hinfo->magic, HASH_MAGIC); strcpy((char *)hinfo->magic, HASH_MAGIC);
hinfo->version = HASH_VERSION; hinfo->version = HASH_VERSION;
hinfo->hashtype = hashtype; hinfo->hashtype = hashtype;
count = sizeof(*hinfo) + hinfo->nregions*sizeof(struct hashregion); count = sizeof(*hinfo) + hinfo->nregions*sizeof(struct hashregion);
...@@ -408,10 +409,10 @@ createhash(char *name, struct hashinfo **hinfop) ...@@ -408,10 +409,10 @@ createhash(char *name, struct hashinfo **hinfop)
free(hfile); free(hfile);
nhregions = hinfo->nregions; nhregions = hinfo->nregions;
printf("%s: %lu chunks, %lu regions, %lu hashregions, %qu data bytes\n", printf("%s: %lu chunks, %lu regions, %lu hashregions, %llu data bytes\n",
name, nchunks, nregions, nhregions, ndatabytes); name, nchunks, nregions, nhregions, ndatabytes);
#ifdef TIMEIT #ifdef TIMEIT
printf("%qu bytes: inflate cycles: %qu\n", ndatabytes, dcycles); printf("%qu bytes: inflate cycles: %llu\n", ndatabytes, dcycles);
#endif #endif
return 0; return 0;
} }
...@@ -536,15 +537,15 @@ checkhash(char *name, struct hashinfo *hinfo) ...@@ -536,15 +537,15 @@ checkhash(char *name, struct hashinfo *hinfo)
stopreader(); stopreader();
nhregions = hinfo->nregions; nhregions = hinfo->nregions;
printf("%s: %lu chunks, %lu hashregions, %qu data bytes\n", printf("%s: %lu chunks, %lu hashregions, %llu data bytes\n",
name, nchunks, nhregions, ndatabytes); name, nchunks, nhregions, ndatabytes);
if (badhashes) if (badhashes)
printf("%s: %u regions (%d chunks) had bad hashes, " printf("%s: %u regions (%d chunks) had bad hashes, "
"%qu bytes affected\n", "%llu bytes affected\n",
name, badhashes, badchunks, badhashdata); name, badhashes, badchunks, badhashdata);
dump_readbufs(); dump_readbufs();
#ifdef TIMEIT #ifdef TIMEIT
printf("%qu bytes: read cycles: %qu, hash cycles: %qu, cmp cycles: %qu\n", printf("%llu bytes: read cycles: %llu, hash cycles: %llu, cmp cycles: %llu\n",
ndatabytes, rcycles, hcycles, ccycles); ndatabytes, rcycles, hcycles, ccycles);
#endif #endif
return 0; return 0;
...@@ -635,11 +636,11 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff) ...@@ -635,11 +636,11 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff)
if (ip[off] == dp[off]) { if (ip[off] == dp[off]) {
if (boff != -1 && if (boff != -1 &&
off+1 < sz && ip[off+1] == dp[off+1]) { off+1 < sz && ip[off+1] == dp[off+1]) {
fprintf(stderr, " [%qu-%qu]: bad", fprintf(stderr, " [%llu-%llu]: bad",
byoff+boff, byoff+off-1); byoff+boff, byoff+off-1);
reloc = hasrelocs(byoff+boff, off-boff); reloc = hasrelocs(byoff+boff, off-boff);
if (reloc) if (reloc)
fprintf(stderr, " (overlaps reloc [%qu-%qu])", fprintf(stderr, " (overlaps reloc [%llu-%llu])",
sectobytes(reloc->sector)+reloc->sectoff, sectobytes(reloc->sector)+reloc->sectoff,
sectobytes(reloc->sector)+reloc->sectoff+reloc->size-1); sectobytes(reloc->sector)+reloc->sectoff+reloc->size-1);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
...@@ -659,10 +660,10 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff) ...@@ -659,10 +660,10 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff)
off++; off++;
} }
if (boff != -1) { if (boff != -1) {
fprintf(stderr, " [%qu-%qu] bad", byoff+boff, byoff+off-1); fprintf(stderr, " [%llu-%llu] bad", byoff+boff, byoff+off-1);
reloc = hasrelocs(byoff+boff, off-boff); reloc = hasrelocs(byoff+boff, off-boff);
if (reloc) if (reloc)
fprintf(stderr, " (overlaps reloc [%qu-%qu])", fprintf(stderr, " (overlaps reloc [%llu-%llu])",
sectobytes(reloc->sector)+reloc->sectoff, sectobytes(reloc->sector)+reloc->sectoff,
sectobytes(reloc->sector)+reloc->sectoff+reloc->size-1); sectobytes(reloc->sector)+reloc->sectoff+reloc->size-1);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
...@@ -677,7 +678,7 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff) ...@@ -677,7 +678,7 @@ fullcmp(void *p1, void *p2, off_t sz, uint32_t soff)
} }
static int static int
datacmp(uint32_t off, uint32_t size, char *idata) datacmp(uint32_t off, uint32_t size, unsigned char *idata)
{ {
readbuf_t *rbuf; readbuf_t *rbuf;
...@@ -760,7 +761,7 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop) ...@@ -760,7 +761,7 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop)
struct region *regp; struct region *regp;
z_stream z; z_stream z;
int err, nreg; int err, nreg;
char hash[HASH_MAXSIZE]; unsigned char hash[HASH_MAXSIZE];
unsigned char *(*hashfunc)(const unsigned char *, unsigned long, unsigned char *(*hashfunc)(const unsigned char *, unsigned long,
unsigned char *); unsigned char *);
readbuf_t *rbuf; readbuf_t *rbuf;
...@@ -787,8 +788,8 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop) ...@@ -787,8 +788,8 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop)
*/ */
blockhdr = (blockhdr_t *)chunkbufp; blockhdr = (blockhdr_t *)chunkbufp;
chunkbufp += DEFAULTREGIONSIZE; chunkbufp += DEFAULTREGIONSIZE;
nregions += blockhdr->regioncount; nregions += (uint32_t)blockhdr->regioncount;
z.next_in = chunkbufp; z.next_in = (Bytef *)chunkbufp;
z.avail_in = blockhdr->size; z.avail_in = blockhdr->size;
setrelocs(0, 0); setrelocs(0, 0);
...@@ -848,7 +849,7 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop) ...@@ -848,7 +849,7 @@ hashchunk(int chunkno, char *chunkbufp, struct hashinfo **hinfop)
else else
hsize = rsize; hsize = rsize;
z.next_out = rbuf->data; z.next_out = (Bytef *)rbuf->data;
z.avail_out = sectobytes(hsize); z.avail_out = sectobytes(hsize);
#ifdef TIMEIT #ifdef TIMEIT
sstamp = rdtsc(); sstamp = rdtsc();
......
...@@ -87,7 +87,9 @@ static struct timeval stamp; ...@@ -87,7 +87,9 @@ static struct timeval stamp;
#endif #endif
int readmbr(int slice); int readmbr(int slice);
int fixmbr(int slice, int dtype); int fixmbr(int slice, int dtype);
#ifdef FRISBEE
static int write_subblock(int, char *); static int write_subblock(int, char *);
#endif
static int inflate_subblock(char *); static int inflate_subblock(char *);
void writezeros(off_t offset, off_t zcount); void writezeros(off_t offset, off_t zcount);
void writedata(off_t offset, size_t count, void *buf); void writedata(off_t offset, size_t count, void *buf);
...@@ -191,7 +193,7 @@ dump_stats(int sig) ...@@ -191,7 +193,7 @@ dump_stats(int sig)
while (dotcol++ <= 60) while (dotcol++ <= 60)
fprintf(stderr, " "); fprintf(stderr, " ");
fprintf(stderr, "%4ld %13qd\n", estamp.tv_sec, totaledata); fprintf(stderr, "%4ld %13lld\n", estamp.tv_sec, totaledata);
} }
else { else {
if (sig) { if (sig) {
...@@ -204,7 +206,7 @@ dump_stats(int sig) ...@@ -204,7 +206,7 @@ dump_stats(int sig)
fprintf(stderr, "%d chunks decompressed\n", fprintf(stderr, "%d chunks decompressed\n",
donechunks); donechunks);
} }
fprintf(stderr, "Wrote %qd bytes (%qd actual) in %ld seconds\n", fprintf(stderr, "Wrote %lld bytes (%lld actual) in %ld seconds\n",
totaledata, totalrdata, estamp.tv_sec); totaledata, totalrdata, estamp.tv_sec);
} }
if (debug) if (debug)
...@@ -420,7 +422,7 @@ dowrite_request(writebuf_t *wbuf) ...@@ -420,7 +422,7 @@ dowrite_request(writebuf_t *wbuf)
#endif #endif
} }
static inline int devread(int fd, void *buf, size_t size) static __inline int devread(int fd, void *buf, size_t size)
{ {
assert((size & (SECSIZE-1)) == 0); assert((size & (SECSIZE-1)) == 0);
return read(fd, buf, size); return read(fd, buf, size);
...@@ -447,7 +449,7 @@ usage(void) ...@@ -447,7 +449,7 @@ usage(void)
} }
int int
main(int argc, char **argv) main(int argc, char *argv[])
{ {
int i, ch; int i, ch;
extern char build_info[]; extern char build_info[];
...@@ -926,6 +928,7 @@ DiskWriter(void *arg) ...@@ -926,6 +928,7 @@ DiskWriter(void *arg)
} }
#endif #endif
#ifdef FRISBEE
/* /*
* Just write the raw, compressed chunk data to disk * Just write the raw, compressed chunk data to disk
*/ */
...@@ -948,6 +951,7 @@ write_subblock(int chunkno, char *chunkbufp) ...@@ -948,6 +951,7 @@ write_subblock(int chunkno, char *chunkbufp)
} }
return 0; return 0;
} }
#endif
static int static int
inflate_subblock(char *chunkbufp) inflate_subblock(char *chunkbufp)
...@@ -1034,7 +1038,7 @@ inflate_subblock(char *chunkbufp) ...@@ -1034,7 +1038,7 @@ inflate_subblock(char *chunkbufp)
blockhdr->regioncount--; blockhdr->regioncount--;
if (debug == 1) if (debug == 1)
fprintf(stderr, "Decompressing: %14qd --> ", offset); fprintf(stderr, "Decompressing: %14lld --> ", offset);
wbuf = NULL; wbuf = NULL;
while (1) { while (1) {
...@@ -1043,7 +1047,7 @@ inflate_subblock(char *chunkbufp) ...@@ -1043,7 +1047,7 @@ inflate_subblock(char *chunkbufp)
*/ */
count = blockhdr->size; count = blockhdr->size;
blockhdr->size = 0; blockhdr->size = 0;
d_stream.next_in = chunkbufp; d_stream.next_in = (Bytef *)chunkbufp;
d_stream.avail_in = count; d_stream.avail_in = count;
chunkbufp += count; chunkbufp += count;
chunkbytes -= count; chunkbytes -= count;
...@@ -1062,10 +1066,18 @@ inflate_subblock(char *chunkbufp) ...@@ -1062,10 +1066,18 @@ inflate_subblock(char *chunkbufp)
/* /*
* Adjust the decompression params to account for the resid * Adjust the decompression params to account for the resid
*/ */
d_stream.next_out = &wbuf->data[ibleft]; d_stream.next_out = (Bytef *)&wbuf->data[ibleft];
d_stream.avail_out = OUTSIZE - ibleft; d_stream.avail_out = OUTSIZE - ibleft;
#ifdef FRISBEE #if !defined(NOTHREADS) && defined(FRISBEE)
/*
* XXX this may be a FreeBSD/linuxthreads specific thing
* but it seems that the decompression thread can run way
* longer than a timeslice causing incoming packets to
* get dropped before the network thread can be rescheduled.
* So force the decompressor to take a break once in awhile.
*/
if (!nothreads)
sched_yield(); sched_yield();
#endif #endif
/* /*
...@@ -1121,7 +1133,7 @@ inflate_subblock(char *chunkbufp) ...@@ -1121,7 +1133,7 @@ inflate_subblock(char *chunkbufp)
if (debug == 2) { if (debug == 2) {
fprintf(stderr, fprintf(stderr,
"%12qd %8d %8d %12qd %10qd %8d %5d %8d" "%12lld %8d %8d %12lld %10lld %8d %5d %8d"
"\n", "\n",
offset, cc, count, totaledata, size, offset, cc, count, totaledata, size,
ibsize, ibleft, d_stream.avail_in); ibsize, ibleft, d_stream.avail_in);
...@@ -1213,7 +1225,7 @@ inflate_subblock(char *chunkbufp) ...@@ -1213,7 +1225,7 @@ inflate_subblock(char *chunkbufp)
} }
if (debug == 1) { if (debug == 1) {
fprintf(stderr, "%14qd\n", offset); fprintf(stderr, "%14lld\n", offset);
} }
#ifndef FRISBEE #ifndef FRISBEE
else if (dots) { else if (dots) {
...@@ -1223,7 +1235,7 @@ inflate_subblock(char *chunkbufp) ...@@ -1223,7 +1235,7 @@ inflate_subblock(char *chunkbufp)
gettimeofday(&estamp, 0); gettimeofday(&estamp, 0);
estamp.tv_sec -= stamp.tv_sec; estamp.tv_sec -= stamp.tv_sec;
fprintf(stderr, "%4ld %13qd\n", fprintf(stderr, "%4ld %13lld\n",
estamp.tv_sec, totaledata); estamp.tv_sec, totaledata);
dotcol = 0; dotcol = 0;
...@@ -1257,7 +1269,7 @@ writezeros(off_t offset, off_t zcount) ...@@ -1257,7 +1269,7 @@ writezeros(off_t offset, off_t zcount)
} }
nextwriteoffset = offset; nextwriteoffset = offset;
} else if (offset != nextwriteoffset) { } else if (offset != nextwriteoffset) {
fprintf(stderr, "Non-contiguous write @ %qu (should be %qu)\n", fprintf(stderr, "Non-contiguous write @ %llu (should be %llu)\n",
offset, nextwriteoffset); offset, nextwriteoffset);
exit(1); exit(1);
} }
...@@ -1270,7 +1282,7 @@ writezeros(off_t offset, off_t zcount) ...@@ -1270,7 +1282,7 @@ writezeros(off_t offset, off_t zcount)
#ifndef FRISBEE #ifndef FRISBEE
if (docrconly) if (docrconly)
compute_crc(zeros, zcc, &crc); compute_crc((u_char *)zeros, zcc, &crc);
else else
#endif #endif
if ((zcc = write(outfd, zeros, zcc)) != zcc) { if ((zcc = write(outfd, zeros, zcc)) != zcc) {
...@@ -1294,7 +1306,7 @@ writedata(off_t offset, size_t size, void *buf) ...@@ -1294,7 +1306,7 @@ writedata(off_t offset, size_t size, void *buf)
#ifndef FRISBEE #ifndef FRISBEE
if (docrconly) { if (docrconly) {
compute_crc(buf, size, &crc); compute_crc((u_char *)buf, size, &crc);
cc = size; cc = size;
} else } else
#endif #endif
...@@ -1303,7 +1315,7 @@ writedata(off_t offset, size_t size, void *buf) ...@@ -1303,7 +1315,7 @@ writedata(off_t offset, size_t size, void *buf)
} else if (offset == nextwriteoffset) { } else if (offset == nextwriteoffset) {
cc = write(outfd, buf, size); cc = write(outfd, buf, size);
} else { } else {
fprintf(stderr, "Non-contiguous write @ %qu (should be %qu)\n", fprintf(stderr, "Non-contiguous write @ %llu (should be %llu)\n",
offset, nextwriteoffset); offset, nextwriteoffset);
exit(1); exit(1);
} }
...@@ -1357,7 +1369,7 @@ readmbr(int slice) ...@@ -1357,7 +1369,7 @@ readmbr(int slice)
outputmaxsize = (long long)sectobytes(outputmaxsec - outputminsec); outputmaxsize = (long long)sectobytes(outputmaxsec - outputminsec);
if (debug) { if (debug) {
fprintf(stderr, "Slice Mode: S:%d min:%ld max:%ld size:%qd\n",