[beast/devel: 36/77] BSE: use BSE_KEY_DEBUG() and bse_debug_enabled() for engine debugging



commit 0d0cbc0f68912243b9e9403106ce0e302388df31
Author: Tim Janik <timj gnu org>
Date:   Sun Apr 7 19:38:50 2013 +0200

    BSE: use BSE_KEY_DEBUG() and bse_debug_enabled() for engine debugging

 bse/bseenginemaster.cc   |    8 ++++----
 bse/bseengineschedule.cc |    7 +++++--
 bse/bseprocedure.cc      |    6 +++---
 bse/bseundostack.cc      |    6 +++---
 4 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/bse/bseenginemaster.cc b/bse/bseenginemaster.cc
index c068aff..3dab8ef 100644
--- a/bse/bseenginemaster.cc
+++ b/bse/bseenginemaster.cc
@@ -12,10 +12,10 @@
 #include <sys/poll.h>
 #include <sys/time.h>
 #include <errno.h>
-static SFI_MSG_TYPE_DEFINE (debug_job, "job", SFI_MSG_DEBUG, NULL);
-#define JOB_DEBUG(...)  sfi_debug (debug_job, __VA_ARGS__)
-static SFI_MSG_TYPE_DEFINE (debug_tjob, "tjob", SFI_MSG_DEBUG, NULL);
-#define TJOB_DEBUG(...) sfi_debug (debug_tjob, __VA_ARGS__)
+
+#define JOB_DEBUG(...)  BSE_KEY_DEBUG ("job", __VA_ARGS__)
+#define TJOB_DEBUG(...) BSE_KEY_DEBUG ("tjob", __VA_ARGS__)
+
 #define        NODE_FLAG_RECONNECT(node)  G_STMT_START { /*(node)->needs_reset = TRUE*/; } G_STMT_END
 /* --- time stamping (debugging) --- */
 #define        ToyprofStamp            struct timeval
diff --git a/bse/bseengineschedule.cc b/bse/bseengineschedule.cc
index 4d1fc3b..4d03c68 100644
--- a/bse/bseengineschedule.cc
+++ b/bse/bseengineschedule.cc
@@ -1,7 +1,10 @@
 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
 #include "bseengineschedule.hh"
 #include "bseengineutils.hh"
-static SFI_MSG_TYPE_DEFINE (debug_sched, "sched", SFI_MSG_DEBUG, NULL);
+
+#define SCHED_DEBUG(...) BSE_KEY_DEBUG ("sched", __VA_ARGS__)
+#define CHECK_DEBUG()    Bse::bse_debug_enabled ("sched")
+
 /* --- prototypes --- */
 static void    schedule_node           (EngineSchedule *schedule,
                                         EngineNode     *node,
@@ -246,7 +249,7 @@ _engine_schedule_secure (EngineSchedule *sched)
   g_return_if_fail (sched->secured == FALSE);
   sched->secured = TRUE;
   sched->cur_leaf_level = sched->leaf_levels;
-  if (sfi_msg_check (debug_sched))
+  if (CHECK_DEBUG())
     _engine_schedule_debug_dump (sched);
 }
 static void
diff --git a/bse/bseprocedure.cc b/bse/bseprocedure.cc
index 4670283..d0f5752 100644
--- a/bse/bseprocedure.cc
+++ b/bse/bseprocedure.cc
@@ -8,8 +8,8 @@
 #include "bseexports.hh"
 #include <string.h>
 
-#define PDEBUG(...)       BSE_KEY_DEBUG ("procs", __VA_ARGS__)
-#define PDEBUG_ENABLED()  Bse::bse_debug_enabled ("procs")
+#define PDEBUG(...)     BSE_KEY_DEBUG ("procs", __VA_ARGS__)
+#define CHECK_DEBUG()   Bse::bse_debug_enabled ("procs")
 #define HACK_DEBUG /* very slow and leaks memory */ while (0) g_printerr
 
 /* --- macros --- */
@@ -215,7 +215,7 @@ bse_procedure_call (BseProcedureClass  *proc,
     error = BSE_ERROR_PROC_PARAM_INVAL;
   else
     {
-      if (PDEBUG_ENABLED())
+      if (CHECK_DEBUG())
         {
           if (proc->n_in_pspecs && G_TYPE_IS_OBJECT (G_PARAM_SPEC_VALUE_TYPE (proc->in_pspecs[0])))
             PDEBUG ("executing procedure \"%s\" on object %s",
diff --git a/bse/bseundostack.cc b/bse/bseundostack.cc
index 9702ce7..df4182b 100644
--- a/bse/bseundostack.cc
+++ b/bse/bseundostack.cc
@@ -4,8 +4,8 @@
 #include "bsecontainer.hh"
 #include <string.h>
 
-#define UDEBUG(...)       BSE_KEY_DEBUG ("undo", __VA_ARGS__)
-#define UDEBUG_ENABLED()  Bse::bse_debug_enabled ("undo")
+#define UDEBUG(...)     BSE_KEY_DEBUG ("undo", __VA_ARGS__)
+#define CHECK_DEBUG()   Bse::bse_debug_enabled ("undo")
 
 /* --- functions --- */
 BseUndoStack*
@@ -271,7 +271,7 @@ bse_undo_stack_undo (BseUndoStack *self)
       self->n_undo_groups--;
       self->dirt_counter--;
       UDEBUG ("EXECUTE UNDO: %s", group->name);
-      if (UDEBUG_ENABLED())
+      if (CHECK_DEBUG())
         {
           SfiRing *ring = group->undo_steps;
           for (ring = group->undo_steps; ring; ring = sfi_ring_walk (ring, group->undo_steps))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]