diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-02-23 23:14:12 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-02-23 23:14:12 +0100 |
commit | e9444bd5ee3a3fa264e5f8541cb6b01507c813fa (patch) | |
tree | 94405864274f14b88cb5fd2d24eba85e42579556 /gcc/fortran/symbol.c | |
parent | 58b03ab29f5bad84af12b599a1791c65c2d01405 (diff) | |
download | gcc-e9444bd5ee3a3fa264e5f8541cb6b01507c813fa.zip gcc-e9444bd5ee3a3fa264e5f8541cb6b01507c813fa.tar.gz gcc-e9444bd5ee3a3fa264e5f8541cb6b01507c813fa.tar.bz2 |
gfortran.h (gfc_component, [...]): Make 'name' a 'const char *'.
* gfortran.h (gfc_component, gfc_actual_arglist, gfc_user_op): Make
'name' a 'const char *'.
(gfc_symbol): Likewise, also for 'module'.
(gfc_symtree): Make 'name' a 'const char *'.
(gfc_intrinsic_sym): Likewise, also for 'lib_name'.
(gfc_get_gsymbol, gfc_find_gsymbol): Add 'const' qualifier to
'char *' argument.
(gfc_intrinsic_symbol): Use 'gfc_get_string' instead of 'strcpy' to
initialize 'SYM->module'.
* check.c (gfc_check_minloc_maxloc, check_reduction): Check for NULL
pointer instead of empty string.
* dump-parse-tree.c (gfc_show_actual_arglist): Likewise.
* interface.c (gfc_compare_types): Adapt check to account for possible
NULL pointer.
(compare_actual_formal): Check for NULL pointer instead of empty
string.
* intrinsic.c (gfc_current_intrinsic, gfc_current_intrinsic_arg):
Add 'const' qualifier.
(conv_name): Return a heap allocated string.
(find_conv): Add 'const' qualifier to 'target'.
(add_sym): Use 'gfc_get_string' instead of 'strcpy'.
(make_generic): Check for NULL pointer instead of emptystring.
(make_alias): Use 'gfc_get_string' instead of 'strcpy'.
(add_conv): No need to strcpy result from 'conv_name'.
(sort_actual): Check for NULL pointer instead of emptystring.
* intrinsic.h (gfc_current_intrinsic, gfc_current_intrinsic_arg):
Adapt prototype.
* module.c (compare_true_names): Compare pointers instead of strings
for 'module' member.
(find_true_name): Initialize string fields with gfc_get_string.
(mio_pool_string): New function.
(mio_internal_string): Adapt comment.
(mio_component_ref, mio_component, mio_actual_arg): Use
'mio_pool_string' instead of 'mio_internal_string'.
(mio_symbol_interface): Add 'const' qualifier to string arguments.
Add level of indirection. Use 'mio_pool_string' instead of
'mio_internal_string'.
(load_needed, read_module): Use 'gfc_get_string' instead of 'strcpy'.
(write_common, write_symbol): Use 'mio_pool_string' instead of
'mio_internal_string'.
(write_symbol0, write_symbol1): Likewise, also check for NULL pointer
instead of empty string.
(write_operator, write_generic): Pass correct type variable to
'mio_symbol_interface'.
(write_symtree): Use 'mio_pool_string' instead of
'mio_internal_string'.
* primary.c (match_keyword_arg): Adapt check to possible
case of NULL pointer. Use 'gfc_get_string' instead of 'strcpy'.
* symbol.c (gfc_add_component, gfc_new_symtree, delete_symtree,
gfc_get_uop, gfc_new_symbol): Use 'gfc_get_string' instead of
'strcpy'.
(ambiguous_symbol): Check for NULL pointer instead of empty string.
(gfc_find_gsymbol, gfc_get_gsymbol): Add 'const' qualifier on string
arguments.
* trans-array.c (gfc_trans_auto_array_allocation): Check for NULL
pointer instead of empty string.
* trans-decl.c (gfc_sym_mangled_identifier,
gfc_sym_mangled_function_id, gfc_finish_var_decl, gfc_get_symbol_decl,
gfc_get_symbol_decl): Likewise.
* trans-io.c (gfc_new_nml_name_expr): Add 'const' qualifier to
argument. Copy string instead of pointing to it.
From-SVN: r95472
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 77d3f1a..0b5e8e7 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1157,7 +1157,7 @@ gfc_add_component (gfc_symbol * sym, const char *name, gfc_component ** componen else tail->next = p; - strcpy (p->name, name); + p->name = gfc_get_string (name); p->loc = gfc_current_locus; *component = p; @@ -1613,7 +1613,7 @@ gfc_new_symtree (gfc_symtree ** root, const char *name) gfc_symtree *st; st = gfc_getmem (sizeof (gfc_symtree)); - strcpy (st->name, name); + st->name = gfc_get_string (name); gfc_insert_bbt (root, st, compare_symtree); return st; @@ -1629,7 +1629,7 @@ delete_symtree (gfc_symtree ** root, const char *name) st0 = gfc_find_symtree (*root, name); - strcpy (st.name, name); + st.name = gfc_get_string (name); gfc_delete_bbt (root, &st, compare_symtree); gfc_free (st0); @@ -1674,7 +1674,7 @@ gfc_get_uop (const char *name) st = gfc_new_symtree (&gfc_current_ns->uop_root, name); uop = st->n.uop = gfc_getmem (sizeof (gfc_user_op)); - strcpy (uop->name, name); + uop->name = gfc_get_string (name); uop->access = ACCESS_UNKNOWN; uop->ns = gfc_current_ns; @@ -1743,7 +1743,7 @@ gfc_new_symbol (const char *name, gfc_namespace * ns) if (strlen (name) > GFC_MAX_SYMBOL_LEN) gfc_internal_error ("new_symbol(): Symbol name too long"); - strcpy (p->name, name); + p->name = gfc_get_string (name); return p; } @@ -1754,7 +1754,7 @@ static void ambiguous_symbol (const char *name, gfc_symtree * st) { - if (st->n.sym->module[0]) + if (st->n.sym->module) gfc_error ("Name '%s' at %C is an ambiguous reference to '%s' " "from module '%s'", name, st->n.sym->name, st->n.sym->module); else @@ -2362,7 +2362,7 @@ gfc_symbol_state(void) { /* Search a tree for the global symbol. */ gfc_gsymbol * -gfc_find_gsymbol (gfc_gsymbol *symbol, char *name) +gfc_find_gsymbol (gfc_gsymbol *symbol, const char *name) { gfc_gsymbol *s; @@ -2399,7 +2399,7 @@ gsym_compare (void * _s1, void * _s2) /* Get a global symbol, creating it if it doesn't exist. */ gfc_gsymbol * -gfc_get_gsymbol (char *name) +gfc_get_gsymbol (const char *name) { gfc_gsymbol *s; |