r18979 - gnucash/trunk/src/gnome - Replace IF_TYPE macro with a validation function

Christian Stimming stimming at tuhh.de
Tue Mar 30 15:45:41 EDT 2010


Very good! So far I didn't encounter this macro (fortunately), but I'm all in 
for replacing a macro with this weird characteristics by a normal function.

After all, in gnucash we have not at all a performance bottleneck that would 
require using macros instead of normal function calls. Hence, I'm all in for 
replacing macros by normal function calls (even if that sometimes means one 
has to write the same function body several times). Macros are so evil that 
even in C you can't always get around them, but most of the times you still 
can and that's what we should do.

Thanks!

Christian

Am Dienstag, 30. März 2010 schrieb Geert Janssens:
> Author: gjanssens
> Date: 2010-03-30 10:29:53 -0400 (Tue, 30 Mar 2010)
> New Revision: 18979
> Trac: http://svn.gnucash.org/trac/changeset/18979
> 
> Modified:
>    gnucash/trunk/src/gnome/top-level.c
> Log:
> Replace IF_TYPE macro with a validation function
> The macro is quite ugly: it's not a complete if condition (missing closing
>  bracket) which makes the code using it difficult to read and error-prone.
> Even astyle got confused by it.
> The replacement code is slightly longer (two lines per replaced IF_TYPE
>  invocation) but clean and readable.
> 
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches
> 



More information about the gnucash-devel mailing list