* src/engine/qofinstance.c: revert fix from 01-01, because it's wrong.

Fix the actual problem, all the ...ReturnGUID() #define's which
	  don't check that it's passed a NULL value.
	* src/engine/Transaction.h:
	* src/engine/Account.h:
	  Fix ...ReturnGUID() to check whether it was passed a NULL object
	  and, if so, return the null GUID instead of crashing.
	* src/business/business-core/gncCustomer.h:
	* src/business/business-core/gncEmployee.h:
	* src/business/business-core/gncInvoice.h:
	* src/business/business-core/gncJob.h:
	* src/business/business-core/gncTaxTable.h:
	* src/business/business-core/gncVendor.h:
	  Fix ...RetGUID() to check whether it was passed a NULL object
	  and, if so, return the null GUID instead of crashing.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9758 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins
2004-01-07 01:54:37 +00:00
parent e857be8e33
commit 7985754dc8
10 changed files with 26 additions and 10 deletions

View File

@@ -1,5 +1,21 @@
2004-01-06 Derek Atkins <derek@ihtfp.com>
* src/engine/qofinstance.c: revert fix from 01-01, because it's wrong.
Fix the actual problem, all the ...ReturnGUID() #define's which
don't check that it's passed a NULL value.
* src/engine/Transaction.h:
* src/engine/Account.h:
Fix ...ReturnGUID() to check whether it was passed a NULL object
and, if so, return the null GUID instead of crashing.
* src/business/business-core/gncCustomer.h:
* src/business/business-core/gncEmployee.h:
* src/business/business-core/gncInvoice.h:
* src/business/business-core/gncJob.h:
* src/business/business-core/gncTaxTable.h:
* src/business/business-core/gncVendor.h:
Fix ...RetGUID() to check whether it was passed a NULL object
and, if so, return the null GUID instead of crashing.
* README.cvs: make it even more explicit that you should not run configure
* src/engine/Makefile.am: remove the circular dependency I added earlier
* src/engine/gw-engine-spec.scm: don't include gnc-engine-util.h (it's

View File

@@ -111,7 +111,7 @@ int gncCustomerCompare (GncCustomer *a, GncCustomer *b);
/* deprecated functions, should be removed */
#define gncCustomerGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
#define gncCustomerRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
#define gncCustomerRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
#define gncCustomerGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
#define gncCustomerLookupDirect(g,b) gncCustomerLookup((b), &(g))

View File

@@ -94,7 +94,7 @@ int gncEmployeeCompare (GncEmployee *a, GncEmployee *b);
/** deprecated routines */
#define gncEmployeeGetGUID(E) qof_entity_get_guid(QOF_ENTITY(E))
#define gncEmployeeRetGUID(E) (*(qof_entity_get_guid(QOF_ENTITY(E))))
#define gncEmployeeRetGUID(E) (E ? *(qof_entity_get_guid(QOF_ENTITY(E))) : *(guid_null()))
#define gncEmployeeLookupDirect(G,B) gncEmployeeLookup((B),&(G))
#endif /* GNC_EMPLOYEE_H_ */

View File

@@ -177,7 +177,7 @@ gboolean gncInvoiceIsPaid (GncInvoice *invoice);
/** deprecated functions */
#define gncInvoiceGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
#define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
#define gncInvoiceRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
#define gncInvoiceRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
#define gncInvoiceLookupDirect(G,B) gncInvoiceLookup((B),&(G))
#endif /* GNC_INVOICE_H_ */

View File

@@ -86,7 +86,7 @@ int gncJobCompare (const GncJob *a, const GncJob *b);
/** deprecated functions */
#define gncJobGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
#define gncJobGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
#define gncJobRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
#define gncJobRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
#define gncJobLookupDirect(G,B) gncJobLookup((B),&(G))
#endif /* GNC_JOB_H_ */

View File

@@ -143,7 +143,7 @@ void gncAccountValueDestroy (GList *list);
/** deprecated routine */
#define gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
#define gncTaxTableRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
#define gncTaxTableRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
#define gncTaxTableLookupDirect(G,B) gncTaxTableLookup((B), &(G))
#endif /* GNC_TAXTABLE_H_ */

View File

@@ -103,7 +103,7 @@ int gncVendorCompare (GncVendor *a, GncVendor *b);
/** deprecated functions */
#define gncVendorGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
#define gncVendorGetGUID(X) qof_instance_get_guid (QOF_INSTANCE(X))
#define gncVendorRetGUID(X) (*(qof_instance_get_guid (QOF_INSTANCE(X))))
#define gncVendorRetGUID(X) (X ? *(qof_instance_get_guid (QOF_INSTANCE(X))) : *(guid_null()))
#define gncVendorLookupDirect(G,B) gncVendorLookup((B),&(G))
#endif /* GNC_VENDOR_H_ */

View File

@@ -166,7 +166,7 @@ int xaccAccountOrder (Account **account_1, Account **account_2);
/** deprecated */
#define xaccAccountGetBook(X) qof_instance_get_book(QOF_INSTANCE(X))
#define xaccAccountGetGUID(X) qof_entity_get_guid(QOF_ENTITY(X))
#define xaccAccountReturnGUID(X) (*(qof_entity_get_guid(QOF_ENTITY(X))))
#define xaccAccountReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
/** The xaccAccountLookup() subroutine will return the
* account associated with the given id, or NULL

View File

@@ -859,10 +859,10 @@ Timespec xaccTransGetVoidTime(const Transaction *tr);
/** deprecated rouitines */
#define xaccSplitGetGUID(X) qof_entity_get_guid(QOF_ENTITY(X))
#define xaccSplitReturnGUID(X) (*(qof_entity_get_guid(QOF_ENTITY(X))))
#define xaccSplitReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
#define xaccTransGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
#define xaccTransGetGUID(X) qof_entity_get_guid(QOF_ENTITY(X))
#define xaccTransReturnGUID(X) (*(qof_entity_get_guid(QOF_ENTITY(X))))
#define xaccTransReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
#define xaccTransGetSlots(X) qof_instance_get_slots (QOF_INSTANCE(X))
#endif /* XACC_TRANSACTION_H */

View File

@@ -69,7 +69,7 @@ qof_instance_release (QofInstance *inst)
const GUID *
qof_instance_get_guid (QofInstance *inst)
{
if (!inst) return guid_null(); /* some callers depend on a real return value */
if (!inst) return NULL;
return &inst->entity.guid;
}