1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Use c-ctype.h in lib-src

This fixes some unlikely bugs and removes the temptation
of using ctype.h.  Although some uses were correct,
many weren't.
* lib-src/ebrowse.c: Include c-ctype.h, not ctype.h.
* lib-src/emacsclient.c: Include c-ctype.h, not ctype.h.
* lib-src/update-game-score.c: Include c-ctype.h, not ctype.h.
All uses changed.
This commit is contained in:
Paul Eggert 2024-09-17 16:54:17 -07:00
parent e0b027d121
commit 865b54e2ac
3 changed files with 10 additions and 10 deletions

View File

@ -22,11 +22,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <getopt.h>
#include <attribute.h>
#include <c-ctype.h>
#include <flexmember.h>
#include <min-max.h>
#include <unlocked-io.h>
@ -1875,7 +1875,7 @@ yylex (void)
int_suffixes:
/* Integer suffixes. */
while (isalpha (c))
while (c_isalpha (c))
GET (c);
UNGET ();
return CINT;
@ -1907,7 +1907,7 @@ yylex (void)
}
/* Optional type suffixes. */
while (isalpha (c))
while (c_isalpha (c))
GET (c);
UNGET ();
return CFLOAT;
@ -2158,7 +2158,7 @@ init_scanner (void)
/* Set up character class vectors. */
for (i = 0; i < sizeof is_ident; ++i)
{
if (i == '_' || isalnum (i))
if (i == '_' || c_isalnum (i))
is_ident[i] = 1;
if (i >= '0' && i <= '9')
@ -2946,7 +2946,7 @@ operator_name (int *sc)
MATCH ();
/* If this is a simple operator like `+', stop now. */
if (!isalpha ((unsigned char) *s) && *s != '(' && *s != '[')
if (!c_isalpha (*s) && *s != '(' && *s != '[')
break;
++tokens_matched;

View File

@ -68,7 +68,6 @@ char *w32_getenv (const char *);
#define DEFAULT_TIMEOUT (30)
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
@ -83,6 +82,7 @@ char *w32_getenv (const char *);
#include <unistd.h>
#include <attribute.h>
#include <c-ctype.h>
#include <filename.h>
#include <intprops.h>
#include <min-max.h>
@ -2124,7 +2124,7 @@ main (int argc, char **argv)
unsigned char c;
do
c = *++p;
while (isdigit (c) || c == ':');
while (c_isdigit (c) || c == ':');
if (c == 0)
{
@ -2136,7 +2136,7 @@ main (int argc, char **argv)
}
#ifdef WINDOWSNT
else if (! IS_ABSOLUTE_FILE_NAME (argv[i])
&& (isalpha (argv[i][0]) && argv[i][1] == ':'))
&& (c_isalpha (argv[i][0]) && argv[i][1] == ':'))
/* Windows can have a different default directory for each
drive, so the cwd passed via "-dir" is not sufficient
to account for that.

View File

@ -41,11 +41,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <time.h>
#include <pwd.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <getopt.h>
#include <c-ctype.h>
#include <unlocked-io.h>
#ifdef WINDOWSNT
@ -143,7 +143,7 @@ normalize_integer (char *num)
{
bool neg;
char *p;
while (*num != '\n' && isspace (*num))
while (*num != '\n' && c_isspace (*num))
num++;
neg = *num == '-';
num += neg || *num == '-';