Commit 70fadd09 by Roger Sayle Committed by Roger Sayle

module.c (mio_array_ref): The dimen_type fields of an array ref are an…

module.c (mio_array_ref): The dimen_type fields of an array ref are an enumerated type and can't be...


	* module.c (mio_array_ref): The dimen_type fields of an array ref
	are an enumerated type and can't be read/written directly with a
	call to mio_integer.  Instead loop over and cast each element.

From-SVN: r121011
parent b01e2f88
2007-01-20 Roger Sayle <roger@eyesopen.com>
* module.c (mio_array_ref): The dimen_type fields of an array ref
are an enumerated type and can't be read/written directly with a
call to mio_integer. Instead loop over and cast each element.
2007-01-20 Roger Sayle <roger@eyesopen.com>
* dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL,
i.e. that the ARRAY_REF doesn't mention components.
* trans-array.c (gfc_constant_array_constructor_p): Export external
......
......@@ -1913,8 +1913,25 @@ mio_array_ref (gfc_array_ref * ar)
gfc_internal_error ("mio_array_ref(): Unknown array ref");
}
for (i = 0; i < ar->dimen; i++)
mio_integer ((int *) &ar->dimen_type[i]);
/* Unfortunately, ar->dimen_type is an anonymous enumerated type so
we can't call mio_integer directly. Instead loop over each element
and cast it to/from an integer. */
if (iomode == IO_OUTPUT)
{
for (i = 0; i < ar->dimen; i++)
{
int tmp = (int)ar->dimen_type[i];
write_atom (ATOM_INTEGER, &tmp);
}
}
else
{
for (i = 0; i < ar->dimen; i++)
{
require_atom (ATOM_INTEGER);
ar->dimen_type[i] = atom_int;
}
}
if (iomode == IO_INPUT)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment