[GRASS-dev] help with r.le.setup bug

Glynn Clements glynn at gclements.plus.com
Fri Oct 6 03:03:45 EDT 2006

Hamish wrote:

> > > I think it's a simple type mismatch in variables getting passed to a
> > > function.
> > It is. ux/uy are arrays of ints but calc_unit_loc() expects arrays of
> > doubles.
> > 
> > Try the attached patch.
> [also cast to int for overlap() fn]
> yes, thanks.  funny, even with your patch it still messes up the "y"
> values of draw_box() unless I add in the fn prototype to setup.h.

Right. overlap() expects "int"s, but some of the values passed are
changed to double by my patch. If a valid prototype is in scope, the
compiler will automatically cast them to int, otherwise it will pass
them as double.

All of those declarations in setup.h should be either fixed or
removed. If the compiler needs a prototype (because the function isn't
already in scope at the point that it's used), it needs the *correct*

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list