]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: make pointer arrays const
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:33:36 +0000 (12:33 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:36:03 +0000 (12:36 +0100)
libblkid/src/devname.c
libblkid/src/devno.c
libblkid/src/probe.c
libblkid/src/superblocks/bitlocker.c

index 27059c3bbcac64bb51e405c3bcad645d1847dc9b..0fb25325efb9e432f2b142fcebbcb7ea1dde45d8 100644 (file)
@@ -147,7 +147,7 @@ done:
 }
 
 /* Directories where we will try to search for device names */
-static const char *dirlist[] = { "/dev", "/devfs", "/devices", NULL };
+static const char *const dirlist[] = { "/dev", "/devfs", "/devices", NULL };
 
 /*
  * Return 1 if the device is a device-mapper 'leaf' node
@@ -177,7 +177,7 @@ static void probe_one(blkid_cache cache, const char *ptname,
 {
        blkid_dev dev = NULL;
        struct list_head *p, *pnext;
-       const char **dir;
+       const char *const*dir;
        char *devname = NULL;
 
        /* See if we already have this device number in the cache. */
@@ -359,7 +359,7 @@ exit:
 static void
 ubi_probe_all(blkid_cache cache, int only_if_new)
 {
-       const char **dirname;
+       const char *const*dirname;
 
        for (dirname = dirlist; *dirname; dirname++) {
                DIR             *dir;
index a1ab54362fce463f4f6d46b8d830a295b0fa0258..2f39a11f3f50b089c5a6f375e510caf7b182c48e 100644 (file)
@@ -159,7 +159,7 @@ void blkid__scan_dir(char *dirname, dev_t devno, struct dir_list **list,
 }
 
 /* Directories where we will try to search for device numbers */
-static const char *devdirs[] = { "/devices", "/devfs", "/dev", NULL };
+static const char *const devdirs[] = { "/devices", "/devfs", "/dev", NULL };
 
 /**
  * SECTION: misc
@@ -173,7 +173,7 @@ static char *scandev_devno_to_devpath(dev_t devno)
 {
        struct dir_list *list = NULL, *new_list = NULL;
        char *devname = NULL;
-       const char **dir;
+       const char *const*dir;
 
        /*
         * Add the starting directories to search in reverse order of
index 5a17e873de13531d2263c7dd6052b5e71bd5d5af..b24e7769ce60ca68c465ba170ad7ebb1cec3d36b 100644 (file)
 /*
  * All supported chains
  */
-static const struct blkid_chaindrv *chains_drvs[] = {
+static const struct blkid_chaindrv *const chains_drvs[] = {
        [BLKID_CHAIN_SUBLKS] = &superblocks_drv,
        [BLKID_CHAIN_TOPLGY] = &topology_drv,
        [BLKID_CHAIN_PARTS] = &partitions_drv
index 74fa2b3626a74a596ca5b8138adb43f819f9aa54..55bbbd3b6080555e118723e217262c230fdafb94 100644 (file)
@@ -85,7 +85,7 @@ enum {
 static int get_bitlocker_type(const unsigned char *buf)
 {
        size_t i;
-       static const char *map[] = {
+       static const char *const map[] = {
                [BDE_VERSION_VISTA] = BDE_MAGIC_VISTA,
                [BDE_VERSION_WIN7]  = BDE_MAGIC_WIN7,
                [BDE_VERSION_TOGO]  = BDE_MAGIC_TOGO