]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fix various formats
authorRosen Penev <rosenp@gmail.com>
Tue, 3 May 2022 00:43:32 +0000 (17:43 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 10 May 2022 20:36:58 +0000 (13:36 -0700)
Found with -Wformat.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
disk-utils/sfdisk.c
lib/fileeq.c
libblkid/src/probe.c
misc-utils/hardlink.c
term-utils/script.c

index d46cdd2449704d42ad2643d820a4d493ff1559b6..38c7b17986d159410ada2142aa04c6d591ac74a8 100644 (file)
@@ -515,7 +515,7 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa
                        (uintmax_t)to, (uintmax_t)to * ss);
                fprintf(f, "# Area size (sectors/bytes): %ju/%ju\n",
                        (uintmax_t)nsectors, (uintmax_t)nsectors * ss);
-                               fprintf(f, "# Step size (sectors/bytes): %zu/%zu\n", step, step_bytes);
+                               fprintf(f, "# Step size (sectors/bytes): %" PRIu64 "/%zu\n", step, step_bytes);
                fprintf(f, "# Steps: %ju\n", ((uintmax_t) nsectors / step) + 1);
                fprintf(f, "#\n");
                fprintf(f, "# <step>: <from> <to> (step offsets in bytes)\n");
@@ -533,7 +533,7 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa
        for (cc = 1, i = 0; i < nsectors && nbytes > 0; i += step, cc++) {
 
                if (nbytes < step_bytes) {
-                       DBG(MISC, ul_debug("aligning step #%05zu from %ju to %ju",
+                       DBG(MISC, ul_debug("aligning step #%05zu from %zu to %ju",
                                                cc, step_bytes, nbytes));
                        step_bytes = nbytes;
                }
@@ -551,7 +551,7 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa
                                if (f)
                                        fprintf(f, "%05zu: read error %12ju %12ju\n", cc, src, dst);
                                fdisk_warn(sf->cxt,
-                                       _("cannot read at offset: %zu; continue"), src);
+                                       _("cannot read at offset: %ju; continue"), src);
                                ioerr++;
                                goto next;
                        }
@@ -562,7 +562,7 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa
                                if (f)
                                        fprintf(f, "%05zu: write error %12ju %12ju\n", cc, src, dst);
                                fdisk_warn(sf->cxt,
-                                       _("cannot write at offset: %zu; continue"), dst);
+                                       _("cannot write at offset: %ju; continue"), dst);
                                ioerr++;
                                goto next;
                        }
index 175a9ea0374a786be9fd30a5e6742fe25fa24c19..d3d9aa3056789536335f1afe14aebf5f2d7f487a 100644 (file)
@@ -31,6 +31,7 @@
  * Written by Karel Zak <kzak@redhat.com> [October 2021]
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -279,7 +280,7 @@ size_t ul_fileeq_set_size(struct ul_fileeq *eq, uint64_t filesiz,
        eq->readsiz = readsiz;
        eq->blocksmax = filesiz / readsiz;
 
-       DBG(EQ, ul_debugobj(eq, "set sizes: filesiz=%ju, maxblocks=%zu, readsiz=%zu",
+       DBG(EQ, ul_debugobj(eq, "set sizes: filesiz=%ju, maxblocks=%" PRIu64 ", readsiz=%zu",
                                eq->filesiz, eq->blocksmax, eq->readsiz));
        return eq->blocksmax;
 }
index 4f6604fa3574a561369671663dc641af0acd4324..06c25572bef9dc1ceda924c129937667aeffab78 100644 (file)
@@ -1158,7 +1158,7 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
                if (buf && !memcmp(mag->magic,
                                buf + (mag->sboff & 0x3ff), mag->len)) {
 
-                       DBG(LOWPROBE, ul_debug("\tmagic sboff=%u, kboff=%ld",
+                       DBG(LOWPROBE, ul_debug("\tmagic sboff=%u, kboff=%" PRIu64,
                                mag->sboff, kboff));
                        if (offset)
                                *offset = off + (mag->sboff & 0x3ff);
index 08af2882c1359e41fba37377a08c9a18647b0f9f..0d01814dc70a67c333a345f9ab2f30cc5fce6a79 100644 (file)
@@ -814,7 +814,7 @@ static int inserter(const char *fpath, const struct stat *sb,
                return 0;
        }
 
-       jlog(JLOG_VERBOSE2, " %5zu: [%ld/%ld/%zu] %s",
+       jlog(JLOG_VERBOSE2, " %5zu: [%" PRIu64 "/%" PRIu64 "/%zu] %s",
                        stats.files, sb->st_dev, sb->st_ino,
                        (size_t) sb->st_nlink, fpath);
 
index e106a9019baa5c9d850887786dfbfb4fb32fe270..c918ecd6e9b930c22003a6a4ac0fb0671dc4843f 100644 (file)
@@ -678,7 +678,7 @@ static int callback_log_stream_activity(void *data, int fd, char *buf, size_t bu
        if (ssz < 0)
                return (int) ssz;
 
-       DBG(IO, ul_debug(" append %ld bytes [summary=%zu, max=%zu]", ssz,
+       DBG(IO, ul_debug(" append %zd bytes [summary=%" PRIu64 ", max=%" PRIu64 "]", ssz,
                                ctl->outsz, ctl->maxsz));
 
        ctl->outsz += ssz;