]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc-utils: make pointer arrays const
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:33:18 +0000 (12:33 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 18 Nov 2024 11:35:59 +0000 (12:35 +0100)
misc-utils/hardlink.c
misc-utils/kill.c
misc-utils/whereis.c

index 899c0d63537eeb2f44fdd446413094742f5c3628..d17bcd4f0e79f6abd3047d98299e72ccb52df365 100644 (file)
@@ -1401,7 +1401,7 @@ static int parse_options(int argc, char *argv[])
                        usage();
                case 'V':
                {
-                       static const char *features[] = {
+                       static const char *const features[] = {
 #ifdef USE_REFLINK
                                "reflink",
 #endif
index 02b03f55128fd639d1eb41c2c58b03d3c3413110..a5f78d2af603fa28a51a208f521215f64bf48cb1 100644 (file)
@@ -293,7 +293,7 @@ static void __attribute__((__noreturn__)) usage(void)
 
 static void __attribute__((__noreturn__)) print_kill_version(void)
 {
-       static const char *features[] = {
+       static const char *const features[] = {
 #ifdef HAVE_SIGQUEUE
                "sigqueue",
 #endif
index c11efa539e8cbe3ec5cba44cc7745d8367a99328..a35c1dff2cd8a1d3c8df1db16610b03468e2de46 100644 (file)
@@ -100,7 +100,7 @@ struct wh_dirlist {
        struct wh_dirlist *next;
 };
 
-static const char *bindirs[] = {
+static const char *const bindirs[] = {
        "/usr/bin",
        "/usr/sbin",
        "/bin",
@@ -161,7 +161,7 @@ static const char *bindirs[] = {
        NULL
 };
 
-static const char *mandirs[] = {
+static const char *const mandirs[] = {
        "/usr/man/*",
        "/usr/share/man/*",
        "/usr/X386/man/*",
@@ -172,7 +172,7 @@ static const char *mandirs[] = {
        NULL
 };
 
-static const char *srcdirs[] = {
+static const char *const srcdirs[] = {
        "/usr/src/*",
        "/usr/src/lib/libc/*",
        "/usr/src/lib/libc/net/*",
@@ -355,7 +355,7 @@ static void construct_dirlist_from_argv(struct wh_dirlist **ls,
 
 static void construct_dirlist(struct wh_dirlist **ls,
                              int type,
-                             const char **paths)
+                             const char *const*paths)
 {
        size_t i;