[GRASS-dev] GRASS 7: r.vol.dem Addon update question

Sören Gebbert soerengebbert at googlemail.com
Wed Apr 25 04:02:02 EDT 2012


Hi Markus,
all the Rast_get_d_row() return value checks are pointless and should
be removed. Rast_get_d_row() does not return any value (return type is
void) but calls G_fatal_error itself  in case of an error.

Best regards
Soeren

2012/4/25 Markus Neteler <neteler at osgeo.org>:
> Hi,
>
> I tried to port the new r.vol.dem Addon from GRASS 6 to GRASS 7
> http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.vol.dem
>
> and stumbled about these remaining problems (declarations):
>
> [neteler at north r.vol.dem]$ make MODULE_TOPDIR=$HOME/grass70/
> gcc  -g -Wall  -fno-common -fexceptions -mtune=nocona -m64
> -minline-all-stringops
> -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
> -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
> -D_FILE_OFFSET_BITS=64  -DPACKAGE=\""grassmods"\"
> -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
> -I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
> OBJ.x86_64-unknown-linux-gnu/main.o -c main.c
> main.c: In function ‘check_zrange’:
> main.c:280:5: warning: passing argument 1 of ‘Rast_get_d_row’ makes
> integer from pointer without a cast [enabled by default]
> /home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/defs/raster.h:327:6:
> note: expected ‘int’ but argument is of type ‘int *’
> main.c:280:5: warning: passing argument 2 of ‘Rast_get_d_row’ from
> incompatible pointer type [enabled by default]
> /home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include/grass/defs/raster.h:327:6:
> note: expected ‘DCELL *’ but argument is of type ‘DCELL **’
> main.c:280:5: error: void value not ignored as it ought to be
> main.c:288:6: error: void value not ignored as it ought to be
> main.c:311:5: error: void value not ignored as it ought to be
> main.c:319:6: error: void value not ignored as it ought to be
> main.c: In function ‘check_topologies’:
> main.c:397:6: error: void value not ignored as it ought to be
> main.c: In function ‘interpolate’:
> main.c:709:6: error: void value not ignored as it ought to be
> main.c: In function ‘main’:
> main.c:1314:9: warning: assignment discards ‘const’ qualifier from
> pointer target type [enabled by default]
> make: *** [OBJ.x86_64-unknown-linux-gnu/main.o] Error 1
>
> Line 280 is:
> if (Rast_get_d_row(fd[0], dcell[0], row) < 0) {
>
> Lost in pointers,
> Markus
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list