aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-14 19:56:06 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-14 19:56:06 -0800
commit6b25a558d71af78b9c2891a761b441c4a4088285 (patch)
tree3fa977dffc10679dfaab85801d62c79a49b0338a /gcc/fortran/module.c
parent6bd26f0bee556c3951a99a7cd2ae76a413d5ce18 (diff)
downloadgcc-6b25a558d71af78b9c2891a761b441c4a4088285.zip
gcc-6b25a558d71af78b9c2891a761b441c4a4088285.tar.gz
gcc-6b25a558d71af78b9c2891a761b441c4a4088285.tar.bz2
gfortran.h (gfc_expr.function.name): Make const.
* gfortran.h (gfc_expr.function.name): Make const. (gfc_iresolve_init_1, gfc_iresolve_done_1): Remove. (gfc_get_string): Update prototype. * iresolve.c: Include tree.h. (string_node, HASH_SIZE, string_head, hash): Remove. (gfc_get_string): Use vsnprintf, get_identifier. (free_strings, gfc_iresolve_init_1, gfc_iresolve_done_1): Remove. * misc.c (gfc_init_1): Don't call gfc_iresolve_init_1. (gfc_done_1): Don't call gfc_iresolve_done_1. * module.c (mio_allocated_string): Take and return const char *, instead of modifying char**. (mio_expr): Update to match. * resolve.c (pure_function): Constify name argument. (resolve_function): Constify name. * trans-intrinsic.c (gfc_conv_intrinsic_function): Likewise. From-SVN: r92176
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 10beca3..d4bee5b 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -1330,16 +1330,18 @@ mio_integer (int *ip)
/* Read or write a character pointer that points to a string on the
heap. */
-static void
-mio_allocated_string (char **sp)
+static const char *
+mio_allocated_string (const char *s)
{
-
if (iomode == IO_OUTPUT)
- write_atom (ATOM_STRING, *sp);
+ {
+ write_atom (ATOM_STRING, s);
+ return s;
+ }
else
{
require_atom (ATOM_STRING);
- *sp = atom_string;
+ return atom_string;
}
}
@@ -2449,7 +2451,8 @@ mio_expr (gfc_expr ** ep)
if (iomode == IO_OUTPUT)
{
- mio_allocated_string (&e->value.function.name);
+ e->value.function.name
+ = mio_allocated_string (e->value.function.name);
flag = e->value.function.esym != NULL;
mio_integer (&flag);
if (flag)
@@ -2483,7 +2486,8 @@ mio_expr (gfc_expr ** ep)
break;
case EXPR_SUBSTRING:
- mio_allocated_string (&e->value.character.string);
+ e->value.character.string = (char *)
+ mio_allocated_string (e->value.character.string);
mio_expr (&e->op1);
mio_expr (&e->op2);
break;
@@ -2518,7 +2522,8 @@ mio_expr (gfc_expr ** ep)
case BT_CHARACTER:
mio_integer (&e->value.character.length);
- mio_allocated_string (&e->value.character.string);
+ e->value.character.string = (char *)
+ mio_allocated_string (e->value.character.string);
break;
default: