]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
disk-utils: make pointer arrays const
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:33:01 +0000 (12:33 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:35:59 +0000 (12:35 +0100)
disk-utils/cfdisk.c
disk-utils/fdisk-list.c
disk-utils/fdisk-list.h
disk-utils/fdisk-menu.c
disk-utils/fsck.c

index bc1c87d83e4ef429d694e5e2224abfe89bf28963..948957c5e2c3f87a85324c27502b0b24ce5852c6 100644 (file)
@@ -69,7 +69,7 @@
 #include "list.h"
 #include "blkdev.h"
 
-static const char *default_disks[] = {
+static const char *const default_disks[] = {
 #ifdef __GNU__
                "/dev/hd0",
                "/dev/sd0",
@@ -2247,7 +2247,7 @@ done:
 static int ui_help(void)
 {
        size_t i;
-       static const char *help[] = {
+       static const char *const help[] = {
                N_("This is cfdisk, a curses-based disk partitioning program."),
                N_("It lets you create, delete, and modify partitions on a block device."),
                "  ",
index f1edeb7db031356e4576ad2a69cf2a1b113b1bdb..24c4e040449f9b2dac6d3db93009159cc30af418 100644 (file)
@@ -250,7 +250,7 @@ int list_freespace_get_table(struct fdisk_context *cxt,
        char *strsz;
        int rc = 0, ct = 0;
 
-       static const char *colnames[] = { N_("Start"), N_("End"), N_("Sectors"), N_("Size") };
+       static const char *const colnames[] = { N_("Start"), N_("End"), N_("Sectors"), N_("Size") };
        static const int colids[] = { FDISK_FIELD_START, FDISK_FIELD_END, FDISK_FIELD_SECTORS, FDISK_FIELD_SIZE };
 
        rc = fdisk_get_freespaces(cxt, &tb);
index ccd982e5930ba7a62ad2ac7957fff5a3f01ce64c..1839301dd9f8f55f3b73ddbb0cfa801c7aa519f0 100644 (file)
@@ -41,7 +41,7 @@ enum {
 static inline int wipemode_from_string(const char *str)
 {
        size_t i;
-       static const char *modes[] = {
+       static const char *const modes[] = {
                [WIPEMODE_AUTO]   = "auto",
                [WIPEMODE_NEVER]  = "never",
                [WIPEMODE_ALWAYS] = "always"
index 8df4ac8d21bad1c73d81077ff90a96aa04439162..4e5801bce601161e56d3d922a46214a122597847 100644 (file)
@@ -254,7 +254,7 @@ static const struct menu menu_bsd = {
        }
 };
 
-static const struct menu *menus[] = {
+static const struct menu *const menus[] = {
        &menu_gpt,
        &menu_sun,
        &menu_sgi,
index 7dc12e67ade090dd0958a00c4f50da295d3b827e..5c09058721c9a6dbb27a81a9edf1f126974125db 100644 (file)
 
 #define FSCK_RUNTIME_DIRNAME   "/run/fsck"
 
-static const char *ignored_types[] = {
+static const char *const ignored_types[] = {
        "ignore",
        "iso9660",
        "sw",
        NULL
 };
 
-static const char *really_wanted[] = {
+static const char *const really_wanted[] = {
        "minix",
        "ext2",
        "ext3",
@@ -1097,7 +1097,7 @@ static int device_exists(const char *device)
 
 static int fs_ignored_type(struct libmnt_fs *fs)
 {
-       const char **ip, *type;
+       const char *const*ip, *type;
 
        if (!mnt_fs_is_regularfs(fs))
                return 1;