[Gnucash-changes] r12201 - gnucash/trunk/src/engine - Add
'const' qualifier to Account pointers in the Account api.
Chris Shoemaker
c.shoemaker at cox.net
Fri Dec 30 00:10:33 EST 2005
On Thu, Dec 29, 2005 at 11:41:14PM -0500, David Hampton wrote:
> > 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.
:( I was a bit discouraged after googling for the solution for about
30 min. I concluded that we're basically the only serious user of
g-wrap that google knows about. When I said "anywhere", I meant in
google-land.
I figured I'd jst guess some syntaxes and was amazed when I got this
to pop out:
static char * gw__tmp161_xaccAccountOrder_namestr = "gnc:account-order";
static SCM gw__tmp160_xaccAccountOrder_wrapper (SCM gw__scm_arg0, SCM gw__scm_arg1 ) {
SCM gw__scm_result = SCM_UNSPECIFIED;
enum GW__ErrorStatus gw__error_status = GW__ERR_NONE;
SCM gw__error_data = SCM_UNSPECIFIED;
unsigned int gw__arg_pos = 0;
const char *gw__error_misc_msg = NULL;
int gw__c_result;
const Account** gw__c_arg0;
const Account** gw__c_arg1;
/* ARG 0 */
gw__arg_pos++;
if (gw__error_status != GW__ERR_NONE) goto gw__wrapper_exit;
{
if(!(SCM_FALSEP(gw__scm_arg0) || gw_wcp_is_of_type_p(gw__tmp18_wct_info_for__gnc_Account___, gw__scm_arg0))){
gw__error_status = GW__ERR_ARG_TYPE;
gw__error_data = gw__scm_arg0;
goto gw__post_call_arg_0;
}
else {if(SCM_FALSEP(gw__scm_arg0)) gw__c_arg0 = NULL;
else gw__c_arg0 = gw_wcp_get_ptr(gw__scm_arg0);
}
...etc...
which made gcc perfectly happy. Honestly, I don't know why the
'Account**' case is treated differently than the 'Account*' case.
Debugging g-wrap makes my head hurt. It's like trying to learn a
foreign language by listening to two people violently argue.
Since xaccAccountOrder isn't used in scheme, I say we just unexport
it and wait for the next g-wrap bug to bite us.
-chris
More information about the gnucash-devel
mailing list