Correct syntax, not done but release often they say :-(
[lttv.git] / ltt / branches / poly / lttv / hook.c
index 12f121986606473f211a86a533c648f4d2c66e8f..5edc62303c5638163d40585d2995f42d210b7f10 100644 (file)
@@ -1,8 +1,9 @@
+
 #include <lttv/hook.h>
 
 
 typedef struct _LttvHookClosure {
-  lttv_hook hook;
+  LttvHook hook;
   void *hook_data;
 } LttvHookClosure;
 
@@ -35,6 +36,7 @@ void lttv_hooks_add_list(LttvHooks *h, LttvHooks *list)
 {
   guint i;
 
+  if(list == NULL) return;
   for(i = 0 ; i < list->len; i++) {
     g_array_append_val(h,g_array_index(list, LttvHookClosure, i));
   }
@@ -83,6 +85,7 @@ void lttv_hooks_remove_list(LttvHooks *h, LttvHooks *list)
 
   LttvHookClosure *c, *c_list;
 
+  if(list == NULL) return;
   for(i = 0, j = 0 ; i < h->len && j < list->len ;) {
     c = &g_array_index(h, LttvHookClosure, i);
     c_list = &g_array_index(list, LttvHookClosure, j);
@@ -121,9 +124,9 @@ void lttv_hooks_get(LttvHooks *h, unsigned i, LttvHook *f, void **hook_data)
 }
 
 
-void lttv_hooks_remove_by_position(LttvHooks *h, unsigned i);
+void lttv_hooks_remove_by_position(LttvHooks *h, unsigned i)
 {
-  g_array_remove_index(h, i)
+  g_array_remove_index(h, i);
 }
 
 
@@ -133,6 +136,8 @@ gboolean lttv_hooks_call(LttvHooks *h, void *call_data)
 
   LttvHookClosure *c;
 
+  guint i;
+
   if(h != NULL) {
     for(i = 0 ; i < h->len ; i++) {
       c = &g_array_index(h, LttvHookClosure, i);
@@ -147,6 +152,8 @@ gboolean lttv_hooks_call_check(LttvHooks *h, void *call_data)
 {
   LttvHookClosure *c;
 
+  guint i;
+
   for(i = 0 ; i < h->len ; i++) {
     c = &g_array_index(h, LttvHookClosure, i);
     if(c->hook(c->hook_data,call_data)) return TRUE;
@@ -172,7 +179,7 @@ void lttv_hooks_by_id_destroy(LttvHooksById *h)
 }
 
 
-LttvHooks *lttv_hooks_by_id_find(LttvHooksById *h, unsigned id);
+LttvHooks *lttv_hooks_by_id_find(LttvHooksById *h, unsigned id)
 {
   if(h->len <= id) g_ptr_array_set_size(h, id + 1);
   if(h->pdata[id] == NULL) h->pdata[id] = lttv_hooks_new();
This page took 0.02434 seconds and 4 git commands to generate.