texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Sat, 16 Nov 2024 17:28:55 -0500 (EST)

branch: master
commit 93c2e582b037b584fb88371e870d84fd4bb7cac6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Nov 16 23:28:48 2024 +0100

    * tp/Texinfo/XS/misc.c (xs_parse_command_name), tp/Texinfo/XS/xspara.c
    (xspara__print_escaped_spaces): cast argument of isalnum and isspace
    to unsigned char.  This is recommended as those functions expect
    unsigned argument, and it avoids warnings with -Wchar-subscripts when
    the functions are implemented with an array.
---
 ChangeLog              | 10 +++++++++-
 tp/Texinfo/XS/misc.c   |  4 ++--
 tp/Texinfo/XS/xspara.c |  2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d83c696674..af0ff78186 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 2024-11-16  Patrice Dumas  <pertusus@free.fr>
 
-       * nstall-info/install-info.c (split_entry): cast argument of isspace
+       * tp/Texinfo/XS/misc.c (xs_parse_command_name), tp/Texinfo/XS/xspara.c
+       (xspara__print_escaped_spaces): cast argument of isalnum and isspace
+       to unsigned char.  This is recommended as those functions expect
+       unsigned argument, and it avoids warnings with -Wchar-subscripts when
+       the functions are implemented with an array.
+
+2024-11-16  Patrice Dumas  <pertusus@free.fr>
+
+       * install-info/install-info.c (split_entry): cast argument of isspace
        to unsigned char.  This is recommended as this function expects
        unsigned argument, and it avoids warnings with -Wchar-subscripts when
        the function is implemented with an array.
diff --git a/tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c
index c895332535..13f030b287 100644
--- a/tp/Texinfo/XS/misc.c
+++ b/tp/Texinfo/XS/misc.c
@@ -259,14 +259,14 @@ void xs_parse_command_name (char *text,
   *command = 0;
   *is_single_letter = 0;
 
-  if (isalnum(text[0]))
+  if (isalnum ((unsigned char) text[0]))
     {
       char *p, *q;
       static char *s;
 
       p = text;
       q = text + 1;
-      while (isalnum (*q) || *q == '-' || *q == '_')
+      while (isalnum ((unsigned char) *q) || *q == '-' || *q == '_')
         q++;
 
       s = realloc (s, q - p + 1);
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index 318cbfd183..e6428143cf 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -121,7 +121,7 @@ xspara__print_escaped_spaces (char *string, size_t len)
         text_append_n (&t, "\\n", 2);
       else if (*p == '\f')
         text_append_n (&t, "\\f", 2);
-      else if (isspace(*p))
+      else if (isspace ((unsigned char) *p))
         {
           char protected_string[7];
           sprintf (protected_string, "\\x%04x", *p);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]