[GRASS5] confused by lib fns

Glynn Clements glynn at gclements.plus.com
Mon Oct 10 00:44:01 EDT 2005


Hamish wrote:

> > > 2) All fn's in color_get.c have R,G,B as int,
> > 
> > Pointer to int.
> > 
> > > but lib/raster/RGB_color.c
> > >    wants unsigned char. You can't access & set the display color
> > >    without the compiler doing a cast.  gis.h likes unsigned char.
> > >    Should color_get.c be changed to use unsigned char?
> > 
> > RGB_color.c isn't the only user of that function; most of the callers
> > use ints.
> 
> Can we at least standardize the library functions to something we agree
> is "correct" (gis.h should be canonical) and worry about what the
> rabble of modules call later?

Code which deals with single colours will usually want to use int;
code which uses arrays of colours will want to use unsigned char.

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




More information about the grass-dev mailing list