[GRASS-dev] d.linegraph: secondary_width parameter defined as integer but default value is a float
Vaclav Petras
wenzeslaus at gmail.com
Sat Mar 24 12:59:59 PDT 2018
On Fri, Mar 23, 2018 at 7:54 PM, Markus Neteler <neteler at osgeo.org> wrote:
> On Fri, Mar 23, 2018 at 11:54 PM, Pietro <peter.zamb at gmail.com> wrote:
> > Dear dev,
> >
> > I've noticed that the module d.linegraph define the secondary_width
> > parameter as follow:
> >
> >
> > ```
> > /* theoretically for other things than points */
> > secondary_width_opt = G_define_option();
> > secondary_width_opt->key = "secondary_width";
> > secondary_width_opt->description = _("Width of point symbol lines");
> > secondary_width_opt->type = TYPE_INTEGER;
> > secondary_width_opt->required = NO;
> > secondary_width_opt->multiple = YES;
> > secondary_width_opt->answer = "0.1";
> > ```
> >
> > So the parameter type is supposed to be an integer, but the default
> value it
> > is a float?
> > Is it intentional and in case why?
>
> It came in through r69694. Probably simply an oversight?
>
secondary_width_opt is used to set symbol_line_width which is of type
double, the conversion is done with atof(), and symbol_line_width is used
for D_line_width() which takes double, so no, it is not intentional. Fixed
in r72558, backported to 7.4 in 72559.
https://trac.osgeo.org/grass/browser/grass/trunk/display/d.linegraph/main.c
https://trac.osgeo.org/grass/changeset/69694
https://grass.osgeo.org/programming7/draw2_8c.html#a7d7fc5729a6e6d14ad6403ed53466414
https://trac.osgeo.org/grass/changeset/72558
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180324/1c7e048d/attachment.html>
More information about the grass-dev
mailing list