Fix the definition of QOF_EVENT_BASE; use QOF_EVENT__LAST for tests.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13546 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2006-03-09 03:33:00 +00:00
parent 41db89c516
commit db890792bb
3 changed files with 11 additions and 7 deletions

View File

@ -13,6 +13,9 @@
* src/engine/gnc-filepath-utils.c:
gstdio.h and g_mkdir are in glib-2.6 -- use old APIs with glib-2.4.
* lib/libqof/qof/qofevent.[ch]:
Fix the definition of QOF_EVENT_BASE; use QOF_EVENT__LAST for tests.
2006-03-08 Christian Stimming <stimming@tuhh.de>
* src/gnc-module/gnc-module.c, src/backend/file/sixtp-utils.c:

View File

@ -205,7 +205,7 @@ qof_event_generate_internal (QofEntity *entity, QofEventId event_id,
g_return_if_fail(entity);
if (event_id <= QOF_EVENT_BASE)
if (event_id <= QOF_EVENT__LAST)
{
use_old_handlers = TRUE;
}

View File

@ -51,7 +51,11 @@ events added within QOF.
#define APP_EVENT_B QOF_MAKE_EVENT(QOF_EVENT_BASE+1)
/endverbatim
*/
#define QOF_MAKE_EVENT(x) (1<<x)
#define QOF_MAKE_EVENT(x) (1<<(x))
/** Allow scope for more defaults in future. Additional
event identifiers must be based on this when using QOF_MAKE_EVENT(). */
#define QOF_EVENT_BASE 8
/** \brief Default events for backwards compatibility.
@ -64,12 +68,9 @@ any process can define their own events.
#define QOF_EVENT_DESTROY QOF_MAKE_EVENT(2)
#define QOF_EVENT_ADD QOF_MAKE_EVENT(3)
#define QOF_EVENT_REMOVE QOF_MAKE_EVENT(4)
#define QOF_EVENT__LAST QOF_EVENT_REMOVE
#define QOF_EVENT__LAST QOF_MAKE_EVENT(QOF_EVENT_BASE-1)
#define QOF_EVENT_ALL (0xff)
/** Allow scope for more defaults in future. Additional
event identifiers must be larger than this. */
#define QOF_EVENT_BASE QOF_EVENT__LAST
/* Note that events 5, 6, and 7 are "undefined" as of 2006-03-08 */
/** \brief Handler invoked when an event is generated.
*