[GRASS-dev] adding lib_arraystats

Moritz Lennert mlennert at club.worldonline.be
Thu Feb 14 05:54:54 EST 2008


On 13/02/08 22:01, Glynn Clements wrote:
> Paul Kelly wrote:
> 
>>> I'm happy that I've been able to launch a discussion about linking R into 
>>> GRASS, but could someone tell me if I can check the code into svn ?
>> I can't presume to say anything other than if you feel happy the quality 
>> and functionality is up to inclusion in GRASS, go ahead - but if you'd 
>> like a couple of comments on it here goes:
>>
>> the typedef STATS looks a little weird to me, (a) because STATS on its own 
>> is a very generic sounding name and (b) because in general typedefs are 
>> used very little in GRASS (for one thing they confuse me...) I'd suggest 
>> something along the lines of "struct GASTATS", avoiding the typedef.
> 
> Agreed. GRASS normally uses structure tags rather than typedefs.
> 
>> EXIT_SUCCESS used as a function exit status looks a bit strange to me too- 
>> IIUC this is defined in stdlib.h and intended for programs to return a 
>> status code to the enviroment when they exit, not really for internal use 
>> by functions.


Thanks to both of you for all your remarks, I'll try to rewrite the code 
accordingly.

Concerning EXIT_SUCCESS, I based this on the SUBMITTING file which 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);
     }

I guess this should read "Module exit status..." (i.e. not function exit 
status) ?

Moritz


More information about the grass-dev mailing list