texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: No casts in isascii_* calls


From: Gavin D. Smith
Subject: branch master updated: No casts in isascii_* calls
Date: Mon, 24 Jul 2023 18:21:46 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 34eab8198f No casts in isascii_* calls
34eab8198f is described below

commit 34eab8198fa2ee8f1b2cc2ebede14688d5fd2f47
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Jul 24 23:19:38 2023 +0100

    No casts in isascii_* calls
    
    * tp/Texinfo/XS/parsetexi/end_line.c (isascii_alpha),
    * tp/Texinfo/XS/parsetexi/parser.c (isascii_alnum):
    Remove casts to 'unsigned char' from call sites.  These should
    not be necessary as we check in the functions that the argument
    is in the ASCII range.
---
 ChangeLog                          | 10 ++++++++++
 tp/Texinfo/XS/parsetexi/end_line.c |  6 +++---
 tp/Texinfo/XS/parsetexi/parser.c   |  6 +++---
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 40bca8ccd2..393d7a6183 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-07-24  Gavin Smith <gavinsmith0123@gmail.com>
+
+       No casts in isascii_* calls
+
+       * tp/Texinfo/XS/parsetexi/end_line.c (isascii_alpha),
+       * tp/Texinfo/XS/parsetexi/parser.c (isascii_alnum):
+       Remove casts to 'unsigned char' from call sites.  These should
+       not be necessary as we check in the functions that the argument
+       is in the ASCII range.
+
 2023-07-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Plaintext.pm (_convert): add a space after
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 744696994f..26f5cc5fb7 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -887,7 +887,7 @@ end_line_starting_block (ELEMENT *current)
               /* Check if @enumerate specification is either a single
                  letter or a string of digits. */
               if (g->text.end == 1
-                    && isascii_alpha ((unsigned char) g->text.text[0])
+                    && isascii_alpha (g->text.text[0])
                   || (g->text.end > 0
                       && !*(g->text.text
                             + strspn (g->text.text, digit_chars))))
@@ -1448,7 +1448,7 @@ end_line_misc_line (ELEMENT *current)
                  just check if the language code looks right. */
 
               p = text;
-              while (isascii_alpha ((unsigned char) *p))
+              while (isascii_alpha (*p))
                 p++;
               if (*p && *p != '_')
                 {
@@ -1473,7 +1473,7 @@ end_line_misc_line (ELEMENT *current)
                       p = q;
                       /* Language code should be of the form LL_CC,
                          language code followed by country code. */
-                      while (isascii_alpha ((unsigned char) *p))
+                      while (isascii_alpha (*p))
                         p++;
                       if (*p || p - q > 4)
                         {
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 28e442008a..ed6214b332 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -79,10 +79,10 @@ read_command_name (char **ptr)
   char *ret = 0;
 
   q = p;
-  if (!isascii_alnum ((unsigned char) *q))
+  if (!isascii_alnum (*q))
     return 0; /* Invalid. */
 
-  while (isascii_alnum ((unsigned char) *q) || *q == '-' || *q == '_')
+  while (isascii_alnum (*q) || *q == '-' || *q == '_')
     q++;
   ret = strndup (p, q - p);
   p = q;
@@ -131,7 +131,7 @@ read_flag_name (char **ptr)
   char *ret = 0;
 
   q = p;
-  if (!isascii_alnum ((unsigned char) *q) && *q != '-' && *q != '_')
+  if (!isascii_alnum (*q) && *q != '-' && *q != '_')
     return 0; /* Invalid. */
 
   while (!strchr (whitespace_chars, *q)



reply via email to

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