From a7f86d31409a5b543786a04c9752b770e45c0995 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Sat, 2 Oct 2010 18:45:24 +0000 Subject: fix more compiler warnings format strings, unused variables --- fdisk.c | 16 ++++++++++------ lib/blkio/setgeo.c | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/fdisk.c b/fdisk.c index eb86157..1220767 100644 --- a/fdisk.c +++ b/fdisk.c @@ -513,25 +513,27 @@ list_table(list_t list_type) continue; if (list_type == LIST_NORMAL) { - printf("%*s%-2d %c%9d%9d%9d%11lld%c %4x %s\n", + printf("%*s%-2d %c%9d%9d%9d%11llu%c %4x %s\n", w - 1, device, info.kern_part_no, ' ', sectors_to_units(calculate(part, info.chs_start.head, info.chs_start.sector, info.chs_start.cylinder)), sectors_to_units(info.blk_start), sectors_to_units(info.blk_end + (info.blk_end & 1 ? 0 : 1)), - (info.blk_end - info.blk_start + 1) / 2, + (unsigned long long)((info.blk_end - info.blk_start + 1) / 2), (info.blk_end - info.blk_start + 1) & 1 ? '+' : ' ', info.type, part_typename(part, info.type)); // check_consistency (part, p); } else { - printf("%2d %02x%4d%4d%5d%4d%4d%5d%12lld%12lld %03x\n", + printf("%2d %02x%4d%4d%5d%4d%4d%5d%12llu%12llu %03x\n", info.kern_part_no, 0, info.chs_start.head, info.chs_start.sector, info.chs_start.cylinder, info.chs_end.head, info.chs_end.sector, - info.chs_end.cylinder, info.blk_start, - info.blk_end - info.blk_start + 1, info.type); + info.chs_end.cylinder, + (unsigned long long)info.blk_start, + (unsigned long long)(info.blk_end - info.blk_start + 1), + info.type); // if (info.type != ptyp_none) // check_consistency (part, p); } @@ -567,7 +569,9 @@ print_part_size(const char *device) while(part_getpartinfo(part, i, &info)) { if (info.kern_part_no == partition) { - printf("%lld\n", (info.blk_end - info.blk_start + 1) / 2); + printf("%llu\n", + (unsigned long long)((info.blk_end - + info.blk_start + 1) / 2)); ret = pps_ret_ok; break; } diff --git a/lib/blkio/setgeo.c b/lib/blkio/setgeo.c index bef02a9..05fc89b 100644 --- a/lib/blkio/setgeo.c +++ b/lib/blkio/setgeo.c @@ -23,7 +23,10 @@ */ u_int blkio_setgeometry (blkio_t *blkio, const geometry_t *geo) { - u_int log2secsize, sectors, ret = 0; + u_int ret = 0; +#if defined(RISCOS) + u_int log2secsize, sectors; +#endif assert (blkio != NULL); assert (geo != NULL);