From: Jim Meyering Date: Mon, 20 Dec 2021 20:48:33 +0000 (-0800) Subject: maint: syntax-check requires "char const *", not "const char *" X-Git-Tag: v9.1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb2400fb9ffd30733375a8162d01ec9cad50580a;p=thirdparty%2Fcoreutils.git maint: syntax-check requires "char const *", not "const char *" * gl/lib/mbsalign.c (mbs_align_pad): Adjust. * src/chroot.c (is_root): Adjust. * src/digest.c (main): Adjust. * src/relpath.c (buffer_or_output) Adjust. * src/ls.c (print_name_with_quoting, get_color_indicator): Adjust. --- diff --git a/gl/lib/mbsalign.c b/gl/lib/mbsalign.c index 61a4c2a98a..e99eac04d7 100644 --- a/gl/lib/mbsalign.c +++ b/gl/lib/mbsalign.c @@ -83,7 +83,7 @@ wc_truncate (wchar_t *wc, size_t width) A pointer to the terminating NUL is returned. */ static char * -mbs_align_pad (char *dest, const char *dest_end, size_t n_spaces) +mbs_align_pad (char *dest, char const *dest_end, size_t n_spaces) { /* FIXME: Should we pad with "figure space" (\u2007) if non ascii data present? */ diff --git a/src/chroot.c b/src/chroot.c index fcfe45eda0..b6dda8616a 100644 --- a/src/chroot.c +++ b/src/chroot.c @@ -169,7 +169,7 @@ parse_additional_groups (char const *groups, GETGROUPS_T **pgids, could be bind mounted to a separate location. */ static bool -is_root (const char *dir) +is_root (char const *dir) { char *resolved = canonicalize_file_name (dir); bool is_res_root = resolved && STREQ ("/", resolved); diff --git a/src/digest.c b/src/digest.c index 22e8622850..c9e7caf473 100644 --- a/src/digest.c +++ b/src/digest.c @@ -1270,15 +1270,15 @@ main (int argc, char **argv) setvbuf (stdout, NULL, _IOLBF, 0); #if HASH_ALGO_SUM - const char *short_opts = "rs"; + char const *short_opts = "rs"; #elif HASH_ALGO_CKSUM - const char *short_opts = "a:l:bctwz"; - const char *digest_length_str = ""; + char const *short_opts = "a:l:bctwz"; + char const *digest_length_str = ""; #elif HASH_ALGO_BLAKE2 - const char *short_opts = "l:bctwz"; - const char *digest_length_str = ""; + char const *short_opts = "l:bctwz"; + char const *digest_length_str = ""; #else - const char *short_opts = "bctwz"; + char const *short_opts = "bctwz"; #endif while ((opt = getopt_long (argc, argv, short_opts, long_options, NULL)) != -1) diff --git a/src/ls.c b/src/ls.c index 36ab42aad2..6e87af651b 100644 --- a/src/ls.c +++ b/src/ls.c @@ -4809,7 +4809,7 @@ print_name_with_quoting (const struct fileinfo *f, struct obstack *stack, size_t start_col) { - const char *name = symlink_target ? f->linkname : f->name; + char const *name = symlink_target ? f->linkname : f->name; const struct bin_str *color = print_with_color ? get_color_indicator (f, symlink_target) : NULL; @@ -4953,7 +4953,7 @@ get_color_indicator (const struct fileinfo *f, bool symlink_target) struct color_ext_type *ext; /* Color extension */ size_t len; /* Length of name */ - const char *name; + char const *name; mode_t mode; int linkok; if (symlink_target) diff --git a/src/relpath.c b/src/relpath.c index 2798f63859..83e620a9db 100644 --- a/src/relpath.c +++ b/src/relpath.c @@ -64,7 +64,7 @@ path_common_prefix (char const *path1, char const *path2) and adjust *PLEN to reflect the remaining space. Return TRUE on failure. */ static bool -buffer_or_output (const char *str, char **pbuf, size_t *plen) +buffer_or_output (char const *str, char **pbuf, size_t *plen) { if (*pbuf) {