[Gnucash-changes] r13546 - gnucash/trunk - Fix the definition of QOF_EVENT_BASE; use QOF_EVENT__LAST for tests.

Derek Atkins warlord at cvs.gnucash.org
Wed Mar 8 22:33:01 EST 2006


Author: warlord
Date: 2006-03-08 22:33:00 -0500 (Wed, 08 Mar 2006)
New Revision: 13546
Trac: http://svn.gnucash.org/trac/changeset/13546

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/lib/libqof/qof/qofevent.c
   gnucash/trunk/lib/libqof/qof/qofevent.h
Log:
Fix the definition of QOF_EVENT_BASE; use QOF_EVENT__LAST for tests.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-09 02:29:29 UTC (rev 13545)
+++ gnucash/trunk/ChangeLog	2006-03-09 03:33:00 UTC (rev 13546)
@@ -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 at tuhh.de>
 
 	* src/gnc-module/gnc-module.c, src/backend/file/sixtp-utils.c:

Modified: gnucash/trunk/lib/libqof/qof/qofevent.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofevent.c	2006-03-09 02:29:29 UTC (rev 13545)
+++ gnucash/trunk/lib/libqof/qof/qofevent.c	2006-03-09 03:33:00 UTC (rev 13546)
@@ -205,7 +205,7 @@
 
   g_return_if_fail(entity);
 
-  if (event_id <= QOF_EVENT_BASE)
+  if (event_id <= QOF_EVENT__LAST)
   {
     use_old_handlers = TRUE;
   }

Modified: gnucash/trunk/lib/libqof/qof/qofevent.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofevent.h	2006-03-09 02:29:29 UTC (rev 13545)
+++ gnucash/trunk/lib/libqof/qof/qofevent.h	2006-03-09 03:33:00 UTC (rev 13546)
@@ -51,8 +51,12 @@
 #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.
 
 These defaults merely replicate previous behaviour,
@@ -64,13 +68,10 @@
 #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)
+/* Note that events 5, 6, and 7 are "undefined" as of 2006-03-08 */
 
-/** Allow scope for more defaults in future. Additional
-event identifiers must be larger than this. */
-#define QOF_EVENT_BASE  QOF_EVENT__LAST
-
 /** \brief Handler invoked when an event is generated.
  *
  * @param ent:      Entity generating the event



More information about the gnucash-changes mailing list