From: Alex Elder Date: Tue, 20 Sep 2011 19:29:24 +0000 (+0000) Subject: xfsprogs: fix some printf() warnings that show up for ia64 X-Git-Tag: v3.1.6~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f934f4a52f3e218f7bf8a6d90837aed6960c7102;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: fix some printf() warnings that show up for ia64 Get rid of remaining build warnings in xfsprogs. This builds cleanly on ia64 and x86_64, and builds without any printf() format-related warnings on i386. [Moved a few warning fixes from this to the previous patch. -Alex] Signed-off-by: Alex Elder Signed-off-by: Christoph Hellwig --- diff --git a/io/parent.c b/io/parent.c index 3e93c2254..5d356e6ec 100644 --- a/io/parent.c +++ b/io/parent.c @@ -52,12 +52,12 @@ check_parent_entry(xfs_bstat_t *bstatp, parent_t *parent) if (sts != 0) { fprintf(stderr, _("inode-path for inode: %llu is incorrect - path \"%s\" non-existent\n"), - bstatp->bs_ino, fullpath); + (unsigned long long) bstatp->bs_ino, fullpath); if (verbose_flag) { fprintf(stderr, _("path \"%s\" does not stat for inode: %llu; err = %s\n"), fullpath, - bstatp->bs_ino, + (unsigned long long) bstatp->bs_ino, strerror(errno)); } err_status++; @@ -71,7 +71,7 @@ check_parent_entry(xfs_bstat_t *bstatp, parent_t *parent) if (statbuf.st_ino != bstatp->bs_ino) { fprintf(stderr, _("inode-path for inode: %llu is incorrect - wrong inode#\n"), - bstatp->bs_ino); + (unsigned long long) bstatp->bs_ino); if (verbose_flag) { fprintf(stderr, _("ino mismatch for path \"%s\" %llu vs %llu\n"), @@ -101,7 +101,7 @@ check_parent_entry(xfs_bstat_t *bstatp, parent_t *parent) if (parent->p_ino != statbuf.st_ino) { fprintf(stderr, _("inode-path for inode: %llu is incorrect - wrong parent inode#\n"), - bstatp->bs_ino); + (unsigned long long) bstatp->bs_ino); if (verbose_flag) { fprintf(stderr, _("ino mismatch for path \"%s\" %llu vs %llu\n"), @@ -113,7 +113,8 @@ check_parent_entry(xfs_bstat_t *bstatp, parent_t *parent) return; } else { if (verbose_flag > 1) { - printf(_("parent ino match for %llu\n"), parent->p_ino); + printf(_("parent ino match for %llu\n"), + (unsigned long long) parent->p_ino); } } } @@ -135,7 +136,7 @@ check_parents(parent_t *parentbuf, size_t *parentbuf_size, parentbuf = (parent_t *)realloc(parentbuf, *parentbuf_size); } else if (error) { fprintf(stderr, _("parentpaths failed for ino %llu: %s\n"), - statp->bs_ino, + (unsigned long long) statp->bs_ino, strerror(errno)); err_status++; break; @@ -145,7 +146,8 @@ check_parents(parent_t *parentbuf, size_t *parentbuf_size, if (count == 0) { /* no links for inode - something wrong here */ - fprintf(stderr, _("inode-path for inode: %llu is missing\n"), statp->bs_ino); + fprintf(stderr, _("inode-path for inode: %llu is missing\n"), + (unsigned long long) statp->bs_ino); err_status++; } @@ -190,13 +192,13 @@ do_bulkstat(parent_t *parentbuf, size_t *parentbuf_size, xfs_bstat_t *bstatbuf, if (xfsctl(mntpt, fsfd, XFS_IOC_FSBULKSTAT_SINGLE, &bulkreq) < 0) { fprintf(stderr, _("failed to get bulkstat information for inode %llu\n"), - p->bs_ino ); + (unsigned long long) p->bs_ino); continue; } if (!p->bs_nlink || !p->bs_mode || !p->bs_ino) { fprintf(stderr, _("failed to get valid bulkstat information for inode %llu\n"), - p->bs_ino ); + (unsigned long long) p->bs_ino); continue; } } @@ -207,7 +209,8 @@ do_bulkstat(parent_t *parentbuf, size_t *parentbuf_size, xfs_bstat_t *bstatbuf, } if (verbose_flag > 1) { - printf(_("checking inode %llu\n"), p->bs_ino); + printf(_("checking inode %llu\n"), + (unsigned long long) p->bs_ino); } /* print dotted progress */ @@ -264,7 +267,8 @@ parent_check(void) if (err_status > 0) fprintf(stderr, _("num errors: %d\n"), err_status); else - printf(_("succeeded checking %llu inodes\n"), inodes_checked); + printf(_("succeeded checking %llu inodes\n"), + (unsigned long long) inodes_checked); free(bstatbuf); free(parentbuf); @@ -274,7 +278,7 @@ parent_check(void) static void print_parent_entry(parent_t *parent, int fullpath) { - printf(_("p_ino = %llu\n"), parent->p_ino); + printf(_("p_ino = %llu\n"), (unsigned long long) parent->p_ino); printf(_("p_gen = %u\n"), parent->p_gen); printf(_("p_reclen = %u\n"), parent->p_reclen); if (fullpath) diff --git a/logprint/log_misc.c b/logprint/log_misc.c index f5fdad800..e42e10876 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -307,12 +307,14 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops) */ memmove(&x, *ptr, sizeof(__be64)); memmove(&y, *ptr+8, sizeof(__be64)); - printf(_("icount: %lld ifree: %lld "), - be64_to_cpu(x), be64_to_cpu(y)); + printf(_("icount: %llu ifree: %llu "), + (unsigned long long) be64_to_cpu(x), + (unsigned long long) be64_to_cpu(y)); memmove(&x, *ptr+16, sizeof(__be64)); memmove(&y, *ptr+24, sizeof(__be64)); - printf(_("fdblks: %lld frext: %lld\n"), - be64_to_cpu(x), be64_to_cpu(y)); + printf(_("fdblks: %llu frext: %llu\n"), + (unsigned long long) be64_to_cpu(x), + (unsigned long long) be64_to_cpu(y)); } super_block = 0; } else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_AGI_MAGIC) { @@ -395,18 +397,22 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops) dq->d_version, dq->d_flags, be32_to_cpu(dq->d_id)); printf(_("blk limits hard: %llu soft: %llu\n"), - be64_to_cpu(dq->d_blk_hardlimit), - be64_to_cpu(dq->d_blk_softlimit)); + (unsigned long long) + be64_to_cpu(dq->d_blk_hardlimit), + (unsigned long long) + be64_to_cpu(dq->d_blk_softlimit)); printf(_("blk count: %llu warns: %d timer: %d\n"), - be64_to_cpu(dq->d_bcount), - be16_to_cpu(dq->d_bwarns), + (unsigned long long) be64_to_cpu(dq->d_bcount), + (int) be16_to_cpu(dq->d_bwarns), be32_to_cpu(dq->d_btimer)); printf(_("ino limits hard: %llu soft: %llu\n"), - be64_to_cpu(dq->d_ino_hardlimit), - be64_to_cpu(dq->d_ino_softlimit)); + (unsigned long long) + be64_to_cpu(dq->d_ino_hardlimit), + (unsigned long long) + be64_to_cpu(dq->d_ino_softlimit)); printf(_("ino count: %llu warns: %d timer: %d\n"), - be64_to_cpu(dq->d_icount), - be16_to_cpu(dq->d_iwarns), + (unsigned long long) be64_to_cpu(dq->d_icount), + (int) be16_to_cpu(dq->d_iwarns), be32_to_cpu(dq->d_itimer)); } } else { @@ -574,7 +580,7 @@ xlog_print_dir_sf(xfs_dir_shortform_t *sfp, int size) printf(_("SHORTFORM DIRECTORY size %d count %d\n"), size, sfp->hdr.count); memmove(&ino, &(sfp->hdr.parent), sizeof(ino)); - printf(_(".. ino 0x%llx\n"), be64_to_cpu(*(__be64 *)&ino)); + printf(_(".. ino 0x%llx\n"), (unsigned long long) be64_to_cpu(ino)); count = (uint)(sfp->hdr.count); sfep = &(sfp->list[0]); diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index 62727bff5..69d6e719c 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -108,12 +108,16 @@ xlog_recover_print_buffer( printf(_(" SUPER Block Buffer:\n")); if (!print_buffer) continue; - printf(_(" icount:%Ld ifree:%Ld "), - be64_to_cpu(*(__be64 *)(p)), - be64_to_cpu(*(__be64 *)(p+8))); - printf(_("fdblks:%Ld frext:%Ld\n"), - be64_to_cpu(*(__be64 *)(p+16)), - be64_to_cpu(*(__be64 *)(p+24))); + printf(_(" icount:%llu ifree:%llu "), + (unsigned long long) + be64_to_cpu(*(__be64 *)(p)), + (unsigned long long) + be64_to_cpu(*(__be64 *)(p+8))); + printf(_("fdblks:%llu frext:%llu\n"), + (unsigned long long) + be64_to_cpu(*(__be64 *)(p+16)), + (unsigned long long) + be64_to_cpu(*(__be64 *)(p+24))); printf(_(" sunit:%u swidth:%u\n"), be32_to_cpu(*(__be32 *)(p+56)), be32_to_cpu(*(__be32 *)(p+60)));