diff options
author | Janus Weil <janus@gcc.gnu.org> | 2018-09-20 21:33:05 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2018-09-20 21:33:05 +0200 |
commit | 2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d (patch) | |
tree | 230e5d690dc909163e13b97662b3920ae08ffa7b /gcc/fortran/module.c | |
parent | 5596651acde99a5826a6ebf63afaf1a9fabc36e7 (diff) | |
download | gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.zip gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.tar.gz gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.tar.bz2 |
gfortran.h (gfc_str_startswith): New macro.
2018-09-20 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (gfc_str_startswith): New macro.
* decl.c (variable_decl, gfc_match_end): Use it.
* iresolve.c (is_trig_resolved): Ditto.
* module.c (load_omp_udrs, read_module): Ditto.
* options.c (gfc_handle_runtime_check_option): Ditto.
* primary.c (match_arg_list_function): Ditto.
* trans-decl.c (gfc_get_symbol_decl): Ditto.
* trans-expr.c (gfc_conv_procedure_call): Ditto.
* interface.c (dtio_op): Replace strncmp by strcmp.
* resolve.c (resolve_actual_arglist, resolve_function): Ditto.
* trans-expr.c (conv_arglist_function): Ditto.
* trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
STARTS_WITH by gfc_str_startswith.
From-SVN: r264448
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 993ea9f..7b8e863 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4791,7 +4791,7 @@ load_omp_udrs (void) mio_pool_string (&name); gfc_clear_ts (&ts); mio_typespec (&ts); - if (strncmp (name, "operator ", sizeof ("operator ") - 1) == 0) + if (gfc_str_startswith (name, "operator ")) { const char *p = name + sizeof ("operator ") - 1; if (strcmp (p, "+") == 0) @@ -5233,8 +5233,8 @@ read_module (void) /* Exception: Always import vtabs & vtypes. */ if (p == NULL && name[0] == '_' - && (strncmp (name, "__vtab_", 5) == 0 - || strncmp (name, "__vtype_", 6) == 0)) + && (gfc_str_startswith (name, "__vtab_") + || gfc_str_startswith (name, "__vtype_"))) p = name; /* Skip symtree nodes not in an ONLY clause, unless there @@ -5319,8 +5319,8 @@ read_module (void) sym->attr.use_rename = 1; if (name[0] != '_' - || (strncmp (name, "__vtab_", 5) != 0 - && strncmp (name, "__vtype_", 6) != 0)) + || (!gfc_str_startswith (name, "__vtab_") + && !gfc_str_startswith (name, "__vtype_"))) sym->attr.use_only = only_flag; /* Store the symtree pointing to this symbol. */ |