fix hooks to return a gint instead of a gboolean : makes returning 2 possible
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 7 Sep 2005 20:46:51 +0000 (20:46 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 7 Sep 2005 20:46:51 +0000 (20:46 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1152 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/hook.c
ltt/branches/poly/lttv/lttv/tracecontext.c

index 0ec856535df6ec094a2ab65cf5c361e2fb252f1a..c7b43a50b956c5517538ef28b6a63dd4db04d8ce 100644 (file)
@@ -297,10 +297,10 @@ gboolean lttv_hooks_call_check(LttvHooks *h, void *call_data)
  * The second case that should occur the most often is
  * h1 != NULL , h2 == NULL.
  */
-gboolean lttv_hooks_call_merge(LttvHooks *h1, void *call_data1,
+gint lttv_hooks_call_merge(LttvHooks *h1, void *call_data1,
                                LttvHooks *h2, void *call_data2)
 {
-  gboolean ret, sum_ret = FALSE;
+  gint ret, sum_ret = 0;
 
   LttvHookClosure *c1, *c2;
 
@@ -313,12 +313,12 @@ gboolean lttv_hooks_call_merge(LttvHooks *h1, void *call_data1,
         c2 = &g_array_index(h2, LttvHookClosure, j);
         if(c1->prio <= c2->prio) {
           ret = c1->hook(c1->hook_data,call_data1);
-          sum_ret = sum_ret || ret;
+          sum_ret = sum_ret | ret;
           i++;
         }
         else {
           ret = c2->hook(c2->hook_data,call_data2);
-          sum_ret = sum_ret || ret;
+          sum_ret = sum_ret | ret;
           j++;
         }
       }
@@ -326,25 +326,25 @@ gboolean lttv_hooks_call_merge(LttvHooks *h1, void *call_data1,
       for(;i < h1->len; i++) {
         c1 = &g_array_index(h1, LttvHookClosure, i);
         ret = c1->hook(c1->hook_data,call_data1);
-        sum_ret = sum_ret || ret;
+        sum_ret = sum_ret | ret;
       }
       for(;j < h2->len; j++) {
         c2 = &g_array_index(h2, LttvHookClosure, j);
         ret = c2->hook(c2->hook_data,call_data2);
-        sum_ret = sum_ret || ret;
+        sum_ret = sum_ret | ret;
       }
     } else {  /* h1 != NULL && h2 == NULL */
       for(i = 0 ; i < h1->len ; i++) {
         c1 = &g_array_index(h1, LttvHookClosure, i);
         ret = c1->hook(c1->hook_data,call_data1);
-        sum_ret = sum_ret || ret;
+        sum_ret = sum_ret | ret;
       }
     }
   } else if(likely(h2 != NULL)) { /* h1 == NULL && h2 != NULL */
      for(j = 0 ; j < h2->len ; j++) {
       c2 = &g_array_index(h2, LttvHookClosure, j);
       ret = c2->hook(c2->hook_data,call_data2);
-      sum_ret = sum_ret || ret;
+      sum_ret = sum_ret | ret;
     }
   }
 
index ab9b7eaa09689f9134366191601f9c799e298e11..8634b1be564dc835ebddcac73495b71e586e6670 100644 (file)
@@ -703,7 +703,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self,
 
   //enum read_state last_read_state = LAST_NONE;
 
-  gboolean last_ret = FALSE; /* return value of the last hook list called */
+  gint last_ret = 0; /* return value of the last hook list called */
 
   /* Get the next event from the pqueue, call its hooks, 
      reinsert in the pqueue the following event from the same tracefile 
This page took 0.025704 seconds and 4 git commands to generate.