Fix compilation warnings due to bigger ino_t/off_t
Change-Id: Ic489c2dae9a2a0a651908a6f9c43b1e311454807
This commit is contained in:
parent
3ff8349d7d
commit
ba556d1b6c
|
|
@ -100,12 +100,12 @@ int fd1, fd2;
|
||||||
if (c1 != c2) {
|
if (c1 != c2) {
|
||||||
if (!loud) {
|
if (!loud) {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
printf("%s %s differ: char %d, line %d\n",
|
printf("%s %s differ: char %lld, line %lld\n",
|
||||||
name1, name2, pos + i1, line);
|
name1, name2, pos + i1, line);
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
printf("%10d %3o %3o\n", pos + i1, c1 & 0xFF, c2 & 0xFF);
|
printf("%10lld %3o %3o\n", pos + i1, c1 & 0xFF, c2 & 0xFF);
|
||||||
differ = 1;
|
differ = 1;
|
||||||
}
|
}
|
||||||
if (c1 == '\n') line++;
|
if (c1 == '\n') line++;
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ void format_track(int ffd, unsigned type, unsigned cyl, unsigned head)
|
||||||
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
|
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
|
||||||
if (lseek(ffd, track_pos, SEEK_SET) == -1) {
|
if (lseek(ffd, track_pos, SEEK_SET) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"format: seeking to cyl %u, head %u (pos %d) failed: %s\n",
|
"format: seeking to cyl %u, head %u (pos %lld) failed: %s\n",
|
||||||
cyl, head, track_pos, strerror(errno));
|
cyl, head, track_pos, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -154,7 +154,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
|
||||||
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
|
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
|
||||||
if (lseek(vfd, track_pos, SEEK_SET) == -1) {
|
if (lseek(vfd, track_pos, SEEK_SET) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"format: seeking to cyl %u, head %u (pos %d) failed: %s\n",
|
"format: seeking to cyl %u, head %u (pos %lld) failed: %s\n",
|
||||||
cyl, head, track_pos, strerror(errno));
|
cyl, head, track_pos, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +167,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
|
||||||
for (sector= 0; sector < nr_sectors; sector++) {
|
for (sector= 0; sector < nr_sectors; sector++) {
|
||||||
if (lseek(vfd, track_pos, SEEK_SET) == -1) {
|
if (lseek(vfd, track_pos, SEEK_SET) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"format: seeking to cyl %u, head %u, sector %u (pos %d) failed: %s\n",
|
"format: seeking to cyl %u, head %u, sector %u (pos %lld) failed: %s\n",
|
||||||
cyl, head, sector, track_pos, strerror(errno));
|
cyl, head, sector, track_pos, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -183,7 +183,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
|
||||||
/* Fine. */
|
/* Fine. */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "format: short read at pos %d\n",
|
fprintf(stderr, "format: short read at pos %lld\n",
|
||||||
track_pos);
|
track_pos);
|
||||||
bad_count++;
|
bad_count++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -646,7 +646,7 @@ void chksuper()
|
||||||
if(maxsize <= 0)
|
if(maxsize <= 0)
|
||||||
maxsize = LONG_MAX;
|
maxsize = LONG_MAX;
|
||||||
if (sb.s_max_size != maxsize) {
|
if (sb.s_max_size != maxsize) {
|
||||||
printf("warning: expected max size to be %d ", maxsize);
|
printf("warning: expected max size to be %lld ", maxsize);
|
||||||
printf("instead of %d\n", sb.s_max_size);
|
printf("instead of %d\n", sb.s_max_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -682,7 +682,7 @@ char **clist;
|
||||||
ino = bit;
|
ino = bit;
|
||||||
do {
|
do {
|
||||||
devread(inoblock(ino), inooff(ino), (char *) ip, INODE_SIZE);
|
devread(inoblock(ino), inooff(ino), (char *) ip, INODE_SIZE);
|
||||||
printf("inode %u:\n", ino);
|
printf("inode %llu:\n", ino);
|
||||||
printf(" mode = %6o", ip->i_mode);
|
printf(" mode = %6o", ip->i_mode);
|
||||||
if (input(buf, 80)) ip->i_mode = atoo(buf);
|
if (input(buf, 80)) ip->i_mode = atoo(buf);
|
||||||
printf(" nlinks = %6u", ip->i_nlinks);
|
printf(" nlinks = %6u", ip->i_nlinks);
|
||||||
|
|
@ -854,7 +854,7 @@ void chkilist()
|
||||||
devread(inoblock(ino), inooff(ino), (char *) &mode,
|
devread(inoblock(ino), inooff(ino), (char *) &mode,
|
||||||
sizeof(mode));
|
sizeof(mode));
|
||||||
if (mode != I_NOT_ALLOC) {
|
if (mode != I_NOT_ALLOC) {
|
||||||
printf("mode inode %u not cleared", ino);
|
printf("mode inode %lld not cleared", ino);
|
||||||
if (yes(". clear")) devwrite(inoblock(ino),
|
if (yes(". clear")) devwrite(inoblock(ino),
|
||||||
inooff(ino), nullbuf, INODE_SIZE);
|
inooff(ino), nullbuf, INODE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
@ -880,7 +880,7 @@ void counterror(ino_t ino)
|
||||||
}
|
}
|
||||||
devread(inoblock(ino), inooff(ino), (char *) &inode, INODE_SIZE);
|
devread(inoblock(ino), inooff(ino), (char *) &inode, INODE_SIZE);
|
||||||
count[ino] += inode.i_nlinks; /* it was already subtracted; add it back */
|
count[ino] += inode.i_nlinks; /* it was already subtracted; add it back */
|
||||||
printf("%5u %5u %5u", ino, (unsigned) inode.i_nlinks, count[ino]);
|
printf("%5llu %5u %5u", ino, (unsigned) inode.i_nlinks, count[ino]);
|
||||||
if (yes(" adjust")) {
|
if (yes(" adjust")) {
|
||||||
if ((inode.i_nlinks = count[ino]) == 0) {
|
if ((inode.i_nlinks = count[ino]) == 0) {
|
||||||
fatal("internal error (counterror)");
|
fatal("internal error (counterror)");
|
||||||
|
|
@ -940,7 +940,7 @@ void list(ino_t ino, d_inode *ip)
|
||||||
firstlist = 0;
|
firstlist = 0;
|
||||||
printf(" inode permission link size name\n");
|
printf(" inode permission link size name\n");
|
||||||
}
|
}
|
||||||
printf("%6u ", ino);
|
printf("%6llu ", ino);
|
||||||
switch (ip->i_mode & I_TYPE) {
|
switch (ip->i_mode & I_TYPE) {
|
||||||
case I_REGULAR: putchar('-'); break;
|
case I_REGULAR: putchar('-'); break;
|
||||||
case I_DIRECTORY: putchar('d'); break;
|
case I_DIRECTORY: putchar('d'); break;
|
||||||
|
|
@ -1028,7 +1028,7 @@ int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp)
|
||||||
printf("bad %s in ", printable_name);
|
printf("bad %s in ", printable_name);
|
||||||
printpath(1, 0);
|
printpath(1, 0);
|
||||||
printf("%s is linked to %u ", printable_name, dp->d_inum);
|
printf("%s is linked to %u ", printable_name, dp->d_inum);
|
||||||
printf("instead of %u)", exp);
|
printf("instead of %llu)", exp);
|
||||||
setbit(spec_imap, (bit_nr) ino);
|
setbit(spec_imap, (bit_nr) ino);
|
||||||
setbit(spec_imap, (bit_nr) dp->d_inum);
|
setbit(spec_imap, (bit_nr) dp->d_inum);
|
||||||
setbit(spec_imap, (bit_nr) exp);
|
setbit(spec_imap, (bit_nr) exp);
|
||||||
|
|
@ -1040,7 +1040,7 @@ int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp)
|
||||||
}
|
}
|
||||||
} else if (pos != (dp->mfs_d_name[1] ? DIR_ENTRY_SIZE : 0)) {
|
} else if (pos != (dp->mfs_d_name[1] ? DIR_ENTRY_SIZE : 0)) {
|
||||||
make_printable_name(printable_name, dp->mfs_d_name, sizeof(dp->mfs_d_name));
|
make_printable_name(printable_name, dp->mfs_d_name, sizeof(dp->mfs_d_name));
|
||||||
printf("warning: %s has offset %d in ", printable_name, pos);
|
printf("warning: %s has offset %lld in ", printable_name, pos);
|
||||||
printpath(1, 0);
|
printpath(1, 0);
|
||||||
printf("%s is linked to %u)\n", printable_name, dp->d_inum);
|
printf("%s is linked to %u)\n", printable_name, dp->d_inum);
|
||||||
setbit(spec_imap, (bit_nr) ino);
|
setbit(spec_imap, (bit_nr) ino);
|
||||||
|
|
@ -1207,7 +1207,7 @@ off_t pos;
|
||||||
case 2: printf("DOUBLE INDIRECT"); break;
|
case 2: printf("DOUBLE INDIRECT"); break;
|
||||||
default: printf("VERY INDIRECT");
|
default: printf("VERY INDIRECT");
|
||||||
}
|
}
|
||||||
printf(", pos = %d)\n", pos);
|
printf(", pos = %lld)\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Found the given zone in the given inode. Check it, and if ok, mark it
|
/* Found the given zone in the given inode. Check it, and if ok, mark it
|
||||||
|
|
@ -1426,7 +1426,7 @@ int chkinode(ino_t ino, d_inode *ip)
|
||||||
{
|
{
|
||||||
if (ino == ROOT_INODE && (ip->i_mode & I_TYPE) != I_DIRECTORY) {
|
if (ino == ROOT_INODE && (ip->i_mode & I_TYPE) != I_DIRECTORY) {
|
||||||
printf("root inode is not a directory ");
|
printf("root inode is not a directory ");
|
||||||
printf("(ino = %u, mode = %o)\n", ino, ip->i_mode);
|
printf("(ino = %llu, mode = %o)\n", ino, ip->i_mode);
|
||||||
fatal("");
|
fatal("");
|
||||||
}
|
}
|
||||||
if (ip->i_nlinks == 0) {
|
if (ip->i_nlinks == 0) {
|
||||||
|
|
@ -1461,7 +1461,7 @@ dir_struct *dp;
|
||||||
stk.st_next = ftop;
|
stk.st_next = ftop;
|
||||||
ftop = &stk;
|
ftop = &stk;
|
||||||
if (bitset(spec_imap, (bit_nr) ino)) {
|
if (bitset(spec_imap, (bit_nr) ino)) {
|
||||||
printf("found inode %u: ", ino);
|
printf("found inode %llu: ", ino);
|
||||||
printpath(0, 1);
|
printpath(0, 1);
|
||||||
}
|
}
|
||||||
visited = bitset(imap, (bit_nr) ino);
|
visited = bitset(imap, (bit_nr) ino);
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ char restart[16];
|
||||||
} else
|
} else
|
||||||
filesize = lseek(fd, 0, SEEK_END);
|
filesize = lseek(fd, 0, SEEK_END);
|
||||||
|
|
||||||
sprintf(restart, "%u", filesize);
|
sprintf(restart, "%lld", filesize);
|
||||||
|
|
||||||
s = DOcommand("REST", restart);
|
s = DOcommand("REST", restart);
|
||||||
|
|
||||||
|
|
@ -510,7 +510,7 @@ unsigned short crc(char *fname);
|
||||||
if((s / 100) != 2)
|
if((s / 100) != 2)
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
sscanf(reply, "%*hu %*s%u%lu", &ccrc, &csize);
|
sscanf(reply, "%*hu %*s%hu%lu", &ccrc, &csize);
|
||||||
if(ss < 0) return(-1);
|
if(ss < 0) return(-1);
|
||||||
lcrc = crc(file);
|
lcrc = crc(file);
|
||||||
if(size != csize || size != st.st_size || ccrc != lcrc)
|
if(size != csize || size != st.st_size || ccrc != lcrc)
|
||||||
|
|
@ -728,7 +728,7 @@ char restart[16];
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(restart, "%u", rmtsize);
|
sprintf(restart, "%lld", rmtsize);
|
||||||
|
|
||||||
s = DOcommand("REST", restart);
|
s = DOcommand("REST", restart);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ int main(int argc, char **argv)
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
off_t kBpts;
|
off_t kBpts;
|
||||||
|
|
||||||
fprintf(stderr, "%d kB / %ld.%ld s = ",
|
fprintf(stderr, "%lld kB / %ld.%ld s = ",
|
||||||
(nbytes + 512) / 1024,
|
(nbytes + 512) / 1024,
|
||||||
tenthsec / 10, tenthsec % 10);
|
tenthsec / 10, tenthsec % 10);
|
||||||
if (tenthsec < 5)
|
if (tenthsec < 5)
|
||||||
|
|
@ -230,11 +230,11 @@ int main(int argc, char **argv)
|
||||||
seconds = (tenthsec + 5) / 10;
|
seconds = (tenthsec + 5) / 10;
|
||||||
kBpts= (nbytes + 512L * seconds)
|
kBpts= (nbytes + 512L * seconds)
|
||||||
/ (1024L * seconds);
|
/ (1024L * seconds);
|
||||||
fprintf(stderr, "%d kB/s\n", kBpts);
|
fprintf(stderr, "%lld kB/s\n", kBpts);
|
||||||
} else {
|
} else {
|
||||||
kBpts= (100 * nbytes + 512L * tenthsec)
|
kBpts= (100 * nbytes + 512L * tenthsec)
|
||||||
/ (1024L * tenthsec);
|
/ (1024L * tenthsec);
|
||||||
fprintf(stderr, "%d.%d kB/s\n",
|
fprintf(stderr, "%lld.%lld kB/s\n",
|
||||||
kBpts/10, kBpts%10);
|
kBpts/10, kBpts%10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -246,7 +246,7 @@ int main(int argc, char **argv)
|
||||||
tenthms= (tenthsec * 1000 + nseeks/2) / nseeks;
|
tenthms= (tenthsec * 1000 + nseeks/2) / nseeks;
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%d seeks / %ld.%ld s = %ld seeks/s = %d.%d ms/seek\n",
|
"%lld seeks / %ld.%ld s = %lld seeks/s = %lld.%lld ms/seek\n",
|
||||||
nseeks, tenthsec / 10, tenthsec % 10,
|
nseeks, tenthsec / 10, tenthsec % 10,
|
||||||
(nseeks * 10 + tenthsec/2) / tenthsec,
|
(nseeks * 10 + tenthsec/2) / tenthsec,
|
||||||
tenthms / 10, tenthms % 10);
|
tenthms / 10, tenthms % 10);
|
||||||
|
|
@ -263,7 +263,7 @@ int main(int argc, char **argv)
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, ", ");
|
fprintf(stderr, ", ");
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%d.%d ms (%d rpm)",
|
fprintf(stderr, "%lld.%lld ms (%d rpm)",
|
||||||
(tenthms - rotms) / 10, (tenthms - rotms) % 10,
|
(tenthms - rotms) / 10, (tenthms - rotms) % 10,
|
||||||
rpm);
|
rpm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -851,7 +851,7 @@ writebootimage(char *bootimage, int bootfd, int fd, int *currentsector,
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, " * appended sector info: 0x%x len 0x%x\n",
|
fprintf(stderr, " * appended sector info: 0x%llx len 0x%x\n",
|
||||||
bap[0].sector, bap[0].length);
|
bap[0].sector, bap[0].length);
|
||||||
|
|
||||||
addr = buf;
|
addr = buf;
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ int swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* resumecontext *
|
* resumecontext *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
void resumecontext(ucontext_t *ucp)
|
__dead void resumecontext(ucontext_t *ucp)
|
||||||
{
|
{
|
||||||
if (ucp->uc_link == NULL) exit(0);
|
if (ucp->uc_link == NULL) exit(0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ void mthread_panic_f(const char *file, int line, const char *msg)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void mthread_panic_s(void)
|
__dead void mthread_panic_s(void)
|
||||||
{
|
{
|
||||||
/* Silent panic */
|
/* Silent panic */
|
||||||
volatile int *sf;
|
volatile int *sf;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ int do_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
register struct mproc *rmp = mp;
|
register struct mproc *rmp = mp;
|
||||||
int r, i;
|
int r;
|
||||||
int ngroups;
|
int ngroups;
|
||||||
|
|
||||||
switch(call_nr) {
|
switch(call_nr) {
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,8 @@ size_t seg_bytes /* how much is to be transferred? */
|
||||||
if (off+seg_bytes > execi->hdr_len) return ENOEXEC;
|
if (off+seg_bytes > execi->hdr_len) return ENOEXEC;
|
||||||
if((r= sys_vircopy(SELF, ((vir_bytes)execi->hdr)+off,
|
if((r= sys_vircopy(SELF, ((vir_bytes)execi->hdr)+off,
|
||||||
execi->proc_e, seg_addr, seg_bytes)) != OK) {
|
execi->proc_e, seg_addr, seg_bytes)) != OK) {
|
||||||
printf("RS: exec read_seg: copy 0x%x bytes into %i at 0x%08x failed: %i\n",
|
printf( "RS: exec read_seg: copy 0x%x bytes into %i at "
|
||||||
|
"0x%08llx failed: %i\n",
|
||||||
seg_bytes, execi->proc_e, seg_addr, r);
|
seg_bytes, execi->proc_e, seg_addr, r);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ __RCSID("$NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $");
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifndef PRIdOFF
|
#ifndef PRIdOFF
|
||||||
#define PRIdOFF PRId32
|
#define PRIdOFF PRId64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* what type of file are we dealing with */
|
/* what type of file are we dealing with */
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ numhex(u_char *pos, const u_char *bufend, u_char *line, u_char *lineend,
|
||||||
int64_t n = 0;
|
int64_t n = 0;
|
||||||
int l;
|
int l;
|
||||||
SKIP_BLANKS(line);
|
SKIP_BLANKS(line);
|
||||||
sscanf((const char *) pos, "%lx", &n);
|
sscanf((const char *) pos, "%llx", &n);
|
||||||
l = snprintf((char *)buf, sizeof(buf), "%lld", n);
|
l = snprintf((char *)buf, sizeof(buf), "%lld", n);
|
||||||
return number(pos, bufend, buf, buf + l, flag);
|
return number(pos, bufend, buf, buf + l, flag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -840,7 +840,7 @@ void enter_dir(ino_t parent, char const *name, ino_t child)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Directory-inode %u beyond direct blocks. Could not enter %s\n",
|
printf("Directory-inode %llu beyond direct blocks. Could not enter %s\n",
|
||||||
parent, name);
|
parent, name);
|
||||||
pexit("Halt");
|
pexit("Halt");
|
||||||
}
|
}
|
||||||
|
|
@ -1338,7 +1338,7 @@ void print_fs()
|
||||||
if (k > nrinodes) break;
|
if (k > nrinodes) break;
|
||||||
{
|
{
|
||||||
if (inode2[i].d2_mode != 0) {
|
if (inode2[i].d2_mode != 0) {
|
||||||
printf("Inode %2u: mode=", k);
|
printf("Inode %2llu: mode=", k);
|
||||||
printf("%06o", inode2[i].d2_mode);
|
printf("%06o", inode2[i].d2_mode);
|
||||||
printf(" uid=%2d gid=%2d size=",
|
printf(" uid=%2d gid=%2d size=",
|
||||||
inode2[i].d2_uid, inode2[i].d2_gid);
|
inode2[i].d2_uid, inode2[i].d2_gid);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user