[GRASS-dev] Re: [GRASS-user] r.stats: negative cell counts and percentages

Hamish hamish_b at yahoo.com
Thu Oct 1 14:05:10 EDT 2009


Hamish wrote:
> > I notice r.info uses unsigned long long + printf %llu
> > Shall we standardize on that?

Glynn wrote:
> The main downside is that you can end up needing a lot of
> conditional code.

I'm not seeing any alternative though.

For any module which does math with it (eg casting prior to
variable multiplication/division), perhaps to save some noise in
the code the LONGTYPE could be set up as a macro at the top
of the file and then the casts should look like 
 (LONGTYPE)chellhd.rows * cellhb*cols

setting up strfmt=LONGFMT for %llu or %lu is a bit uglier, but
a number of other modules pull such tricks to aviod CELL/FCELL/
DCELL switch statements.


Hamish



      



More information about the grass-dev mailing list