r15849 - gnucash/trunk/src/business/business-core - Fix compiler complaints about dereferencing type-punned pointers.

Derek Atkins warlord at MIT.EDU
Sat Apr 7 17:30:52 EDT 2007


This can't work..   A GncOwner isn't a QofInstance.

-derek

Quoting David Hampton <hampton at cvs.gnucash.org>:

> Author: hampton
> Date: 2007-04-07 14:24:53 -0400 (Sat, 07 Apr 2007)
> New Revision: 15849
> Trac: http://svn.gnucash.org/trac/changeset/15849
>
> Modified:
>   gnucash/trunk/src/business/business-core/gncInvoice.c
> Log:
> Fix compiler complaints about dereferencing type-punned pointers.
>
>
> Modified: gnucash/trunk/src/business/business-core/gncInvoice.c
> ===================================================================
> --- gnucash/trunk/src/business/business-core/gncInvoice.c	2007-04-07 
> 16:12:31 UTC (rev 15848)
> +++ gnucash/trunk/src/business/business-core/gncInvoice.c	2007-04-07 
> 18:24:53 UTC (rev 15849)
> @@ -484,15 +484,21 @@
> static QofInstance*
> qofInvoiceGetOwner (GncInvoice *invoice)
> {
> +	GncOwner *owner;
> +
> 	if(!invoice) { return NULL; }
> -	return QOF_INSTANCE(&invoice->owner);
> +	owner = &invoice->owner;
> +	return QOF_INSTANCE(owner);
> }
>
> static QofInstance*
> qofInvoiceGetBillTo (GncInvoice *invoice)
> {
> +	GncOwner *billto;
> +
> 	if(!invoice) { return NULL; }
> -	return QOF_INSTANCE(&invoice->billto);
> +	billto = &invoice->billto;
> +	return QOF_INSTANCE(billto);
> }
>
> Timespec gncInvoiceGetDateOpened (GncInvoice *invoice)
>
> _______________________________________________
> gnucash-changes mailing list
> gnucash-changes at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-changes
>



-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list