[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/utils.c (isascii_alnum, isas
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha) (isascii_digit, isascii_lower, isascii_upper): use unsigned char for argument type, as it is the recommended type for isupper/islower... it saves the need to do an explicit cast. |
Date: |
Sun, 17 Nov 2024 08:19:01 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 5c5c03e846 * tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha)
(isascii_digit, isascii_lower, isascii_upper): use unsigned char for argument
type, as it is the recommended type for isupper/islower... it saves the need to
do an explicit cast.
5c5c03e846 is described below
commit 5c5c03e846101058740887ebcfb5cae6464a8c13
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 17 14:18:45 2024 +0100
* tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha)
(isascii_digit, isascii_lower, isascii_upper): use unsigned char for
argument type, as it is the recommended type for isupper/islower...
it saves the need to do an explicit cast.
---
ChangeLog | 7 +++++++
tp/Texinfo/XS/main/text.c | 1 +
tp/Texinfo/XS/main/utils.c | 11 ++++++-----
tp/Texinfo/XS/main/utils.h | 10 +++++-----
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ed02e494f3..62d9604ebf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-11-17 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha)
+ (isascii_digit, isascii_lower, isascii_upper): use unsigned char for
+ argument type, as it is the recommended type for isupper/islower...
+ it saves the need to do an explicit cast.
+
2024-11-17 Gavin Smith <gavinsmith0123@gmail.com>
* autogen.sh,
diff --git a/tp/Texinfo/XS/main/text.c b/tp/Texinfo/XS/main/text.c
index 9acfe4ec0b..5fbe53fdd2 100644
--- a/tp/Texinfo/XS/main/text.c
+++ b/tp/Texinfo/XS/main/text.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index a4a2c5d44a..8960aef7f4 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -16,6 +16,7 @@
/* code that does not fit anywhere else */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -208,31 +209,31 @@ void fatal (char *message)
}
int
-isascii_alnum (int c)
+isascii_alnum (unsigned char c)
{
return (((c & ~0x7f) == 0) && isalnum (c));
}
int
-isascii_alpha (int c)
+isascii_alpha (unsigned char c)
{
return (((c & ~0x7f) == 0) && isalpha (c));
}
int
-isascii_digit (int c)
+isascii_digit (unsigned char c)
{
return (((c & ~0x7f) == 0) && isdigit (c));
}
int
-isascii_lower (int c)
+isascii_lower (unsigned char c)
{
return (((c & ~0x7f) == 0) && islower (c));
}
int
-isascii_upper (int c)
+isascii_upper (unsigned char c)
{
return (((c & ~0x7f) == 0) && isupper (c));
}
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index 2f8e696c95..a12134d418 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -113,11 +113,11 @@ int xasprintf (char **ptr, const char *template, ...);
void fatal (char *);
void bug (char *);
-int isascii_alnum (int c);
-int isascii_alpha (int c);
-int isascii_digit (int c);
-int isascii_lower (int c);
-int isascii_upper (int c);
+int isascii_alnum (unsigned char c);
+int isascii_alpha (unsigned char c);
+int isascii_digit (unsigned char c);
+int isascii_lower (unsigned char c);
+int isascii_upper (unsigned char c);
size_t count_multibyte (const char *text);
char *to_upper_or_lower_multibyte (const char *text, int lower_or_upper);
int width_multibyte (const char *text);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha) (isascii_digit, isascii_lower, isascii_upper): use unsigned char for argument type, as it is the recommended type for isupper/islower... it saves the need to do an explicit cast.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * autogen.sh, * tp/tests/Makefile.am: use tar cf instead of -cf, etc. From Patrice.
- Next by Date:
branch master updated: * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources), tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug, fatal, isascii_* functions to a new file main/base_utils.c out of utils.c.
- Previous by thread:
branch master updated: * autogen.sh, * tp/tests/Makefile.am: use tar cf instead of -cf, etc. From Patrice.
- Next by thread:
branch master updated: * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources), tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug, fatal, isascii_* functions to a new file main/base_utils.c out of utils.c.
- Index(es):