r14611 - gnucash/trunk/src - Various whitespace, line-wrap, and comment changes.

Chris Shoemaker c.shoemaker at cox.net
Mon Aug 14 20:30:52 EDT 2006


On Sun, Aug 13, 2006 at 04:59:03PM -0400, Derek Atkins wrote:
> Chris,
> 
> Chris Shoemaker <chris at cvs.gnucash.org> writes:
> 
> > +/* FIXME: These macros are not consistent with the type name */
> >  #define GNC_IS_TRANS(obj)  (QOF_CHECK_TYPE((obj), GNC_ID_TRANS))
> >  #define GNC_TRANS(obj)     (QOF_CHECK_CAST((obj), GNC_ID_TRANS, Transaction))
> 
> I'm a little confused about what you mean by this new comment.
> How are these macros now consistent with the type name?
> Are you complaining that "TRANS" != "Transaction"?

!= "TRANSACTION".  All the gtk/glib casting macros use the
(capitalized) type name.  I definitely recall seeing GNC_TRANS(t) and
then trying to compile code with "Trans *trans;".  IMO, the macro/type
pair violate the prinical of least-surprise.  I'm hoping that a
GObject-ification of our type hierarchy will be accompanied by a
regularization of our type names.  And while we're at it, I wouldn't
mind s/xacc/gnc/g and settling the gnc_foo_bar() vs. gncFooBar()
style, too.

> I'll point out that the TRANS shortcut is used many places already.
> Did you feel that this was confusing to somebody?

Me!  :)

-chris


More information about the gnucash-devel mailing list