On 30/01/08 07:15, Ivan Shmakov wrote:
Glynn Clements <[EMAIL PROTECTED]> writes:
[...]
>> Is a new D_number_to_RGB(int color, unsigned char &r,&g,&b) fn
>> needed in lib/display/tran_colr.c?
> Yes. E.g.:
> int D_color_number_to_RGB(int color, int &r, int &g, int &b)
> {
That looks a lot like C++. Surely it will work with C89?
> const struct color_rgb *c;
> if (color <= 0)
> return 0;
BTW, is it a GRASS convention to use 0 to indicate failure?
Standard C library functions tend to use -1 for failure, while
using non-negative values to indicate success.
The SUBMITTING file in the source code says:
8. Exit status is defined as EXIT_SUCCESS or EXIT_FAILURE, e.g.
{
...
if (G_parser (argc, argv))
exit (EXIT_FAILURE);
...
exit (EXIT_SUCCESS);
}
AFAIU, these are defined in stlib as being respectively 0 and 1.
Moritz
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev