From: Karel Zak Date: Wed, 5 Aug 2015 10:41:46 +0000 (+0200) Subject: cfdisk, sfdisk: remove unused variables X-Git-Tag: v2.27-rc2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffab025db89dc975fe57760e25226f6b0e9d9c53;p=thirdparty%2Futil-linux.git cfdisk, sfdisk: remove unused variables Signed-off-by: Karel Zak --- diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index cc1163a027..8b34107ca2 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -602,12 +602,12 @@ static int ask_menu(struct fdisk_ask *ask, struct cfdisk *cf) /* libfdisk callback */ -static int ask_callback(struct fdisk_context *cxt, struct fdisk_ask *ask, - void *data __attribute__((__unused__))) +static int ask_callback(struct fdisk_context *cxt __attribute__((__unused__)), + struct fdisk_ask *ask, + void *data __attribute__((__unused__))) { int rc = 0; - assert(cxt); assert(ask); switch(fdisk_ask_get_type(ask)) { @@ -1715,14 +1715,13 @@ static int ui_refresh(struct cfdisk *cf) return 0; } -static ssize_t ui_get_string(struct cfdisk *cf, const char *prompt, +static ssize_t ui_get_string(const char *prompt, const char *hint, char *buf, size_t len) { size_t cells = 0; ssize_t i = 0, rc = -1; int ln = MENU_START_LINE, cl = 1; - assert(cf); assert(buf); assert(len); @@ -1859,7 +1858,7 @@ static int ui_get_size(struct cfdisk *cf, const char *prompt, uintmax_t *res, do { int pwr = 0, insec = 0; - rc = ui_get_string(cf, prompt, + rc = ui_get_string(prompt, _("May be followed by M for MiB, G for GiB, " "T for TiB, or S for sectors."), buf, sizeof(buf)); @@ -2008,7 +2007,7 @@ static int ui_script_read(struct cfdisk *cf) int rc; erase(); - rc = ui_get_string(cf, _("Enter script file name: "), + rc = ui_get_string( _("Enter script file name: "), _("The script file will be applied to in-memory partition table."), buf, sizeof(buf)); if (rc <= 0) @@ -2038,7 +2037,7 @@ static int ui_script_write(struct cfdisk *cf) FILE *f = NULL; int rc; - rc = ui_get_string(cf, _("Enter script file name: "), + rc = ui_get_string( _("Enter script file name: "), _("The current in-memory partition table will be dumped to the file."), buf, sizeof(buf)); if (rc <= 0) @@ -2371,7 +2370,7 @@ static int main_menu_action(struct cfdisk *cf, int key) break; } - rc = ui_get_string(cf, + rc = ui_get_string( _("Are you sure you want to write the partition " "table to disk? "), _("Type \"yes\" or \"no\", or press ESC to leave this dialog."), diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 173029f639..c2ef44d892 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -146,14 +146,13 @@ static int get_user_reply(const char *prompt, char *buf, size_t bufsz) return 0; } -static int ask_callback(struct fdisk_context *cxt, +static int ask_callback(struct fdisk_context *cxt __attribute__((__unused__)), struct fdisk_ask *ask, void *data) { struct sfdisk *sf = (struct sfdisk *) data; int rc = 0; - assert(cxt); assert(ask); switch(fdisk_ask_get_type(ask)) {