diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2014-05-26 15:19:36 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2014-05-26 15:19:36 +0000 |
commit | 3b111bd757f065188029914f9a7b21c1e1c3ccfe (patch) | |
tree | e0feaad272b918928001fe12ba340e17a2ae7878 /libgfortran | |
parent | d93461f724b233e2af55555da586d5d5ebe2081b (diff) | |
download | gcc-3b111bd757f065188029914f9a7b21c1e1c3ccfe.zip gcc-3b111bd757f065188029914f9a7b21c1e1c3ccfe.tar.gz gcc-3b111bd757f065188029914f9a7b21c1e1c3ccfe.tar.bz2 |
[multiple changes]
2014-05-26 Tobias Burnus <burnus@net-b.de>
PR fortran/55117
* trans-io.c (nml_full_name, transfer_namelist_element): Insert
a '+' rather then '%' to differentiate namelist variable names
that are based on extended derived types.
2014-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/55117
* io/list_read.c (extended_look_ahead): New helper function to
scan the namelist name and look for matches with the new '+'
extended type parent indicator. (str_comp_extended): New
helper function to compare the namelist name with the varname
namelist. (find_nml_name): Use the new helper functions to match
the extended type varnames.
From-SVN: r210934
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 10 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 37 |
2 files changed, 47 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index cead92d..efa6f05 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,13 @@ +2014-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/55117 + * io/list_read.c (extended_look_ahead): New helper function to + scan the namelist name and look for matches with the new '+' + extended type parent indicator. (str_comp_extended): New + helper function to compare the namelist name with the varname + namelist. (find_nml_name): Use the new helper functions to match + the extended type varnames. + 2014-05-23 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/61173 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 5ccd022..13e38f4 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -2557,6 +2557,38 @@ err_ret: return false; } + +static bool +extended_look_ahead (char *p, char *q) +{ + char *r, *s; + + /* Scan ahead to find a '%' in the p string. */ + for(r = p, s = q; *r && *s; s++) + if ((*s == '%' || *s == '+') && strcmp (r + 1, s + 1) == 0) + return true; + return false; +} + + +static bool +strcmp_extended_type (char *p, char *q) +{ + char *r, *s; + + for (r = p, s = q; *r && *s; r++, s++) + { + if (*r != *s) + { + if (*r == '%' && *s == '+' && extended_look_ahead (r, s)) + return true; + break; + } + } + return false; +} + + static namelist_info * find_nml_node (st_parameter_dt *dtp, char * var_name) { @@ -2568,6 +2600,11 @@ find_nml_node (st_parameter_dt *dtp, char * var_name) t->touched = 1; return t; } + if (strcmp_extended_type (var_name, t->var_name)) + { + t->touched = 1; + return t; + } t = t->next; } return NULL; |