From: Max Kellermann Date: Mon, 18 Nov 2024 11:33:36 +0000 (+0100) Subject: libblkid: make pointer arrays const X-Git-Tag: v2.42-start~145^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bbc42cab222a0000482ea09e84d0ea8dd9c2b5e6;p=thirdparty%2Futil-linux.git libblkid: make pointer arrays const --- diff --git a/libblkid/src/devname.c b/libblkid/src/devname.c index 27059c3bb..0fb25325e 100644 --- a/libblkid/src/devname.c +++ b/libblkid/src/devname.c @@ -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; diff --git a/libblkid/src/devno.c b/libblkid/src/devno.c index a1ab54362..2f39a11f3 100644 --- a/libblkid/src/devno.c +++ b/libblkid/src/devno.c @@ -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 diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 5a17e873d..b24e7769c 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -125,7 +125,7 @@ /* * 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 diff --git a/libblkid/src/superblocks/bitlocker.c b/libblkid/src/superblocks/bitlocker.c index 74fa2b362..55bbbd3b6 100644 --- a/libblkid/src/superblocks/bitlocker.c +++ b/libblkid/src/superblocks/bitlocker.c @@ -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