aboutsummaryrefslogtreecommitdiff
path: root/gcc/f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/f')
-rw-r--r--gcc/f/ChangeLog12
-rw-r--r--gcc/f/bad.c2
-rw-r--r--gcc/f/implic.c2
-rw-r--r--gcc/f/intdoc.c21
-rw-r--r--gcc/f/intrin.c11
-rw-r--r--gcc/f/lex.c14
-rw-r--r--gcc/f/lex.h3
-rw-r--r--gcc/f/target.c2
8 files changed, 32 insertions, 35 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 14fb6c1..4e1335a 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,15 @@
+Sun Oct 21 17:28:17 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
+ calls into fewer ones.
+ * implic.c (ffeimplic_lookup_): Likewise.
+ * intdoc.c (dumpimp): Likewise.
+ * intrin.c (ffeintrin_init_0): Likewise.
+ * lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
+ Likewise.
+ * lex.h (ffelex_is_firstnamechar): Likewise.
+ * target.c (ffetarget_integerhex): Likewise.
+
2001-10-21 Craig Prescott <prescott@phys.ufl.edu>
* target.h (FFETARGET_32bit_longs): Don't define
diff --git a/gcc/f/bad.c b/gcc/f/bad.c
index 67eade0..d258648 100644
--- a/gcc/f/bad.c
+++ b/gcc/f/bad.c
@@ -473,7 +473,7 @@ ffebad_finish ()
if (c == '%')
{
c = ffebad_message_[++i];
- if (ISALPHA (c) && ISUPPER (c))
+ if (ISUPPER (c))
{
index = c - 'A';
diff --git a/gcc/f/implic.c b/gcc/f/implic.c
index 7e0c61b..625742f 100644
--- a/gcc/f/implic.c
+++ b/gcc/f/implic.c
@@ -92,7 +92,7 @@ static ffeimplic_
ffeimplic_lookup_ (unsigned char c)
{
/* NOTE: This is definitely ASCII-specific!! */
- if (ISALPHA (c) || (c == '_'))
+ if (ISIDST (c))
return &ffeimplic_table_[c - 'A'];
return NULL;
}
diff --git a/gcc/f/intdoc.c b/gcc/f/intdoc.c
index 44ab7a8..84720a3 100644
--- a/gcc/f/intdoc.c
+++ b/gcc/f/intdoc.c
@@ -399,15 +399,12 @@ dumpimp (int menu, const char *name, const char *name_uc, size_t genno,
for (c = summaries[imp]; c[0] != '\0'; ++c)
{
- if ((c[0] == '@')
- && (c[1] >= '0')
- && (c[1] <= '9'))
+ if (c[0] == '@' && ISDIGIT (c[1]))
{
int argno = c[1] - '0';
c += 2;
- while ((c[0] >= '0')
- && (c[0] <= '9'))
+ while (ISDIGIT (c[0]))
{
argno = 10 * argno + (c[0] - '0');
++c;
@@ -495,8 +492,7 @@ external procedure.\n\
const char *arg_string;
const char *arg_info;
- if ((c[colon + 1] >= '0')
- && (c[colon + 1] <= '9'))
+ if (ISDIGIT (c[colon + 1]))
{
other_arg = c[colon + 1] - '0';
arg_string = argument_name_string (imp, other_arg);
@@ -548,9 +544,7 @@ this intrinsic is valid only when used as the argument to\n\
printf (", the exact type being wide enough to hold a pointer\n\
on the target system (typically @code{INTEGER(KIND=1)} or @code{INTEGER(KIND=4)}).\n\n");
#endif
- else if ((c[1] == '=')
- && (c[colon + 1] >= '0')
- && (c[colon + 1] <= '9'))
+ else if (c[1] == '=' && ISDIGIT (c[colon + 1]))
{
assert (other_arg >= 0);
@@ -1011,15 +1005,12 @@ Description:\n\
while (c[0] != '\0')
{
- if ((c[0] == '@')
- && (c[1] >= '0')
- && (c[1] <= '9'))
+ if (c[0] == '@' && ISDIGIT (c[1]))
{
int argno = c[1] - '0';
c += 2;
- while ((c[0] >= '0')
- && (c[0] <= '9'))
+ while (ISDIGIT (c[0]))
{
argno = 10 * argno + (c[0] - '0');
++c;
diff --git a/gcc/f/intrin.c b/gcc/f/intrin.c
index 6b89bfa..393706a 100644
--- a/gcc/f/intrin.c
+++ b/gcc/f/intrin.c
@@ -1628,8 +1628,7 @@ ffeintrin_init_0 ()
}
if ((c[colon + 1] != '-')
&& (c[colon + 1] != '*')
- && ((c[colon + 1] < '0')
- || (c[colon + 1] > '9')))
+ && (! ISDIGIT (c[colon + 1])))
{
fprintf (stderr, "%s: bad COL-spec\n",
ffeintrin_imps_[i].name);
@@ -1683,9 +1682,9 @@ ffeintrin_init_0 ()
}
if (c[3] == '[')
{
- if (((c[4] < '0') || (c[4] > '9'))
+ if ((! ISDIGIT (c[4]))
|| ((c[5] != ']')
- && (++c, (c[4] < '0') || (c[4] > '9')
+ && (++c, ! ISDIGIT (c[4])
|| (c[5] != ']'))))
{
fprintf (stderr, "%s: bad arg-len\n",
@@ -1696,9 +1695,9 @@ ffeintrin_init_0 ()
}
if (c[3] == '(')
{
- if (((c[4] < '0') || (c[4] > '9'))
+ if ((! ISDIGIT (c[4]))
|| ((c[5] != ')')
- && (++c, (c[4] < '0') || (c[4] > '9')
+ && (++c, ! ISDIGIT (c[4])
|| (c[5] != ')'))))
{
fprintf (stderr, "%s: bad arg-rank\n",
diff --git a/gcc/f/lex.c b/gcc/f/lex.c
index 9fef050..afdfd44 100644
--- a/gcc/f/lex.c
+++ b/gcc/f/lex.c
@@ -394,16 +394,14 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col)
return c;
case 2:
- if ((c >= 'a' && c <= 'f')
- || (c >= 'A' && c <= 'F')
- || (c >= '0' && c <= '9'))
+ if (ISXDIGIT (c))
{
code *= 16;
if (c >= 'a' && c <= 'f')
code += c - 'a' + 10;
if (c >= 'A' && c <= 'F')
code += c - 'A' + 10;
- if (c >= '0' && c <= '9')
+ if (ISDIGIT (c))
code += c - '0';
if (code != 0 || count != 0)
{
@@ -599,9 +597,7 @@ ffelex_cfebackslash_ (int *use_d, int *d, FILE *finput)
while (1)
{
c = getc (finput);
- if (!(c >= 'a' && c <= 'f')
- && !(c >= 'A' && c <= 'F')
- && !(c >= '0' && c <= '9'))
+ if (! ISXDIGIT (c))
{
*use_d = 1;
*d = c;
@@ -612,7 +608,7 @@ ffelex_cfebackslash_ (int *use_d, int *d, FILE *finput)
code += c - 'a' + 10;
if (c >= 'A' && c <= 'F')
code += c - 'A' + 10;
- if (c >= '0' && c <= '9')
+ if (ISDIGIT (c))
code += c - '0';
if (code != 0 || count != 0)
{
@@ -1079,7 +1075,7 @@ ffelex_hash_ (FILE *finput)
it and ignore it; otherwise, ignore the line, with an error
if the word isn't `pragma', `ident', `define', or `undef'. */
- if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+ if (ISALPHA(c))
{
if (c == 'p')
{
diff --git a/gcc/f/lex.h b/gcc/f/lex.h
index a28d0ac..04dfbed 100644
--- a/gcc/f/lex.h
+++ b/gcc/f/lex.h
@@ -171,8 +171,7 @@ ffelexToken ffelex_token_use (ffelexToken t);
#define ffelex_init_2()
#define ffelex_init_3()
#define ffelex_init_4()
-#define ffelex_is_firstnamechar(c) \
- (ISALPHA ((c)) || ((c) == '_'))
+#define ffelex_is_firstnamechar(c) ISIDST (c)
#define ffelex_terminate_0()
#define ffelex_terminate_1()
#define ffelex_terminate_2()
diff --git a/gcc/f/target.c b/gcc/f/target.c
index b52e37f..7bda032 100644
--- a/gcc/f/target.c
+++ b/gcc/f/target.c
@@ -1451,7 +1451,7 @@ ffetarget_integerhex (ffetargetIntegerDefault *val, ffelexToken integer)
c = c - 'A' + 10;
else if ((c >= 'a') && (c <= 'f'))
c = c - 'a' + 10;
- else if ((c >= '0') && (c <= '9'))
+ else if (ISDIGIT (c))
c -= '0';
else
{