[GRASS-dev] oproj void** invalid conversion
Glynn Clements
glynn at gclements.plus.com
Mon Feb 16 17:39:07 EST 2009
Andreas Jochem wrote:
> I am trying to convert Coordinates to lat / long. I would like to save
> the output projection parameters in oproj.
>
> But the compiler is complaining.
>
> error: invalid conversion from �void*� to �void**�.
>
> If I use *oproj.pj instead of oproj.pj the compiler doesn't complain
> anymore but the transformation to lat / long does not work.
>
> The code is following below.
>
> Does anybody know this problem. I used this code a couple of months ago
> and it worked.
The type of the "pj" field of "struct pj_info" was wrong (projPJ is a
typedef for "void *").
It was corrected in r33949 (7.0) and r33951 (6.4):
http://trac.osgeo.org/grass/changeset/33949
http://trac.osgeo.org/grass/changeset/33951
> if ((oproj.pj = pj_latlong_from_proj(iproj.pj)) == NULL)
> G_fatal_error("Unable to set up lat/long projection parameters");
This code is correct. If it generates a warning, your
<grass/gprojects.h> file is out of date. It should still work, though.
Using *oproj.pj will never work.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list