]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/cfdisk.c
misc: cosmetics, remove argument from usage(FILE*)
[thirdparty/util-linux.git] / disk-utils / cfdisk.c
index cc4a8676f4e60dca9eb604c31d9ec2473c533383..e17bc916713f1b0fb37f9a687ae546663df0c16c 100644 (file)
@@ -323,7 +323,7 @@ static char *table_to_string(struct cfdisk *cf, struct fdisk_table *tb)
 {
        struct fdisk_partition *pa;
        struct fdisk_label *lb;
-       struct fdisk_iter *itr = NULL;
+       struct fdisk_iter *itr;
        struct libscols_table *table = NULL;
        struct libscols_iter *s_itr = NULL;
        char *res = NULL;
@@ -1471,7 +1471,7 @@ static int ui_menu_move(struct cfdisk *cf, int key)
        assert(cf);
        assert(cf->menu);
 
-       if (key == ERR)
+       if (key == (int) ERR)
                return 0;       /* ignore errors */
 
        m = cf->menu;
@@ -1756,7 +1756,7 @@ static ssize_t ui_get_string(const char *prompt,
     defined(HAVE_LIBNCURSESW) && defined(HAVE_WIDECHAR)
                if (get_wch(&c) == ERR) {
 #else
-               if ((c = getch()) == ERR) {
+               if ((c = getch()) == (wint_t) ERR) {
 #endif
                        if (ui_resize) {
                                resize();
@@ -2503,6 +2503,7 @@ static int ui_run(struct cfdisk *cf)
                                ui_table_goto(cf, (int) cf->lines_idx - cf->page_sz);
                                break;
                        }
+                       /* fallthrough */
                case KEY_HOME:
                        ui_table_goto(cf, 0);
                        break;
@@ -2511,6 +2512,7 @@ static int ui_run(struct cfdisk *cf)
                                ui_table_goto(cf, cf->lines_idx + cf->page_sz);
                                break;
                        }
+                       /* fallthrough */
                case KEY_END:
                        ui_table_goto(cf, (int) cf->nlines - 1);
                        break;
@@ -2540,8 +2542,9 @@ static int ui_run(struct cfdisk *cf)
        return 0;
 }
 
-static void __attribute__ ((__noreturn__)) usage(FILE *out)
+static void __attribute__((__noreturn__)) usage(void)
 {
+       FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
              _(" %1$s [options] <disk>\n"), program_invocation_short_name);
@@ -2560,7 +2563,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out)
        fputs(USAGE_VERSION, out);
 
        fprintf(out, USAGE_MAN_TAIL("cfdisk(8)"));
-       exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+       exit(EXIT_SUCCESS);
 }
 
 int main(int argc, char *argv[])
@@ -2586,7 +2589,7 @@ int main(int argc, char *argv[])
        while((c = getopt_long(argc, argv, "L::hVz", longopts, NULL)) != -1) {
                switch(c) {
                case 'h':
-                       usage(stdout);
+                       usage();
                        break;
                case 'L':
                        colormode = UL_COLORMODE_AUTO;