]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: stop mixing declarations and code
authorSami Kerola <kerolasa@iki.fi>
Sun, 5 Mar 2017 20:52:20 +0000 (20:52 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Mar 2017 13:48:04 +0000 (14:48 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/cfdisk.c
disk-utils/sfdisk.c
libblkid/src/superblocks/minix.c
text-utils/hexdump-display.c

index f06dad1c857135c205a56cb4d19823f9b0998f12..cb9f3421da3e0ff66c1dc2ec4e7453a254cd827c 100644 (file)
@@ -2092,6 +2092,8 @@ static int ui_create_label(struct cfdisk *cf)
 
 
        do {
+               int key;
+
                if (refresh_menu) {
                        ui_draw_menu(cf);
                        ui_hint(_("Select a type to create a new label or press 'L' to load script file."));
@@ -2099,7 +2101,7 @@ static int ui_create_label(struct cfdisk *cf)
                        refresh_menu = 0;
                }
 
-               int key = getch();
+               key = getch();
 
                if (ui_resize)
                        ui_menu_resize(cf);
index f4f9b6b1ad4310f685044989673404816644a6f5..cf5dd0052a813504c9bd27b5ff2875aa7fbaa3b8 100644 (file)
@@ -1495,7 +1495,7 @@ static void follow_wipe_mode(struct sfdisk *sf)
 static int wipe_partition(struct sfdisk *sf, size_t partno)
 {
        int rc, yes = 0;
-       char *fstype = NULL;;
+       char *fstype = NULL;
        struct fdisk_partition *tmp = NULL;
 
        DBG(MISC, ul_debug("checking for signature"));
index feebc96adca8efb396ac713067d1e8b932534ffe..b8881e574abe2383397668d32d59b2cdb526c271 100644 (file)
@@ -77,6 +77,9 @@ static int probe_minix(blkid_probe pr,
        unsigned char *ext;
        const unsigned char *data;
        int version = 0, swabme = 0;
+       unsigned long zones, ninodes, imaps, zmaps;
+       off_t firstz;
+       size_t zone_size;
 
        data = blkid_probe_get_buffer(pr, 1024,
                        max(sizeof(struct minix_super_block),
@@ -87,10 +90,6 @@ static int probe_minix(blkid_probe pr,
        if (version < 1)
                return 1;
 
-       unsigned long zones, ninodes, imaps, zmaps;
-       off_t firstz;
-       size_t zone_size;
-
        if (version <= 2) {
                struct minix_super_block *sb = (struct minix_super_block *) data;
 
index ce714f68cf03be1d41e807bdc7b556cd59755131..3e017635b45f76b7d6fefaec35fd29e7870a6db0 100644 (file)
@@ -299,9 +299,9 @@ void display(struct hexdump *hex)
                        eaddress = address;
                }
                list_for_each (p, &endfu->prlist) {
-                       pr = list_entry(p, struct hexdump_pr, prlist);
-
                        const char *color = NULL;
+
+                       pr = list_entry(p, struct hexdump_pr, prlist);
                        if (colors_wanted() && pr->colorlist
                            && (color = color_cond(pr, bp, pr->bcnt))) {
                                color_enable(color);