]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix "warning: cast ... drops const qualifier".
authorBruno Haible <bruno@clisp.org>
Sun, 6 Sep 2020 21:19:33 +0000 (23:19 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* gnulib-local/lib/markup.c (slow_name_validate): Add 'const'.

gnulib-local/lib/markup.c

index 326661748cb4ca2af2fd976ab8ce0c7a70346c3e..98d8e1f23060fbc869284f3970b795069ac61018 100644 (file)
@@ -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) ||