aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2008-05-06 20:28:32 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-05-06 18:28:32 +0000
commit8fc541d3a5225284038d28ebe0b80cba2da3371b (patch)
treed926f63d76077ffa46dd7c352606226f8d001250 /gcc/fortran/io.c
parentd0b48c6701e4175beabeb6a9619646a7b16f2698 (diff)
downloadgcc-8fc541d3a5225284038d28ebe0b80cba2da3371b.zip
gcc-8fc541d3a5225284038d28ebe0b80cba2da3371b.tar.gz
gcc-8fc541d3a5225284038d28ebe0b80cba2da3371b.tar.bz2
openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char.
* 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. From-SVN: r134992
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 4eb7630..07848a1 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -132,7 +132,7 @@ mode;
static char
next_char (int in_string)
{
- static char c;
+ static gfc_char_t c;
if (use_last_char)
{
@@ -153,18 +153,11 @@ next_char (int in_string)
if (gfc_option.flag_backslash && c == '\\')
{
- int tmp;
locus old_locus = gfc_current_locus;
- /* Use a temp variable to avoid side effects from gfc_match_special_char
- since it uses an int * for its argument. */
- tmp = (int)c;
-
- if (gfc_match_special_char (&tmp) == MATCH_NO)
+ if (gfc_match_special_char (&c) == MATCH_NO)
gfc_current_locus = old_locus;
- c = (char)tmp;
-
if (!(gfc_option.allow_std & GFC_STD_GNU) && !inhibit_warnings)
gfc_warning ("Extension: backslash character at %C");
}
@@ -172,7 +165,7 @@ next_char (int in_string)
if (mode == MODE_COPY)
*format_string++ = c;
- c = TOUPPER (c);
+ c = TOUPPER ((unsigned char) c);
return c;
}
@@ -3185,7 +3178,7 @@ match_io (io_kind k)
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_code *io_code;
gfc_symbol *sym;
- int comma_flag, c;
+ int comma_flag;
locus where;
locus spec_end;
gfc_dt *dt;
@@ -3203,7 +3196,7 @@ match_io (io_kind k)
else if (k == M_PRINT)
{
/* Treat the non-standard case of PRINT namelist. */
- if ((gfc_current_form == FORM_FIXED || gfc_peek_char () == ' ')
+ if ((gfc_current_form == FORM_FIXED || gfc_peek_ascii_char () == ' ')
&& gfc_match_name (name) == MATCH_YES)
{
gfc_find_symbol (name, NULL, 1, &sym);
@@ -3227,7 +3220,7 @@ match_io (io_kind k)
if (gfc_current_form == FORM_FREE)
{
- c = gfc_peek_char();
+ char c = gfc_peek_ascii_char ();
if (c != ' ' && c != '*' && c != '\'' && c != '"')
{
m = MATCH_NO;