Browse Source

fix various formats

Found with -Wformat.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
pull/1677/head
Rosen Penev 2 months ago
parent
commit
710e8ecb9f
  1. 8
      disk-utils/sfdisk.c
  2. 3
      lib/fileeq.c
  3. 2
      libblkid/src/probe.c
  4. 2
      misc-utils/hardlink.c
  5. 2
      term-utils/script.c

8
disk-utils/sfdisk.c

@ -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;
}

3
lib/fileeq.c

@ -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;
}

2
libblkid/src/probe.c

@ -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);

2
misc-utils/hardlink.c

@ -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);

2
term-utils/script.c

@ -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;

Loading…
Cancel
Save