diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 18:28:32 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 18:28:32 +0000 |
commit | e0be6f0268ff1bed5daca7b65cd35b62d3585bba (patch) | |
tree | d926f63d76077ffa46dd7c352606226f8d001250 /gcc/fortran/decl.c | |
parent | 4e82296cd936496b8dd3f53c52a1817a27e0f9a5 (diff) | |
download | gcc-e0be6f0268ff1bed5daca7b65cd35b62d3585bba.tar.gz |
* openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and
gfc_peek_ascii_char.
* decl.c (gfc_match_kind_spec, gfc_match_type_spec,
gfc_match_implicit_none, match_implicit_range, gfc_match_implicit,
match_string_p, match_attr_spec, gfc_match_suffix,
match_procedure_decl, gfc_match_entry, gfc_match_subroutine):
Likewise.
* gfortran.h (gfc_char_t): New type.
(gfc_linebuf): Make line member a gfc_char_t.
(locus): Make nextc member a gfc_char_t.
(gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte,
gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char,
gfc_peek_ascii_char, gfc_check_digit): New prototypes.
* error.c (print_wide_char): New function.
(show_locus): Use print_wide_char and gfc_wide_strlen.
* io.c (next_char): Use gfc_char_t type.
(match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char.
* match.c (gfc_match_parens, gfc_match_eos,
gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C,
gfc_match_intrinsic_op, gfc_match_char, gfc_match_return,
gfc_match_common): Likewise.
* match.h (gfc_match_special_char): Change prototype.
* parse.c (decode_specification_statement, decode_statement,
decode_omp_directive, next_free, next_fixed): Use
gfc_peek_ascii_char and gfc_next_ascii_char.
* primary.c (gfc_check_digit): Change name.
(match_digits, match_hollerith_constant, match_boz_constant,
match_real_constant, next_string_char, match_charkind_name,
match_string_constant, match_logical_constant_string,
match_complex_constant, match_actual_arg, match_varspec,
gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and
gfc_next_ascii_char.
* scanner.c (gfc_wide_fits_in_byte, wide_is_ascii,
gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit,
gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy,
wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp,
gfc_next_ascii_char, gfc_peek_ascii_char):
New functions.
(next_char, gfc_define_undef_line, skip_free_comments,
gfc_next_char_literal, gfc_next_char, gfc_peek_char,
gfc_error_recovery, load_line, preprocessor_line, include_line,
load_file, gfc_read_orig_filename): Use gfc_char_t for source
characters and the {gfc_,}wide_* functions to manipulate wide
strings.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134992 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index f52c2f1ec8f..6b462f97bb6 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1940,7 +1940,8 @@ kind_expr: } gfc_gobble_whitespace (); - if ((c = gfc_next_char ()) != ')' && (ts->type != BT_CHARACTER || c != ',')) + if ((c = gfc_next_ascii_char ()) != ')' + && (ts->type != BT_CHARACTER || c != ',')) { if (ts->type == BT_CHARACTER) gfc_error ("Missing right parenthesis or comma at %C"); @@ -2213,7 +2214,7 @@ gfc_match_type_spec (gfc_typespec *ts, int implicit_flag) char name[GFC_MAX_SYMBOL_LEN + 1]; gfc_symbol *sym; match m; - int c; + char c; bool seen_deferred_kind; /* A belt and braces check that the typespec is correctly being treated @@ -2360,7 +2361,7 @@ get_kind: if (gfc_current_form == FORM_FREE) { - c = gfc_peek_char(); + c = gfc_peek_ascii_char(); if (!gfc_is_whitespace(c) && c != '*' && c != '(' && c != ':' && c != ',') return MATCH_NO; @@ -2400,13 +2401,14 @@ gfc_match_implicit_none (void) static match match_implicit_range (void) { - int c, c1, c2, inner; + char c, c1, c2; + int inner; locus cur_loc; cur_loc = gfc_current_locus; gfc_gobble_whitespace (); - c = gfc_next_char (); + c = gfc_next_ascii_char (); if (c != '(') { gfc_error ("Missing character range in IMPLICIT at %C"); @@ -2417,12 +2419,12 @@ match_implicit_range (void) while (inner) { gfc_gobble_whitespace (); - c1 = gfc_next_char (); + c1 = gfc_next_ascii_char (); if (!ISALPHA (c1)) goto bad; gfc_gobble_whitespace (); - c = gfc_next_char (); + c = gfc_next_ascii_char (); switch (c) { @@ -2435,12 +2437,12 @@ match_implicit_range (void) case '-': gfc_gobble_whitespace (); - c2 = gfc_next_char (); + c2 = gfc_next_ascii_char (); if (!ISALPHA (c2)) goto bad; gfc_gobble_whitespace (); - c = gfc_next_char (); + c = gfc_next_ascii_char (); if ((c != ',') && (c != ')')) goto bad; @@ -2503,7 +2505,7 @@ gfc_match_implicit (void) { gfc_typespec ts; locus cur_loc; - int c; + char c; match m; gfc_clear_ts (&ts); @@ -2534,7 +2536,7 @@ gfc_match_implicit (void) { /* We may have <TYPE> (<RANGE>). */ gfc_gobble_whitespace (); - c = gfc_next_char (); + c = gfc_next_ascii_char (); if ((c == '\n') || (c == ',')) { /* Check for CHARACTER with no length parameter. */ @@ -2584,7 +2586,7 @@ gfc_match_implicit (void) goto syntax; gfc_gobble_whitespace (); - c = gfc_next_char (); + c = gfc_next_ascii_char (); if ((c != '\n') && (c != ',')) goto syntax; @@ -2713,7 +2715,7 @@ match_string_p (const char *target) const char *p; for (p = target; *p; p++) - if (gfc_next_char () != *p) + if ((char) gfc_next_ascii_char () != *p) return false; return true; } @@ -2765,22 +2767,22 @@ match_attr_spec (void) for (;;) { - int ch; + char ch; d = DECL_NONE; gfc_gobble_whitespace (); - ch = gfc_next_char (); + ch = gfc_next_ascii_char (); if (ch == ':') { /* This is the successful exit condition for the loop. */ - if (gfc_next_char () == ':') + if (gfc_next_ascii_char () == ':') break; } else if (ch == ',') { gfc_gobble_whitespace (); - switch (gfc_peek_char ()) + switch (gfc_peek_ascii_char ()) { case 'a': if (match_string_p ("allocatable")) @@ -2809,7 +2811,7 @@ match_attr_spec (void) case 'i': if (match_string_p ("int")) { - ch = gfc_next_char (); + ch = gfc_next_ascii_char (); if (ch == 'e') { if (match_string_p ("nt")) @@ -2841,8 +2843,8 @@ match_attr_spec (void) break; case 'p': - gfc_next_char (); - switch (gfc_next_char ()) + gfc_next_ascii_char (); + switch (gfc_next_ascii_char ()) { case 'a': if (match_string_p ("rameter")) @@ -2861,7 +2863,7 @@ match_attr_spec (void) break; case 'r': - ch = gfc_next_char (); + ch = gfc_next_ascii_char (); if (ch == 'i') { if (match_string_p ("vate")) @@ -2901,8 +2903,8 @@ match_attr_spec (void) break; case 'v': - gfc_next_char (); - ch = gfc_next_char (); + gfc_next_ascii_char (); + ch = gfc_next_ascii_char (); if (ch == 'a') { if (match_string_p ("lue")) @@ -3938,7 +3940,7 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result) match is_bind_c; /* Found bind(c). */ match is_result; /* Found result clause. */ match found_match; /* Status of whether we've found a good match. */ - int peek_char; /* Character we're going to peek at. */ + char peek_char; /* Character we're going to peek at. */ bool allow_binding_name; /* Initialize to having found nothing. */ @@ -3948,7 +3950,7 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result) /* Get the next char to narrow between result and bind(c). */ gfc_gobble_whitespace (); - peek_char = gfc_peek_char (); + peek_char = gfc_peek_ascii_char (); /* C binding names are not allowed for internal procedures. */ if (gfc_current_state () == COMP_CONTAINS @@ -4037,7 +4039,7 @@ match_procedure_decl (void) /* Get the type spec. for the procedure interface. */ old_loc = gfc_current_locus; m = gfc_match_type_spec (¤t_ts, 0); - if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_char () == ')')) + if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_ascii_char () == ')')) goto got_ts; if (m == MATCH_ERROR) @@ -4530,7 +4532,7 @@ gfc_match_entry (void) /* Check what next non-whitespace character is so we can tell if there is the required parens if we have a BIND(C). */ gfc_gobble_whitespace (); - peek_char = gfc_peek_char (); + peek_char = gfc_peek_ascii_char (); if (state == COMP_SUBROUTINE) { @@ -4686,7 +4688,7 @@ gfc_match_subroutine (void) /* Check what next non-whitespace character is so we can tell if there is the required parens if we have a BIND(C). */ gfc_gobble_whitespace (); - peek_char = gfc_peek_char (); + peek_char = gfc_peek_ascii_char (); if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE) return MATCH_ERROR; @@ -5486,7 +5488,7 @@ match gfc_match_pointer (void) { gfc_gobble_whitespace (); - if (gfc_peek_char () == '(') + if (gfc_peek_ascii_char () == '(') { if (!gfc_option.flag_cray_pointer) { |