diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2000-12-08 03:00:26 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-12-08 03:00:26 +0000 |
commit | f6bbde28c477c7c5cb4d6c4d3e561b2d429afccf (patch) | |
tree | b03b87c4d027ec11c1f46fa69792393daa187ec4 /gcc/f | |
parent | f3588f1aadd8d52686c3f18f7a07744a33bb4f6d (diff) | |
download | gcc-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/f')
-rw-r--r-- | gcc/f/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/f/Make-lang.in | 4 | ||||
-rw-r--r-- | gcc/f/bad.c | 2 | ||||
-rw-r--r-- | gcc/f/com.c | 2 | ||||
-rw-r--r-- | gcc/f/fini.c | 12 | ||||
-rw-r--r-- | gcc/f/intrin.c | 4 | ||||
-rw-r--r-- | gcc/f/src.c | 46 | ||||
-rw-r--r-- | gcc/f/src.h | 4 |
8 files changed, 43 insertions, 62 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 9ff8f3a..3087b75 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,16 @@ +2000-12-07 Zack Weinberg <zack@wolery.stanford.edu> + + * 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. + 2000-11-28 Richard Henderson <rth@redhat.com> * com.c (ffecom_member_phase2_): Set TREE_USED on the debugging decl. @@ -35,11 +48,11 @@ Thu Nov 23 02:18:57 2000 J"orn Rennecke <amylaar@redhat.com> Sun Nov 19 17:29:22 2000 Matthias Klose <doko@marvin.itso-berlin.de> - * g77.texi (Floating-point precision): Adjust example - to work with glibc (>= 2.1). + * g77.texi (Floating-point precision): Adjust example + to work with glibc (>= 2.1). + +Sat Nov 18 13:54:49 2000 Matthias Klose <doko@cs.tu-berlin.de> -Sat Nov 18 13:54:49 2000 Matthias Klose <doko@cs.tu-berlin.de> - * g77.texi (Floating-point Exception Handling): Adjust example to work with glibc (>= 2.1). @@ -149,7 +162,7 @@ Thu Oct 12 22:28:51 2000 Mark Mitchell <mark@codesourcery.com> (ffeste_R842): Likewise. (ffeste_R843): Likewise. (ffeste_R1001): Likewise. - + 2000-10-05 Richard Henderson <rth@cygnus.com> * com.c (finish_function): Don't init can_reach_end. @@ -188,9 +201,9 @@ Sun Oct 1 11:43:44 2000 Mark Mitchell <mark@codesourcery.com> * intrin.def: Adjust DEFIMP definition of LOG10, (float) MOD. 2000-08-21 Nix <nix@esperi.demon.co.uk> - - * lang-specs.h: Do not process -o or run the assembler if - -fsyntax-only. Use %j instead of /dev/null. + + * lang-specs.h: Do not process -o or run the assembler if + -fsyntax-only. Use %j instead of /dev/null. 2000-08-21 Jakub Jelinek <jakub@redhat.com> @@ -210,7 +223,7 @@ Sun Oct 1 11:43:44 2000 Mark Mitchell <mark@codesourcery.com> * news.texi: Ditto. 2000-08-11 G. Helffrich <george@gly.bris.ac.uk> - Toon Moene <toon@moene.indiv.nluug.nl> + Toon Moene <toon@moene.indiv.nluug.nl> * com.c (ffecom_transform_equiv_): Make EQUIVALENCEs addressable so that debug info can be attached to their storage. diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in index 73f149f..6af0536 100644 --- a/gcc/f/Make-lang.in +++ b/gcc/f/Make-lang.in @@ -137,9 +137,9 @@ f/str-op.h f/str-op.j: f/fini$(build_exeext) f/str-op.fin f/str-ot.h f/str-ot.j: f/fini$(build_exeext) f/str-ot.fin ./f/fini$(build_exeext) $(srcdir)/f/str-ot.fin f/str-ot.j f/str-ot.h -f/fini$(build_exeext): f/fini.o f/proj-h.o +f/fini$(build_exeext): f/fini.o f/proj-h.o safe-ctype.o $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini$(build_exeext) \ - f/fini.o f/proj-h.o + f/fini.o f/proj-h.o safe-ctype.o f/fini.o: $(HOST_CC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \ diff --git a/gcc/f/bad.c b/gcc/f/bad.c index 6f25246..f34253f 100644 --- a/gcc/f/bad.c +++ b/gcc/f/bad.c @@ -457,7 +457,7 @@ ffebad_finish () if (ffebad_places_ == 0) { /* Didn't output "warning:" string, capitalize it for message. */ - if ((s[0] != '\0') && ISALPHA (s[0]) && ISLOWER (s[0])) + if (s[0] != '\0') { char c; diff --git a/gcc/f/com.c b/gcc/f/com.c index fbeb74b..82d99d8 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -1840,7 +1840,7 @@ ffecom_build_f2c_string_ (int i, const char *s) tmp = &space[0]; for (p = s, q = tmp; *p != '\0'; ++p, ++q) - *q = ffesrc_toupper (*p); + *q = TOUPPER (*p); *q = '\0'; t = build_string (i, tmp); diff --git a/gcc/f/fini.c b/gcc/f/fini.c index f685df1..0fabf37 100644 --- a/gcc/f/fini.c +++ b/gcc/f/fini.c @@ -381,15 +381,9 @@ main (int argc, char **argv) for (i = 0; i < newname->namelen; ++i) { cc = buf[i]; - if (ISALPHA (cc)) - { - newname->name_uc[i] = TOUPPER (cc); - newname->name_lc[i] = TOLOWER (cc); - newname->name_ic[i] = cc; - } - else - newname->name_uc[i] = newname->name_lc[i] = newname->name_ic[i] - = cc; + newname->name_uc[i] = TOUPPER (cc); + newname->name_lc[i] = TOLOWER (cc); + newname->name_ic[i] = cc; } newname->name_uc[i] = newname->name_lc[i] = newname->name_ic[i] = '\0'; diff --git a/gcc/f/intrin.c b/gcc/f/intrin.c index 2d78841..0bc6d0e 100644 --- a/gcc/f/intrin.c +++ b/gcc/f/intrin.c @@ -1581,10 +1581,6 @@ ffeintrin_init_0 () p3 = ffeintrin_names_[i].name_ic; for (; *p1 != '\0' && *p2 != '\0' && *p3 != '\0'; ++p1, ++p2, ++p3) { - if (! IN_CTYPE_DOMAIN (*p1) - || ! IN_CTYPE_DOMAIN (*p2) - || ! IN_CTYPE_DOMAIN (*p3)) - break; if ((ISDIGIT (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3)) continue; if (! ISUPPER ((unsigned char)*p1) || ! ISLOWER ((unsigned char)*p2) diff --git a/gcc/f/src.c b/gcc/f/src.c index e434fbf..28c55cc 100644 --- a/gcc/f/src.c +++ b/gcc/f/src.c @@ -32,16 +32,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "src.h" #include "top.h" -/* This array does a toupper (), but any valid char type is valid as an - index and returns identity if not a lower-case character. */ - -char ffesrc_toupper_[256]; - -/* This array does a tolower (), but any valid char type is valid as an - index and returns identity if not an upper-case character. */ - -char ffesrc_tolower_[256]; - /* This array is set up so that, given a source-mapped character, the result of indexing into this array will match an upper-cased character depending on the source-mapped character's case and the established ffe_case_match() @@ -113,18 +103,10 @@ ffesrc_init_1 () ffesrc_char_match_noninit_[i] = i; ffesrc_char_source_[i] = i; ffesrc_char_internal_init_[i] = i; - ffesrc_toupper_[i] = i; - ffesrc_tolower_[i] = i; ffesrc_bad_symbol_init_[i] = FFEBAD; ffesrc_bad_symbol_noninit_[i] = FFEBAD; } - for (i = 'A'; i <= 'Z'; ++i) - ffesrc_tolower_[i] = TOLOWER (i); - - for (i = 'a'; i <= 'z'; ++i) - ffesrc_toupper_[i] = TOUPPER (i); - ffesrc_check_symbol_ = (ffe_case_symbol () != FFE_caseNONE); ffesrc_ok_match_init_upper_ = (ffe_case_match () != FFE_caseLOWER); @@ -230,8 +212,8 @@ ffesrc_strcmp_1ns2i (ffeCase mcase, const char *var, int len, for (; len > 0; --len, ++var, ++str_ic) { c = ffesrc_char_source (*var); /* Transform source. */ - c = ffesrc_toupper (c); /* Upcase source. */ - d = ffesrc_toupper (*str_ic); /* Upcase InitialCaps char. */ + c = TOUPPER (c); /* Upcase source. */ + d = TOUPPER (*str_ic); /* Upcase InitialCaps char. */ if (c != d) { if ((d != '\0') && (c < d)) @@ -246,7 +228,7 @@ ffesrc_strcmp_1ns2i (ffeCase mcase, const char *var, int len, for (; len > 0; --len, ++var, ++str_ic) { c = ffesrc_char_source (*var); /* Transform source. */ - d = ffesrc_toupper (*str_ic); /* Transform InitialCaps char. */ + d = TOUPPER (*str_ic); /* Transform InitialCaps char. */ if (c != d) { if ((d != '\0') && (c < d)) @@ -261,7 +243,7 @@ ffesrc_strcmp_1ns2i (ffeCase mcase, const char *var, int len, for (; len > 0; --len, ++var, ++str_ic) { c = ffesrc_char_source (*var); /* Transform source. */ - d = ffesrc_tolower (*str_ic); /* Transform InitialCaps char. */ + d = TOLOWER (*str_ic); /* Transform InitialCaps char. */ if (c != d) { if ((d != '\0') && (c < d)) @@ -279,14 +261,14 @@ ffesrc_strcmp_1ns2i (ffeCase mcase, const char *var, int len, d = *str_ic; /* No transform of InitialCaps char. */ if (c != d) { - c = ffesrc_toupper (c); - d = ffesrc_toupper (d); + c = TOUPPER (c); + d = TOUPPER (d); while ((len > 0) && (c == d)) { /* Skip past equivalent (case-ins) chars. */ --len, ++var, ++str_ic; if (len > 0) - c = ffesrc_toupper (*var); - d = ffesrc_toupper (*str_ic); + c = TOUPPER (*var); + d = TOUPPER (*str_ic); } if ((d != '\0') && (c < d)) return -1; @@ -323,7 +305,7 @@ ffesrc_strcmp_2c (ffeCase mcase, const char *var, const char *str_uc, case FFE_caseNONE: for (; *var != '\0'; ++var, ++str_uc) { - c = ffesrc_toupper (*var); /* Upcase source. */ + c = TOUPPER (*var); /* Upcase source. */ if (c != *str_uc) { if ((*str_uc != '\0') && (c < *str_uc)) @@ -349,11 +331,11 @@ ffesrc_strcmp_2c (ffeCase mcase, const char *var, const char *str_uc, { if (*var != *str_ic) { - c = ffesrc_toupper (*var); + c = TOUPPER (*var); while ((c != '\0') && (c == *str_uc)) { /* Skip past equivalent (case-ins) chars. */ ++var, ++str_uc; - c = ffesrc_toupper (*var); + c = TOUPPER (*var); } if ((*str_uc != '\0') && (c < *str_uc)) return -1; @@ -393,7 +375,7 @@ ffesrc_strncmp_2c (ffeCase mcase, const char *var, const char *str_uc, case FFE_caseNONE: for (; len > 0; ++var, ++str_uc, --len) { - c = ffesrc_toupper (*var); /* Upcase source. */ + c = TOUPPER (*var); /* Upcase source. */ if (c != *str_uc) { if (c < *str_uc) @@ -417,12 +399,12 @@ ffesrc_strncmp_2c (ffeCase mcase, const char *var, const char *str_uc, { if (*var != *str_ic) { - c = ffesrc_toupper (*var); + c = TOUPPER (*var); while ((len > 0) && (c == *str_uc)) { /* Skip past equivalent (case-ins) chars. */ --len, ++var, ++str_uc; if (len > 0) - c = ffesrc_toupper (*var); + c = TOUPPER (*var); } if ((len > 0) && (c < *str_uc)) return -1; diff --git a/gcc/f/src.h b/gcc/f/src.h index 7ba03e0..666bd85 100644 --- a/gcc/f/src.h +++ b/gcc/f/src.h @@ -33,8 +33,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "bad.h" #include "top.h" -extern char ffesrc_toupper_[256]; -extern char ffesrc_tolower_[256]; extern char ffesrc_char_match_init_[256]; extern char ffesrc_char_match_noninit_[256]; extern char ffesrc_char_source_[256]; @@ -136,8 +134,6 @@ int ffesrc_strncmp_2c (ffeCase mcase, const char *var, const char *str_uc, #define ffesrc_terminate_2() #define ffesrc_terminate_3() #define ffesrc_terminate_4() -#define ffesrc_toupper(c) (ffesrc_toupper_[(unsigned int) (c)]) -#define ffesrc_tolower(c) (ffesrc_tolower_[(unsigned int) (c)]) /* End of #include file. */ |