summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/gpt.c
diff options
context:
space:
mode:
authorRuediger Meier2016-02-22 11:58:05 +0100
committerRuediger Meier2016-03-07 23:16:04 +0100
commitfdbd7bb94051bce49a40b0e055bfa21755de3b1c (patch)
treeb4525048d811b8a7bf1d6574922995fa25fb8a9f /libfdisk/src/gpt.c
parentwipefs, sfdisk: include libgen.h for basename(3p) (diff)
downloadkernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.tar.gz
kernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.tar.xz
kernel-qcow2-util-linux-fdbd7bb94051bce49a40b0e055bfa21755de3b1c.zip
misc: again fixing many printf format strings
This is again a huge patch regarding printf format strings to fix compiler warnings seen on clang/OSX. I'm trying to follow these rules strictly: #type #format #cast uintmax_t %ju - intmax_t %jd - uint64_t PRIu64 - int64_t PRId64 - size_t %zu - ssize_t %zd - ino_t %ju (uintmax_t) off_t %jd (intmax_t) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'libfdisk/src/gpt.c')
-rw-r--r--libfdisk/src/gpt.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index cd88df0e6..2b2f51912 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -621,7 +621,8 @@ static int count_first_last_lba(struct fdisk_context *cxt,
if (rc < 0)
return rc;
- DBG(LABEL, ul_debug("FirstLBA: script=%ju, uefi=%ju, topology=%ju.", *first, flba, cxt->first_lba));
+ DBG(LABEL, ul_debug("FirstLBA: script=%"PRIu64", uefi=%"PRIu64", topology=%ju.",
+ *first, flba, (uintmax_t)cxt->first_lba));
if (rc == 0 && (*first < flba || *first > llba)) {
fdisk_warnx(cxt, _("First LBA specified by script is out of range."));
@@ -632,7 +633,8 @@ static int count_first_last_lba(struct fdisk_context *cxt,
if (rc < 0)
return rc;
- DBG(LABEL, ul_debug("LastLBA: script=%ju, uefi=%ju, topology=%ju.", *last, llba, cxt->last_lba));
+ DBG(LABEL, ul_debug("LastLBA: script=%"PRIu64", uefi=%"PRIu64", topology=%ju.",
+ *last, llba, (uintmax_t)cxt->last_lba));
if (rc == 0 && (*last > llba || *last < flba)) {
fdisk_warnx(cxt, _("Last LBA specified by script is out of range."));
@@ -799,7 +801,7 @@ static uint64_t last_lba(struct fdisk_context *cxt)
else
fdisk_warnx(cxt, _("gpt: cannot handle files with mode %o"), s.st_mode);
- DBG(LABEL, ul_debug("GPT last LBA: %ju", sectors));
+ DBG(LABEL, ul_debug("GPT last LBA: %"PRIu64"", sectors));
return sectors;
}
@@ -1024,13 +1026,13 @@ static struct gpt_header *gpt_read_header(struct fdisk_context *cxt,
else
free(ents);
- DBG(LABEL, ul_debug("found valid GPT Header on LBA %ju", lba));
+ DBG(LABEL, ul_debug("found valid GPT Header on LBA %"PRIu64"", lba));
return header;
invalid:
free(header);
free(ents);
- DBG(LABEL, ul_debug("read GPT Header on LBA %ju failed", lba));
+ DBG(LABEL, ul_debug("read GPT Header on LBA %"PRIu64" failed", lba));
return NULL;
}
@@ -2141,14 +2143,14 @@ static int gpt_add_partition(
do {
uint64_t x;
- DBG(LABEL, ul_debug("testing first sector %ju", disk_f));
+ DBG(LABEL, ul_debug("testing first sector %"PRIu64"", disk_f));
disk_f = find_first_available(pheader, ents, disk_f);
if (!disk_f)
break;
x = find_last_free(pheader, ents, disk_f);
if (x - disk_f >= cxt->grain / cxt->sector_size)
break;
- DBG(LABEL, ul_debug("first sector %ju addresses to small space, continue...", disk_f));
+ DBG(LABEL, ul_debug("first sector %"PRIu64" addresses to small space, continue...", disk_f));
disk_f = x + 1;
} while(1);
@@ -2170,9 +2172,9 @@ static int gpt_add_partition(
user_f = dflt_f;
} else if (pa && fdisk_partition_has_start(pa)) {
- DBG(LABEL, ul_debug("first sector defined: %ju", pa->start));
+ DBG(LABEL, ul_debug("first sector defined: %ju", (uintmax_t)pa->start));
if (pa->start != find_first_available(pheader, ents, pa->start)) {
- fdisk_warnx(cxt, _("Sector %ju already used."), pa->start);
+ fdisk_warnx(cxt, _("Sector %ju already used."), (uintmax_t)pa->start);
return -ERANGE;
}
user_f = pa->start;
@@ -2213,8 +2215,8 @@ static int gpt_add_partition(
} else if (pa && fdisk_partition_has_size(pa)) {
user_l = user_f + pa->size - 1;
- DBG(LABEL, ul_debug("size defined: %ju, end: %ju (last possible: %ju)",
- pa->size, user_l, dflt_l));
+ DBG(LABEL, ul_debug("size defined: %ju, end: %"PRIu64" (last possible: %"PRIu64")",
+ (uintmax_t)pa->size, user_l, dflt_l));
if (user_l != dflt_l && !pa->size_explicit
&& user_l - user_f > (cxt->grain / fdisk_get_sector_size(cxt))) {
user_l = fdisk_align_lba_in_range(cxt, user_l, user_f, dflt_l);
@@ -2308,7 +2310,7 @@ static int gpt_add_partition(
if (pa && pa->attrs)
gpt_entry_attrs_from_string(cxt, e, pa->attrs);
- DBG(LABEL, ul_debug("GPT new partition: partno=%zu, start=%ju, end=%ju, size=%ju",
+ DBG(LABEL, ul_debug("GPT new partition: partno=%zu, start=%"PRIu64", end=%"PRIu64", size=%"PRIu64"",
partnum,
gpt_partition_start(e),
gpt_partition_end(e),