[GRASS-dev] starting GIPE modules insertion in main svn

Yann Chemin yann.chemin at gmail.com
Tue Sep 30 13:11:47 EDT 2008


2008/9/30 Glynn Clements <glynn at gclements.plus.com>:
>
> Martin Landa wrote:
>
>> > i.qc.modis: classifies binary Quality flags from MODIS reflectance
>> > products (250 & 500m) into values.
>>
>> compilation still fails:
>>
>> CKAGE=\""grassmods"\"
>> -I/home/martin/src/grass_trunk/dist.i686-pc-linux-gnu/include -o
>> OBJ.i686-pc-linux-gnu/qc250a.o -c qc250a.c
>> qc250a.c: In function 'qc250a':
>> qc250a.c:14: error: implicit declaration of function 'swab'
>> make: *** [OBJ.i686-pc-linux-gnu/qc250a.o] Error 1
>
> Right; you need <unistd.h> for swab().
>
are there forgiving compilers around, so that this was not required explicitely?
This is on my laptop:

Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.3.2-1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1)


> BTW, what purpose does making qc250chan an "unsigned int" serve? CELL
> is an "int" and the "unsigned" qualifier doesn't make any difference
> to the operations which are actually being performed upon the values.
>
The functions were designed out of GRASS, with stronger restrictions
on reading in data.
This should be obsolete in GRASS now indeed.

> Also, the fact that the swab() calls are there seems to imply that the
> data was imported incorrectly in the first place. If any byte swapping
> needs to be done, it should normally be done when the data is
> imported.
>
My mastering of binary reading is weak, so I guess you make sense,
but technically I would feel weak to modify it. For what I undestand
it was initially meant
(outside of GRASS) to isolate a small number of bits for & comparison.

> --
> Glynn Clements <glynn at gclements.plus.com>
>



-- 
Yann Chemin
International Rice Research Institute
Office: http://www.irri.org/gis
Perso: http://www.freewebs.com/ychemin
YiKingDo: http://yikingdo.unblog.fr/


More information about the grass-dev mailing list