aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-12-08 03:00:26 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-12-08 03:00:26 +0000
commitf6bbde28c477c7c5cb4d6c4d3e561b2d429afccf (patch)
treeb03b87c4d027ec11c1f46fa69792393daa187ec4 /gcc/config
parentf3588f1aadd8d52686c3f18f7a07744a33bb4f6d (diff)
downloadgcc-f6bbde28c477c7c5cb4d6c4d3e561b2d429afccf.zip
gcc-f6bbde28c477c7c5cb4d6c4d3e561b2d429afccf.tar.gz
gcc-f6bbde28c477c7c5cb4d6c4d3e561b2d429afccf.tar.bz2
safe-ctype.h: New file.
include: * safe-ctype.h: New file. libiberty: * safe-ctype.c: New file. * Makefile.in (CFILES): Add safe-ctype.c. (REQUIRED_OFILES): Add safe-ctype.o. * argv.c: Define ISBLANK and use it, not isspace. * basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c, strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h. Use uppercase ctype macros. Don't test ISUPPER(c)/ISLOWER(c) before calling TOLOWER(c)/TOUPPER(c). gcc: * Makefile.in (HOST_RTL): Add safe-ctype.o. (safe-ctype.o): New rule. * system.h: Include safe-ctype.h, not ctype.h. No need to wrap ctype macros. * cpphash.h: Zap IStable and related macros. Define is_* in terms of safe-ctype.h macros. * cppinit.c: Delete the IStable and all related code. * tradcpp.c: Delete is_idchar, is_idstart, is_hor_space, and is_space arrays. Delete initialize_char_syntax. Change all references to the above arrays to use macros instead. * tradcpp.h: Define is_idchar, is_idstart, is_space, and is_nvspace in terms of safe_ctype.h's macros. * tradcif.y: is_idchar, is_idstart are macros not arrays. * config/i370/i370.c, config/winnt/dirent.c, config/winnt/fixinc-nt.c, config/winnt/ld.c: Use uppercase ctype macros. If we included ctype.h, include safe-ctype.h instead. * fixinc/fixfixes.c: Use uppercase ctype macros. Don't test ISLOWER(c) before calling TOUPPER(c). * fixinc/fixincl.c (extract_quoted_files): Simplify out some gunk. * fixinc/gnu-regex.c: Include safe-ctype.h, not ctype.h. No need to wrap ctype macros. Don't test ISUPPER(x) before calling TOLOWER(x). gcc/ch: * lex.c: Don't bother checking whether ISUPPER(c) before calling TOLOWER(c). Don't bother checking whether isascii(c) before testing ISSPACE(c); ISSPACE(c) includes '\n'. gcc/f: * Make-lang.in: Link f/fini with safe-ctype.o. * bad.c: Don't test ISUPPER(c) || ISLOWER(c) before calling TOUPPER(c). * com.c: Use TOUPPER, not ffesrc_toupper. * fini.c: Don't test ISALPHA(c) before calling TOUPPER(c)/TOLOWER(c). * intrin.c: Don't test IN_CTYPE_DOMAIN(c). * src.c: Delete ffesrc_toupper_ and ffesrc_tolower_ and their initializing code; use TOUPPER and TOLOWER instead of ffesrc_toupper and ffesrc_tolower. * src.h: Don't declare ffesrc_toupper_ or ffesrc_tolower_. Don't define ffesrc_toupper or ffesrc_tolower. gcc/java: * jvgenmain.c: Use ISPRINT not isascii. From-SVN: r38124
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i370/i370.c14
-rw-r--r--gcc/config/winnt/dirent.c6
-rw-r--r--gcc/config/winnt/fixinc-nt.c2
-rw-r--r--gcc/config/winnt/ld.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index 73a7880..2db1a01 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -906,11 +906,11 @@ mvs_need_alias (realname)
return 1;
if (strchr (realname, '_') != 0)
return 1;
- if (isupper (realname[0]))
+ if (ISUPPER (realname[0]))
{
for (i = 1; i < j; i++)
{
- if (islower (realname[i]))
+ if (ISLOWER (realname[i]))
return 1;
}
}
@@ -918,7 +918,7 @@ mvs_need_alias (realname)
{
for (i = 1; i < j; i++)
{
- if (isupper (realname[i]))
+ if (ISUPPER (realname[i]))
return 1;
}
}
@@ -951,9 +951,9 @@ mvs_get_alias (realname, aliasname)
c1 = realname[0];
c2 = realname[1];
- if (islower (c1)) c1 = toupper (c1);
+ if (ISLOWER (c1)) c1 = TOUPPER (c1);
else if (c1 == '_') c1 = 'A';
- if (islower (c2)) c2 = toupper (c2);
+ if (ISLOWER (c2)) c2 = TOUPPER (c2);
else if (c2 == '_' || c2 == '\0') c2 = '#';
sprintf (aliasname, "%c%c%06d", c1, c2, mvs_hash_alias (realname));
@@ -998,9 +998,9 @@ mvs_check_alias (realname, aliasname)
c1 = realname[0];
c2 = realname[1];
- if (islower (c1)) c1 = toupper (c1);
+ if (ISLOWER (c1)) c1 = TOUPPER (c1);
else if (c1 == '_') c1 = 'A';
- if (islower (c2)) c2 = toupper (c2);
+ if (ISLOWER (c2)) c2 = TOUPPER (c2);
else if (c2 == '_' || c2 == '\0') c2 = '#';
sprintf (aliasname, "%c%c%06d", c1, c2, mvs_hash_alias (realname));
diff --git a/gcc/config/winnt/dirent.c b/gcc/config/winnt/dirent.c
index 59f7dc1..f20e1f7 100644
--- a/gcc/config/winnt/dirent.c
+++ b/gcc/config/winnt/dirent.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <limits.h>
-#include <ctype.h>
+#include <safe-ctype.h>
#include <errno.h>
#include <dirent.h>
@@ -332,8 +332,8 @@ IsHPFSFileSystem (directory)
unsigned int nDrive;
char szCurDir [MAX_PATH];
- if (isalpha (directory[0]) && (directory[1] == ':'))
- nDrive = toupper (directory[0]) - '@';
+ if (ISALPHA (directory[0]) && (directory[1] == ':'))
+ nDrive = TOUPPER (directory[0]) - '@';
else
{
diff --git a/gcc/config/winnt/fixinc-nt.c b/gcc/config/winnt/fixinc-nt.c
index f49d6dd..f7e1a35 100644
--- a/gcc/config/winnt/fixinc-nt.c
+++ b/gcc/config/winnt/fixinc-nt.c
@@ -64,7 +64,7 @@ newname (olddirname)
char *newname = strdup (olddirname);
if ((strlen (newname) >= 2)
- && (isalpha (newname[0]) && newname[1] == ':'))
+ && (ISALPHA (newname[0]) && newname[1] == ':'))
newname [1] = '-';
else if ((strlen (newname) >= 1)
&& (newname [0] == '/' || newname [0] == '\\'))
diff --git a/gcc/config/winnt/ld.c b/gcc/config/winnt/ld.c
index 67d53e7..b02d1ed 100644
--- a/gcc/config/winnt/ld.c
+++ b/gcc/config/winnt/ld.c
@@ -86,7 +86,7 @@ locate_file (file_name, path_val)
/* Handle absolute pathnames */
if (file_name [0] == '/' || file_name [0] == DIR_SEPARATOR
- || isalpha (file_name [0]) && file_name [1] == ':')
+ || ISALPHA (file_name [0]) && file_name [1] == ':')
{
strncpy (buf, file_name, sizeof buf);
buf[sizeof buf - 1] = '\0';