Commit f3ad1f9c by Linas Vepstas Committed by Richard Henderson

Linas Vepstas <linas@linas.org>

        * c-common.c: Use ISGRAPH, ISLOWER, toupper.
        * c-lex.c, cccp.c, cexp.c, cexp.y, cppexp.c, dwarf2out.c, genattr.c,
        genattrtab.c, genemit.c, genextract.c, genpeep.c, tree.c: Likewise.
        * system.h (IN_CTYPE_DOMAIN): Define to 1 if HOST_EBCDIC.
        * defaults.h (TARGET_ESC): Add default.

From-SVN: r29192
parent a2b368b6
Tue Sep 7 23:46:35 1999 Linas Vepstas <linas@linas.org>
* c-common.c: Use ISGRAPH, ISLOWER, toupper.
* c-lex.c, cccp.c, cexp.c, cexp.y, cppexp.c, dwarf2out.c, genattr.c,
genattrtab.c, genemit.c, genextract.c, genpeep.c, tree.c: Likewise.
* system.h (IN_CTYPE_DOMAIN): Define to 1 if HOST_EBCDIC.
* defaults.h (TARGET_ESC): Add default.
Tue Sep 7 23:36:59 1999 Linas Vepstas <linas@linas.org> Tue Sep 7 23:36:59 1999 Linas Vepstas <linas@linas.org>
* configure.in: add i370-*-openedition, i370-*-mvs and * configure.in: add i370-*-openedition, i370-*-mvs and
......
...@@ -1795,7 +1795,7 @@ check_format_info (info, params) ...@@ -1795,7 +1795,7 @@ check_format_info (info, params)
++fci; ++fci;
if (fci->format_chars == 0) if (fci->format_chars == 0)
{ {
if (format_char >= 040 && format_char < 0177) if (ISGRAPH(format_char))
warning ("unknown conversion type character `%c' in format", warning ("unknown conversion type character `%c' in format",
format_char); format_char);
else else
......
...@@ -1015,7 +1015,7 @@ readescape (ignore_ptr) ...@@ -1015,7 +1015,7 @@ readescape (ignore_ptr)
case 'E': case 'E':
if (pedantic) if (pedantic)
pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c); pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
return 033; return TARGET_ESC;
case '?': case '?':
return c; return c;
...@@ -1053,7 +1053,7 @@ yyerror (msgid) ...@@ -1053,7 +1053,7 @@ yyerror (msgid)
error ("%s before string constant", string); error ("%s before string constant", string);
else if (token_buffer[0] == '\'') else if (token_buffer[0] == '\'')
error ("%s before character constant", string); error ("%s before character constant", string);
else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177) else if (!ISGRAPH(token_buffer[0]))
error ("%s before character 0%o", string, (unsigned char) token_buffer[0]); error ("%s before character 0%o", string, (unsigned char) token_buffer[0]);
else else
error ("%s before `%s'", string, token_buffer); error ("%s before `%s'", string, token_buffer);
......
...@@ -34,7 +34,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -34,7 +34,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include <setjmp.h> #include <setjmp.h>
#include "tree.h" #include "tree.h"
#include "input.h" #include "input.h"
#include "c-lex.h" #include "c-lex.h"
......
...@@ -10073,9 +10073,9 @@ initialize_char_syntax () ...@@ -10073,9 +10073,9 @@ initialize_char_syntax ()
* refer to them. * refer to them.
*/ */
for (i = 'a'; i <= 'z'; i++) { for (i = 'a'; i <= 'z'; i++) {
is_idchar[i - 'a' + 'A'] = 1; is_idchar[toupper(i)] = 1;
is_idchar[i] = 1; is_idchar[i] = 1;
is_idstart[i - 'a' + 'A'] = 1; is_idstart[toupper(i)] = 1;
is_idstart[i] = 1; is_idstart[i] = 1;
} }
for (i = '0'; i <= '9'; i++) for (i = '0'; i <= '9'; i++)
......
...@@ -1769,7 +1769,7 @@ parse_escape (string_ptr, result_mask) ...@@ -1769,7 +1769,7 @@ parse_escape (string_ptr, result_mask)
case 'E': case 'E':
if (pedantic) if (pedantic)
pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c); pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
return 033; return TARGET_ESC;
case 'f': case 'f':
return TARGET_FF; return TARGET_FF;
case 'n': case 'n':
...@@ -2029,9 +2029,9 @@ initialize_random_junk () ...@@ -2029,9 +2029,9 @@ initialize_random_junk ()
* refer to them. * refer to them.
*/ */
for (i = 'a'; i <= 'z'; i++) { for (i = 'a'; i <= 'z'; i++) {
++is_idchar[i - 'a' + 'A']; ++is_idchar[toupper(i)];
++is_idchar[i]; ++is_idchar[i];
++is_idstart[i - 'a' + 'A']; ++is_idstart[toupper(i)];
++is_idstart[i]; ++is_idstart[i];
} }
for (i = '0'; i <= '9'; i++) for (i = '0'; i <= '9'; i++)
......
...@@ -853,7 +853,7 @@ parse_escape (string_ptr, result_mask) ...@@ -853,7 +853,7 @@ parse_escape (string_ptr, result_mask)
case 'E': case 'E':
if (pedantic) if (pedantic)
pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c); pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
return 033; return TARGET_ESC;
case 'f': case 'f':
return TARGET_FF; return TARGET_FF;
case 'n': case 'n':
...@@ -1113,9 +1113,9 @@ initialize_random_junk () ...@@ -1113,9 +1113,9 @@ initialize_random_junk ()
* refer to them. * refer to them.
*/ */
for (i = 'a'; i <= 'z'; i++) { for (i = 'a'; i <= 'z'; i++) {
++is_idchar[i - 'a' + 'A']; ++is_idchar[toupper(i)];
++is_idchar[i]; ++is_idchar[i];
++is_idstart[i - 'a' + 'A']; ++is_idstart[toupper(i)];
++is_idstart[i]; ++is_idstart[i];
} }
for (i = '0'; i <= '9'; i++) for (i = '0'; i <= '9'; i++)
......
...@@ -532,7 +532,7 @@ cpp_parse_escape (pfile, string_ptr, result_mask) ...@@ -532,7 +532,7 @@ cpp_parse_escape (pfile, string_ptr, result_mask)
case 'E': case 'E':
if (CPP_OPTIONS (pfile)->pedantic) if (CPP_OPTIONS (pfile)->pedantic)
cpp_pedwarn (pfile, "non-ANSI-standard escape sequence, `\\%c'", c); cpp_pedwarn (pfile, "non-ANSI-standard escape sequence, `\\%c'", c);
return 033; return TARGET_ESC;
case 'f': case 'f':
return TARGET_FF; return TARGET_FF;
case 'n': case 'n':
......
...@@ -169,3 +169,8 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \ ...@@ -169,3 +169,8 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \
#ifndef PROMOTE_PROTOTYPES #ifndef PROMOTE_PROTOTYPES
#define PROMOTE_PROTOTYPES 0 #define PROMOTE_PROTOTYPES 0
#endif #endif
/* Define a default escape character; its different for EBCDIC. */
#ifndef TARGET_ESC
#define TARGET_ESC 033
#endif
...@@ -480,7 +480,7 @@ static void dwarf2out_frame_debug_expr PROTO((rtx, char *)); ...@@ -480,7 +480,7 @@ static void dwarf2out_frame_debug_expr PROTO((rtx, char *));
register int c = p[i]; \ register int c = p[i]; \
if (c == '\"' || c == '\\') \ if (c == '\"' || c == '\\') \
putc ('\\', FILE); \ putc ('\\', FILE); \
if (c >= ' ' && c < 0177) \ if (ISPRINT(c)) \
putc (c, FILE); \ putc (c, FILE); \
else \ else \
{ \ { \
......
...@@ -87,8 +87,8 @@ write_upcase (str) ...@@ -87,8 +87,8 @@ write_upcase (str)
char *str; char *str;
{ {
for (; *str; str++) for (; *str; str++)
if (*str >= 'a' && *str <= 'z') if (ISLOWER(*str))
printf ("%c", *str - 'a' + 'A'); printf ("%c", toupper(*str));
else else
printf ("%c", *str); printf ("%c", *str);
} }
...@@ -120,8 +120,8 @@ gen_attr (attr) ...@@ -120,8 +120,8 @@ gen_attr (attr)
write_upcase (XSTR (attr, 0)); write_upcase (XSTR (attr, 0));
printf ("_"); printf ("_");
} }
else if (*p >= 'a' && *p <= 'z') else if (ISLOWER(*p))
printf ("%c", *p - 'a' + 'A'); printf ("%c", toupper(*p));
else else
printf ("%c", *p); printf ("%c", *p);
} }
......
...@@ -1357,8 +1357,8 @@ convert_const_symbol_ref (exp, attr) ...@@ -1357,8 +1357,8 @@ convert_const_symbol_ref (exp, attr)
strcat (p, "_"); strcat (p, "_");
strcat (p, XSTR (av->value, 0)); strcat (p, XSTR (av->value, 0));
for (; *p != '\0'; p++) for (; *p != '\0'; p++)
if (*p >= 'a' && *p <= 'z') if (ISLOWER(*p))
*p -= 'a' - 'A'; *p = toupper (*p);
value = attr_rtx (SYMBOL_REF, string); value = attr_rtx (SYMBOL_REF, string);
RTX_UNCHANGING_P (value) = 1; RTX_UNCHANGING_P (value) = 1;
...@@ -2841,8 +2841,8 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2841,8 +2841,8 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
strcat (string, "_"); strcat (string, "_");
strcat (string, XSTR (exp, 1)); strcat (string, XSTR (exp, 1));
for (p = string; *p ; p++) for (p = string; *p ; p++)
if (*p >= 'a' && *p <= 'z') if (ISLOWER(*p))
*p -= 'a' - 'A'; *p = toupper (*p);
newexp = attr_rtx (EQ, value, newexp = attr_rtx (EQ, value,
attr_rtx (SYMBOL_REF, attr_rtx (SYMBOL_REF,
...@@ -5357,10 +5357,10 @@ write_upcase (str) ...@@ -5357,10 +5357,10 @@ write_upcase (str)
char *str; char *str;
{ {
while (*str) while (*str)
if (*str < 'a' || *str > 'z') if (ISLOWER(*str))
printf ("%c", *str++); printf ("%c", toupper(*str++));
else else
printf ("%c", *str++ - 'a' + 'A'); printf ("%c", *str++);
} }
static void static void
......
...@@ -139,8 +139,8 @@ print_code (code) ...@@ -139,8 +139,8 @@ print_code (code)
register const char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (ISLOWER(*p1))
putchar (*p1 + 'A' - 'a'); putchar (toupper(*p1));
else else
putchar (*p1); putchar (*p1);
} }
......
...@@ -321,9 +321,9 @@ print_path (path) ...@@ -321,9 +321,9 @@ print_path (path)
for (i = len - 1; i >=0 ; i--) for (i = len - 1; i >=0 ; i--)
{ {
if (path[i] >= 'a' && path[i] <= 'z') if (ISLOWER(path[i]))
printf ("XVECEXP ("); printf ("XVECEXP (");
else if (path[i] >= '0' && path[i] <= '9') else if (ISDIGIT(path[i]))
printf ("XEXP ("); printf ("XEXP (");
else else
abort (); abort ();
...@@ -333,9 +333,9 @@ print_path (path) ...@@ -333,9 +333,9 @@ print_path (path)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
if (path[i] >= 'a' && path[i] <= 'z') if (ISLOWER(path[i]))
printf (", 0, %d)", path[i] - 'a'); printf (", 0, %d)", path[i] - 'a');
else if (path[i] >= '0' && path[i] <= '9') else if (ISDIGIT(path[i]))
printf (", %d)", path[i] - '0'); printf (", %d)", path[i] - '0');
else else
abort (); abort ();
......
...@@ -374,8 +374,8 @@ print_code (code) ...@@ -374,8 +374,8 @@ print_code (code)
register const char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (ISLOWER(*p1))
putchar (*p1 + 'A' - 'a'); putchar (toupper(*p1));
else else
putchar (*p1); putchar (*p1);
} }
......
...@@ -1640,8 +1640,8 @@ print_code (code) ...@@ -1640,8 +1640,8 @@ print_code (code)
register const char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (ISLOWER(*p1))
putchar (*p1 + 'A' - 'a'); putchar (toupper(*p1));
else else
putchar (*p1); putchar (*p1);
} }
......
...@@ -83,7 +83,7 @@ extern int fputs_unlocked PROTO ((const char *, FILE *)); ...@@ -83,7 +83,7 @@ extern int fputs_unlocked PROTO ((const char *, FILE *));
character >= 128 which gets sign-extended to a negative value. character >= 128 which gets sign-extended to a negative value.
The macro ISUPPER protects against this as well." */ The macro ISUPPER protects against this as well." */
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) || defined(HOST_EBCDIC)
# define IN_CTYPE_DOMAIN(c) 1 # define IN_CTYPE_DOMAIN(c) 1
#else #else
# define IN_CTYPE_DOMAIN(c) isascii(c) # define IN_CTYPE_DOMAIN(c) isascii(c)
...@@ -121,7 +121,6 @@ extern int fputs_unlocked PROTO ((const char *, FILE *)); ...@@ -121,7 +121,6 @@ extern int fputs_unlocked PROTO ((const char *, FILE *));
host does not conform to Posix. */ host does not conform to Posix. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
......
...@@ -4878,7 +4878,7 @@ get_file_function_name_long (type) ...@@ -4878,7 +4878,7 @@ get_file_function_name_long (type)
if (p != first_global_object_name) if (p != first_global_object_name)
{ {
for (p = buf+11; *p; p++) for (p = buf+11; *p; p++)
if (! ((*p >= '0' && *p <= '9') if (! ( ISDIGIT(*p)
#if 0 /* we always want labels, which are valid C++ identifiers (+ `$') */ #if 0 /* we always want labels, which are valid C++ identifiers (+ `$') */
#ifndef ASM_IDENTIFY_GCC /* this is required if `.' is invalid -- k. raeburn */ #ifndef ASM_IDENTIFY_GCC /* this is required if `.' is invalid -- k. raeburn */
|| *p == '.' || *p == '.'
...@@ -4890,8 +4890,8 @@ get_file_function_name_long (type) ...@@ -4890,8 +4890,8 @@ get_file_function_name_long (type)
#ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */ #ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */
|| *p == '.' || *p == '.'
#endif #endif
|| (*p >= 'A' && *p <= 'Z') || ISUPPER(*p)
|| (*p >= 'a' && *p <= 'z'))) || ISLOWER(*p)))
*p = '_'; *p = '_';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment