From: Bruno Haible Date: Sun, 6 Sep 2020 21:19:33 +0000 (+0200) Subject: Fix "warning: cast ... drops const qualifier". X-Git-Tag: v0.21.1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e6356113ec34f384f0ab98feedfd5d02b9b723d;p=thirdparty%2Fgettext.git Fix "warning: cast ... drops const qualifier". * gnulib-local/lib/markup.c (slow_name_validate): Add 'const'. --- diff --git a/gnulib-local/lib/markup.c b/gnulib-local/lib/markup.c index 326661748..98d8e1f23 100644 --- a/gnulib-local/lib/markup.c +++ b/gnulib-local/lib/markup.c @@ -1,5 +1,5 @@ /* markup.c -- simple XML-like parser - Copyright (C) 2015, 2018 Free Software Foundation, Inc. + Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc. This file is not part of the GNU gettext program, but is used with GNU gettext. @@ -361,7 +361,7 @@ slow_name_validate (markup_parse_context_ty *context, const char *name) const char *p = name; ucs4_t uc; - if (u8_check ((uint8_t *) name, strlen (name)) != NULL) + if (u8_check ((const uint8_t *) name, strlen (name)) != NULL) { emit_error (context, _("invalid UTF-8 sequence")); return false; @@ -371,7 +371,7 @@ slow_name_validate (markup_parse_context_ty *context, const char *name) || (!IS_COMMON_NAME_END_CHAR (*p) && (*p == '_' || *p == ':' - || (u8_mbtouc (&uc, (uint8_t *) name, strlen (name)) > 0 + || (u8_mbtouc (&uc, (const uint8_t *) name, strlen (name)) > 0 && uc_is_alpha (uc)))))) { char *error_text = xasprintf (_("'%s' is not a valid name: %c"), @@ -381,9 +381,9 @@ slow_name_validate (markup_parse_context_ty *context, const char *name) return false; } - for (p = (char *) u8_next (&uc, (uint8_t *) name); + for (p = (const char *) u8_next (&uc, (const uint8_t *) name); p != NULL; - p = (char *) u8_next (&uc, (uint8_t *) p)) + p = (const char *) u8_next (&uc, (const uint8_t *) p)) { /* is_name_char */ if (!(c_isalnum (*p) ||