]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: fix some printf() warnings that show up for ia64
authorAlex Elder <aelder@sgi.com>
Tue, 20 Sep 2011 19:29:24 +0000 (19:29 +0000)
committerAlex Elder <aelder@sgi.com>
Wed, 21 Sep 2011 18:50:33 +0000 (13:50 -0500)
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 <aelder@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
io/parent.c
logprint/log_misc.c
logprint/log_print_all.c

index 3e93c2254992879f4877c221cd23f8d84878b34b..5d356e6ec34a9d5e6d250b6a8fbf4d94ffefdb06 100644 (file)
@@ -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)
index f5fdad800651fff9d619095fd125d8d9d49b71d8..e42e10876079f8bccb770e30a34ae436cfbb509c 100644 (file)
@@ -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]);
index 62727bff5df0a58127e8ad7838abf2ac996216c4..69d6e719cb04458c0799957a440b4311daa6c3f7 100644 (file)
@@ -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)));