diff options
author | johan <johan@FreeBSD.org> | 2003-11-13 19:08:43 +0000 |
---|---|---|
committer | johan <johan@FreeBSD.org> | 2003-11-13 19:08:43 +0000 |
commit | 29bff59c2a30b215a2bf82ee72892161a0ff9568 (patch) | |
tree | 4a0bcc3a40c7c20b55b89483548e94804097afce /sbin/fsdb/fsdbutil.c | |
parent | c7b89dee16e3501086df566dbe06304ab00d931d (diff) | |
download | FreeBSD-src-29bff59c2a30b215a2bf82ee72892161a0ff9568.zip FreeBSD-src-29bff59c2a30b215a2bf82ee72892161a0ff9568.tar.gz |
Make this WARNS=2 clean by
- #include <timeconv.h> for _time_to_time32 et al
- use (uintmax_t) and %j
- remove unused variable 'j' (from PR 39866)
PR: 39866
Submitted by: Dan Lukes <dan@obluda.cz>
Tested by: make universe
Diffstat (limited to 'sbin/fsdb/fsdbutil.c')
-rw-r--r-- | sbin/fsdb/fsdbutil.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index b0d4c12..b000619 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -38,8 +38,10 @@ static const char rcsid[] = #include <err.h> #include <grp.h> #include <pwd.h> +#include <stdint.h> #include <string.h> #include <time.h> +#include <timeconv.h> #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> @@ -152,8 +154,8 @@ printstat(const char *cp, ino_t inum, union dinode *dp) puts("fifo"); break; } - printf("I=%lu MODE=%o SIZE=%qu", (u_long)inum, DIP(dp, di_mode), - DIP(dp, di_size)); + printf("I=%lu MODE=%o SIZE=%ju", (u_long)inum, DIP(dp, di_mode), + (uintmax_t)DIP(dp, di_size)); if (sblock.fs_magic == FS_UFS1_MAGIC) t = _time32_to_time(dp->dp1.di_mtime); else @@ -187,8 +189,8 @@ printstat(const char *cp, ino_t inum, union dinode *dp) blocks = DIP(dp, di_blocks); gen = DIP(dp, di_gen); - printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%qx GEN=%qx\n", DIP(dp, di_nlink), - DIP(dp, di_flags), blocks, gen); + printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), + DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen); } @@ -248,7 +250,7 @@ printindir(ufs2_daddr_t blk, int level, char *bufp) putchar('\n'); return 0; } - j = sprintf(tempbuf, "%qd", blkno); + j = sprintf(tempbuf, "%jd", (intmax_t)blkno); if (level == 0) { charssofar += j; if (charssofar >= cpl - 2) { @@ -279,7 +281,7 @@ static void printblocks(ino_t inum, union dinode *dp) { char *bufp; - int i, j, nfrags; + int i, nfrags; long ndb, offset; ufs2_daddr_t blkno; @@ -294,7 +296,7 @@ printblocks(ino_t inum, union dinode *dp) if (i > 0) printf(", "); blkno = DIP(dp, di_db[i]); - printf("%qd", blkno); + printf("%jd", (intmax_t)blkno); if (--ndb == 0 && (offset = blkoff(&sblock, DIP(dp, di_size))) != 0) { nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); printf(" (%d frag%s)", nfrags, nfrags > 1? "s": ""); |