if (!rc)
rc = fdisk_delete_partition(cxt, n);
if (rc)
- fdisk_warnx(cxt, _("Could not delete partition %d"), n + 1);
+ fdisk_warnx(cxt, _("Could not delete partition %d"), (int) n + 1);
else
- fdisk_info(cxt, _("Partition %d has been deleted."), n + 1);
+ fdisk_info(cxt, _("Partition %d has been deleted."), (int) n + 1);
break;
case 'l':
list_partition_types(cxt);
| SIZE_SUFFIX_3LETTER, bytes);
fdisk_colon(cxt, _("Disk %s: %s, %llu bytes, %llu sectors"),
- cxt->dev_path, strsz, bytes, cxt->total_sectors);
+ cxt->dev_path, strsz,
+ (unsigned long long) bytes,
+ (unsigned long long) cxt->total_sectors);
free(strsz);
if (fdisk_require_geometry(cxt) || fdisk_context_use_cylinders(cxt))
/* add to the list */
if (!*run)
rlen = inchar ? snprintf(ptr, *len, "%c,", tochar(*begin)) :
- snprintf(ptr, *len, "%zd,", *begin);
+ snprintf(ptr, *len, "%zu,", *begin);
else if (*run == 1)
rlen = inchar ?
snprintf(ptr, *len, "%c,%c,", tochar(*begin), tochar(*begin + 1)) :
- snprintf(ptr, *len, "%zd,%zd,", *begin, *begin + 1);
+ snprintf(ptr, *len, "%zu,%zu,", *begin, *begin + 1);
else
rlen = inchar ?
snprintf(ptr, *len, "%c-%c,", tochar(*begin), tochar(*begin + *run)) :
- snprintf(ptr, *len, "%zd-%zd,", *begin, *begin + *run);
+ snprintf(ptr, *len, "%zu-%zu,", *begin, *begin + *run);
if (rlen < 0 || (size_t) rlen + 1 > *len)
return NULL;
inchar = 1;
DBG(ASK, dbgprint("%s: asking for %s partition number "
- "(max: %zd, inchar: %s)",
+ "(max: %zu, inchar: %s)",
cxt->label->name,
wantnew ? "new" : "used",
cxt->label->nparts_max,
}
}
- DBG(ASK, dbgprint("ask limits: low: %zd, high: %zd, default: %zd",
+ DBG(ASK, dbgprint("ask limits: low: %ju, high: %ju, default: %ju",
num->low, num->hig, num->dfl));
if (!rc && !wantnew && num->low == num->hig) {
if (num->low > 0) {
/* only one existing partiton, don't ask, return the number */
fdisk_ask_number_set_result(ask, num->low);
- fdisk_info(cxt, _("Selected partition %d"), num->low);
+ fdisk_info(cxt, _("Selected partition %d"), (int) num->low);
} else if (num->low == 0) {
fdisk_warnx(cxt, _("No partition is defined yet!"));
if (num->low > 0) {
/* only one free partition, don't ask, return the number */
fdisk_ask_number_set_result(ask, num->low);
- fdisk_info(cxt, _("Selected partition %d"), num->low);
+ fdisk_info(cxt, _("Selected partition %d"), (int) num->low);
}
if (num->low == 0) {
fdisk_warnx(cxt, _("No free partition available!"));
if (*partnum)
*partnum -= 1;
}
- DBG(ASK, dbgprint("result: %zd [rc=%d]\n", fdisk_ask_number_get_result(ask), rc));
+ DBG(ASK, dbgprint("result: %ju [rc=%d]\n", fdisk_ask_number_get_result(ask), rc));
fdisk_free_ask(ask);
return rc;
}
*result = fdisk_ask_number_get_result(ask);
fdisk_free_ask(ask);
- DBG(ASK, dbgprint("result: %zd [rc=%d]\n", *result, rc));
+ DBG(ASK, dbgprint("result: %ju [rc=%d]\n", *result, rc));
return rc;
}
fdisk_sinfo(cxt, FDISK_INFO_SUCCESS,
_("BSD partition '%c' linked to DOS partition %d."),
- 'a' + i, k + 1);
+ 'a' + (int) i, (int) k + 1);
return 0;
}
"partition table format can not be used on drives for "
"volumes larger than (%llu bytes) for %ld-byte "
"sectors. Use GUID partition table format (GPT)."),
- szstr, bytes,
- (sector_t ) UINT_MAX * cxt->sector_size,
+ szstr, (unsigned long long) bytes,
+ (unsigned long long) UINT_MAX * cxt->sector_size,
cxt->sector_size);
free(szstr);
}
if (p && p->sys_ind) {
fdisk_warnx(cxt, _("Partition %zd is already defined. "
- "Delete it before re-adding it."), n + 1);
+ "Delete it before re-adding it."),
+ (ssize_t) n + 1);
return -EINVAL;
}
fill_bounds(cxt, first, last);
case DOS_FLAG_ACTIVE:
if (IS_EXTENDED(p->sys_ind) && !p->boot_ind)
fdisk_warnx(cxt, _("Partition %d: is an extended "
- "partition."), i + 1);
+ "partition."), (int) i + 1);
p->boot_ind = (p->boot_ind ? 0 : ACTIVE_FLAG);
partition_set_changed(cxt, i, 1);
#define EFI_PMBR_OSTYPE 0xEE
#define MSDOS_MBR_SIGNATURE 0xAA55
-#define GPT_PART_NAME_LEN 72 / sizeof(uint16_t)
+#define GPT_PART_NAME_LEN (72 / sizeof(uint16_t))
#define GPT_NPARTITIONS 128
/* Globally unique identifier */
fdisk_colon(cxt, _("Last LBA: %ju"), h->last_usable_lba);
fdisk_colon(cxt, _("Alternative LBA: %ju"), h->alternative_lba);
fdisk_colon(cxt, _("Partitions entries LBA: %ju"), h->partition_entry_lba);
- fdisk_colon(cxt, _("Allocated partition entries: %ju"), h->npartition_entries);
+ fdisk_colon(cxt, _("Allocated partition entries: %ju"), (uintmax_t) h->npartition_entries);
}
tt_define_column(tb, _("Device"), 0.1, 0);
tt_define_column(tb, _("Start"), 12, TT_FL_RIGHT);
fdisk_sinfo(cxt, FDISK_INFO_SUCCESS,
_("Partition name changed from '%s' to '%.*s'."),
- old, GPT_PART_NAME_LEN, str);
+ old, (int) GPT_PART_NAME_LEN, str);
free(str);
free(old);
extern uint64_t fdisk_ask_yesno_get_result(struct fdisk_ask *ask);
extern int fdisk_ask_yesno_set_result(struct fdisk_ask *ask, uint64_t result);
-extern int fdisk_info(struct fdisk_context *cxt, const char *fmt, ...);
-extern int fdisk_colon(struct fdisk_context *cxt, const char *fmt, ...);
-extern int fdisk_sinfo(struct fdisk_context *cxt, unsigned int flags, const char *fmt, ...);
-
-extern int fdisk_warnx(struct fdisk_context *cxt, const char *fmt, ...);
-extern int fdisk_warn(struct fdisk_context *cxt, const char *fmt, ...);
+extern int fdisk_info(struct fdisk_context *cxt, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int fdisk_colon(struct fdisk_context *cxt, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int fdisk_sinfo(struct fdisk_context *cxt, unsigned int flags, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int fdisk_warnx(struct fdisk_context *cxt, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int fdisk_warn(struct fdisk_context *cxt, const char *fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
extern int fdisk_ask_print_get_errno(struct fdisk_ask *ask);
extern int fdisk_ask_print_set_errno(struct fdisk_ask *ask, int errnum);
_("You haven't covered the whole disk with the 3rd partition, but your value\n"
"%d %s covers some other partition. Your entry has been changed\n"
"to %d %s"),
- fdisk_scround(cxt, last), fdisk_context_get_unit(cxt, SINGULAR),
- fdisk_scround(cxt, stop), fdisk_context_get_unit(cxt, SINGULAR));
+ (int) fdisk_scround(cxt, last), fdisk_context_get_unit(cxt, SINGULAR),
+ (int) fdisk_scround(cxt, stop), fdisk_context_get_unit(cxt, SINGULAR));
last = stop;
}
} else if (!whole_disk && last > stop)