[Gnucash-changes] r12201 - gnucash/trunk/src/engine - Add
'const' qualifier to Account pointers in the Account api.
David Hampton
hampton-gnucash at rainbolthampton.net
Thu Dec 29 23:41:14 EST 2005
On Thu, 2005-12-29 at 22:34 -0500, Chris Shoemaker wrote:
> Author: chris
> Date: 2005-12-29 22:34:22 -0500 (Thu, 29 Dec 2005)
> New Revision: 12201
> Trac: http://svn.gnucash.org/trac/changeset/12201
>
> Modified:
> gnucash/trunk/src/engine/Account.c
> gnucash/trunk/src/engine/Account.h
> gnucash/trunk/src/engine/AccountP.h
> gnucash/trunk/src/engine/Group.c
> gnucash/trunk/src/engine/Group.h
> gnucash/trunk/src/engine/gw-engine-spec.scm
> Log:
> Add 'const' qualifier to Account pointers in the Account api.
>
> Including necessary related changes to functions passed accounts
> from the account functions.
>
> Interestingly, the only g-wrap function that complained about the
> new const function arguments was xaccAccountOrder(), the only one
> using const Account ** types. It seems very uncommon to express
> const-ness in g-wrap for any types other than gw:mchar. Actually
> I couldn't find any other examples, anywhere, so I had to guess
> at the syntax, but it works.
It doesn't work using g-wrap 1.9 and I'm unable to find a syntax that
does work.
David
> Modified: gnucash/trunk/src/engine/gw-engine-spec.scm
> ===================================================================
> --- gnucash/trunk/src/engine/gw-engine-spec.scm 2005-12-30 03:31:43 UTC (rev 12200)
> +++ gnucash/trunk/src/engine/gw-engine-spec.scm 2005-12-30 03:34:22 UTC (rev 12201)
> @@ -745,7 +745,10 @@
> 'gnc:account-order
> '<gw:int>
> "xaccAccountOrder"
> - '((<gnc:Account**> a1) (<gnc:Account**> a2))
> + '(
> + ((<gnc:Account**> const) a1)
> + ((<gnc:Account**> const) a2)
> + )
> "Defines a sorting order on accounts. Returns -1 if a1 is \"less
> than\" the second, +1 if the a1 is \"greater than\" the second, and 0
> if they are equal. To determine the sort order, the account codes are
>
> _______________________________________________
> gnucash-changes mailing list
> gnucash-changes at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-changes
More information about the gnucash-devel
mailing list