Also my first posting on malloc was badly *wrong*. I'll put it down to too many
Fosters over the festive season :-)
If anyone wants to hack f2c to support a pointer type (just like integer
except that code like:
pointer i
c 100 double precision
i = malloc_(800)
call fred(i, 100)
would get translated to
static integer c__800 = 800;
static integer c__100 = 100;
integer i;
/* 100 double precision */
i = malloc_(&c__800);
fred_(i, &c__100); /* currently fred_(&i, &c__100) */
Using loc() should be able to circumvent this:
in FORTRAN
c assigns address of i to m
m = loc(i)
call fred(m, 100)
but this fails with f2c but works on SUN FORTRAN.
I fear I'm missing something.
Anyway here's loc_.c
int
loc_(arg)
int *arg;
{
return((int)arg);
}
Any help would be most appreciated,
and Happy New Year
Glenn
gl...@qed.physics.su.oz.au
--
Glenn Geers | "So when it's over, we're back to people.
Department of Theoretical Physics | Just to prove that human touch can have
The University of Sydney | no equal."
Sydney NSW 2006 Australia | - Basia Trzetrzelewska, 'Prime Time TV'