[GRASS-dev] GRASS Make-system question

Soeren Gebbert soerengebbert at googlemail.com
Wed Jun 22 09:52:01 EDT 2011


Hi Glynn,

>> Can anybody give me a hint how to solve this.
>
> Don't try to use quick hacks; do it properly. Either clone the file as
> e.g. main3.c or make it support both 2d and 3d at run-time.

Well, actually my intention was not a quick hack. I thought it would
be meaningful to use macros to reduce the appearance of cloned code
for easier code maintainability. I did not know that using macros to
decide at compile time the behavior of a program is a hack at all.

I changed the code of r/r3.color.out to meet your guideline.

I have to rethink the r/r3.colors approach to meet your guideline too,
but to also reducing cloned code. I am not a fan of cloned code and
modules with mixed behavior (raster and raster3d support) with the
need adding scripts to hide there complexity:

For example:
r.colors.fency does it all
-> script r.colors to offer only raster capabilities of r.colors.fancy
-> script r3.colors to offer only raster3d capabilities of r.colors.fancy

Best regards
Soeren

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


More information about the grass-dev mailing list