diff options
author | bde <bde@FreeBSD.org> | 1998-06-28 20:11:23 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-06-28 20:11:23 +0000 |
commit | fa160a825f17be981fcf9ed627e0809166cc5fdd (patch) | |
tree | 84b0a5d7252a1c4c472039e1a49d656c24094054 | |
parent | 2c93388fd02a00e74a870baaf9c0c3a67027caa4 (diff) | |
download | FreeBSD-src-fa160a825f17be981fcf9ed627e0809166cc5fdd.zip FreeBSD-src-fa160a825f17be981fcf9ed627e0809166cc5fdd.tar.gz |
Fixed printf format errors.
-rw-r--r-- | sbin/newfs/mkfs.c | 34 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 2 | ||||
-rw-r--r-- | sbin/quotacheck/quotacheck.c | 14 |
3 files changed, 27 insertions, 23 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index b21c458..e5340a8 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -400,12 +400,12 @@ mkfs(pp, fsys, fi, fo) / MAXIPG(&sblock) + 1)); } else if (!mapcramped) { printf("With %d bytes per inode, ", density); - printf("minimum cylinders per group is %d\n", mincpg); + printf("minimum cylinders per group is %ld\n", mincpg); } } if (mapcramped) { printf("With %d sectors per cylinder, ", sblock.fs_spc); - printf("minimum cylinders per group is %d\n", mincpg); + printf("minimum cylinders per group is %ld\n", mincpg); } if (inodecramped || mapcramped) { if (sblock.fs_bsize != bsize) @@ -423,7 +423,7 @@ mkfs(pp, fsys, fi, fo) */ sblock.fs_cpg = cpg; if (sblock.fs_cpg % mincpc != 0) { - printf("%s groups must have a multiple of %d cylinders\n", + printf("%s groups must have a multiple of %ld cylinders\n", cpgflg ? "Cylinder" : "Warning: cylinder", mincpc); sblock.fs_cpg = roundup(sblock.fs_cpg, mincpc); if (!cpgflg) @@ -448,11 +448,11 @@ mkfs(pp, fsys, fi, fo) } sblock.fs_fpg = (sblock.fs_cpg * sblock.fs_spc) / NSPF(&sblock); if ((sblock.fs_cpg * sblock.fs_spc) % NSPB(&sblock) != 0) { - printf("panic (fs_cpg * fs_spc) % NSPF != 0"); + printf("panic (fs_cpg * fs_spc) %% NSPF != 0"); exit(24); } if (sblock.fs_cpg < mincpg) { - printf("cylinder groups must have at least %d cylinders\n", + printf("cylinder groups must have at least %ld cylinders\n", mincpg); exit(25); } else if (sblock.fs_cpg != cpg) { @@ -564,9 +564,9 @@ next: sblock.fs_dblkno = sblock.fs_iblkno + sblock.fs_ipg / INOPF(&sblock); i = MIN(~sblock.fs_cgmask, sblock.fs_ncg - 1); if (cgdmin(&sblock, i) - cgbase(&sblock, i) >= sblock.fs_fpg) { - printf("inode blocks/cyl group (%d) >= data blocks (%d)\n", + printf("inode blocks/cyl group (%ld) >= data blocks (%ld)\n", cgdmin(&sblock, i) - cgbase(&sblock, i) / sblock.fs_frag, - sblock.fs_fpg / sblock.fs_frag); + (long)(sblock.fs_fpg / sblock.fs_frag)); printf("number of cylinders per cylinder group (%d) %s.\n", sblock.fs_cpg, "must be increased"); exit(29); @@ -580,10 +580,12 @@ next: (cgdmin(&sblock, 0) + 3 * sblock.fs_frag)); exit(30); } - printf("Warning: inode blocks/cyl group (%d) >= data blocks (%d) in last\n", + printf( +"Warning: inode blocks/cyl group (%ld) >= data blocks (%ld) in last\n", (cgdmin(&sblock, j) - cgbase(&sblock, j)) / sblock.fs_frag, i / sblock.fs_frag); - printf(" cylinder group. This implies %d sector(s) cannot be allocated.\n", + printf( +" cylinder group. This implies %ld sector(s) cannot be allocated.\n", i * NSPF(&sblock)); sblock.fs_ncg--; sblock.fs_ncyl -= sblock.fs_ncyl % sblock.fs_cpg; @@ -659,9 +661,9 @@ next: initcg(cylno, utime); if (mfs) continue; - j = sprintf(tmpbuf, " %d,", - fsbtodb(&sblock, cgsblock(&sblock, cylno))); - if (i+j >= width) { + j = sprintf(tmpbuf, " %ld,", + fsbtodb(&sblock, cgsblock(&sblock, cylno))); + if (i + j >= width) { printf("\n"); i = 0; } @@ -1254,13 +1256,13 @@ rdfs(bno, size, bf) return; } if (lseek(fsi, (off_t)bno * sectorsize, 0) < 0) { - printf("seek error: %ld\n", bno); + printf("seek error: %ld\n", (long)bno); perror("rdfs"); exit(33); } n = read(fsi, bf, size); if (n != size) { - printf("read error: %ld\n", bno); + printf("read error: %ld\n", (long)bno); perror("rdfs"); exit(34); } @@ -1283,13 +1285,13 @@ wtfs(bno, size, bf) if (Nflag) return; if (lseek(fso, (off_t)bno * sectorsize, SEEK_SET) < 0) { - printf("seek error: %ld\n", bno); + printf("seek error: %ld\n", (long)bno); perror("wtfs"); exit(35); } n = write(fso, bf, size); if (n != size) { - printf("write error: %ld\n", bno); + printf("write error: %ld\n", (long)bno); perror("wtfs"); exit(36); } diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 2265c2b..d0cc159 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -541,7 +541,7 @@ havelabel: if (t_or_u_flag && secpercyl != lp->d_secpercyl) fprintf(stderr, "%s (%d) %s (%lu)\n", "Warning: calculated sectors per cylinder", secpercyl, - "disagrees with disk label", lp->d_secpercyl); + "disagrees with disk label", (u_long)lp->d_secpercyl); if (maxbpg == 0) maxbpg = MAXBLKPG(bsize); headswitch = lp->d_headswitch; diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c index 1bee83d..d9ae421 100644 --- a/sbin/quotacheck/quotacheck.c +++ b/sbin/quotacheck/quotacheck.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: quotacheck.c,v 1.7 1997/06/16 06:38:14 charnier Exp $ + * $Id: quotacheck.c,v 1.8 1997/06/30 11:08:29 charnier Exp $ */ #ifndef lint @@ -361,11 +361,13 @@ update(fsname, quotafile, type) printf("%s: ", fsname); printf("%-8s fixed:", fup->fu_name); if (dqbuf.dqb_curinodes != fup->fu_curinodes) - (void)printf("\tinodes %ld -> %ld", - dqbuf.dqb_curinodes, fup->fu_curinodes); + (void)printf("\tinodes %lu -> %lu", + (u_long)dqbuf.dqb_curinodes, + (u_long)fup->fu_curinodes); if (dqbuf.dqb_curblocks != fup->fu_curblocks) - (void)printf("\tblocks %ld -> %ld", - dqbuf.dqb_curblocks, fup->fu_curblocks); + (void)printf("\tblocks %lu -> %lu", + (u_long)dqbuf.dqb_curblocks, + (u_long)fup->fu_curblocks); (void)printf("\n"); } /* @@ -613,5 +615,5 @@ bread(bno, buf, cnt) if (lseek(fi, (off_t)bno * dev_bsize, SEEK_SET) < 0 || read(fi, buf, cnt) != cnt) - errx(1, "block %ld", bno); + errx(1, "block %ld", (long)bno); } |