[GRASS-dev] [GRASS GIS] #1173: v.surf.rst: bug in handling Output deviations vector point file
GRASS GIS
trac at osgeo.org
Wed May 1 21:37:46 PDT 2013
#1173: v.surf.rst: bug in handling Output deviations vector point file
---------------------------------+------------------------------------------
Reporter: mmetz | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Vector | Version: svn-releasebranch64
Keywords: vector, rst library | Platform: All
Cpu: All |
---------------------------------+------------------------------------------
Comment(by hamish):
Replying to [comment:3 helena]:
> is this still an issue?
yes, still get the compiler warning:
{{{
main.c:706: warning: passing argument 41 of 'IL_init_params_2d'
from incompatible pointer type
}}}
which is:
{{{
IL_init_params_2d(¶ms, NULL, 1, 1, zmult, KMIN, KMAX, maskmap,
n_rows,
n_cols, az, adx, ady, adxx, adyy, adxy, fi, KMAX2,
SCIK1, SCIK2, SCIK3, rsm, elev, slope, aspect,
pcurv,
tcurv, mcurv, dmin, x_orig, y_orig, deriv, theta,
scalex, Tmp_fd_z, Tmp_fd_dx, Tmp_fd_dy, Tmp_fd_xx,
Tmp_fd_yy, Tmp_fd_xy, devi, inhead.time, cv,
parm.wheresql->answer);
}}}
as mentioned by mmetz, opt # 41 is `devi`, which is char*, later set to
devi = parm.devi->answer;
which is the string-name of the deviations vector points file.
lib/rst/interp_float/interpf.h defines the parameter as:
{{{
FILE *fddevi; /* pointer to deviations file */
}}}
and the only reason it doesn't end in tears is that
lib/rst/interp_float/point2d.c is just testing to see if it is set or not,
not trying to write anything to the fp:
{{{
if (params->fddevi != NULL)
...
}}}
v.surf.rst's main.c has a global called `FILE *fddevi`, which is not used
within the module itself.
char*devi is used to open a new points map,
Vect_open_new(&Map2, devi, 1);
and so perhaps Map2->hist_fp (FILE*) from the Map_info struct could be
passed, but it seems non-ideal. There is also Map_info->dig_fp to look at
(type GVFILE).
and/or do an audit and change the IL_init_params_2d() fn prototype and
hope it doesn't break anyone's personal addon module.
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1173#comment:4>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list