gnc_numeric function pointer casts

Neil Williams linux at codehelp.co.uk
Thu Jul 15 18:54:59 EDT 2004


On Thursday 15 July 2004 10:58, Derek Atkins wrote:
> Only because you don't understand function pointers.  ;)
> I suggest you read up on them, and then you'll understand
> what's going on and why your code is crapping out...

I was nearly there. :-) Thanks, Derek.

> Ok, do you understand the difference between "lister->param_getfcn"
> and "lister->param_getfcn(a,b)"?  I don't think you do. 

It wasn't clear in my mind before, it makes sense now.

> (feel free to break this up into two lines). 
gnc_numeric (*numeric_getter)(QofEntity*, QofParam*);
numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*)) 
	lister->param_getfcn;
qtn = numeric_getter(mergeEnt,lister);

> > http://www.codehelp.co.uk/code/gncBookMerge.c
> > http://www.codehelp.co.uk/code/gncBookMerge.h

I've updated the .c page with the working function pointers.

> Correct on all counts.  

Good. Thanks.

> Hopefully I didn't just confuse you more..

Not at all.

-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040715/57ef95be/attachment.bin


More information about the gnucash-devel mailing list