Move "active" code out of debug statements
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Mon, 19 Oct 2009 19:33:02 +0000 (15:33 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 19 Oct 2009 20:50:13 +0000 (16:50 -0400)
Certain g_assert() statements contained expressions that modify the rest of
the program state (eg. modifying variables). As stated in the GLib reference,
g_assert() is a macro that can be compiled out. This would change the behavior
of an otherwise correct lttv.

Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
16 files changed:
lttv/lttv/attribute.c
lttv/lttv/batchtest.c
lttv/lttv/filter.c
lttv/lttv/main.c
lttv/lttv/state.c
lttv/lttv/tracecontext.c
lttv/modules/gui/controlflow/drawitem.c
lttv/modules/gui/detailedevents/events.c
lttv/modules/gui/histogram/histodrawitem.c
lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
lttv/modules/gui/lttvwindow/lttvwindow/init_module.c
lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c
lttv/modules/gui/resourceview/drawitem.c
lttv/modules/text/batchAnalysis.c
lttv/modules/text/precomputeState.c
lttv/modules/text/textFilter.c

index 9966b44814d5aa39c2fa5bc8871e33e59f103958..7ba8f2c5108362368b225c3dce5c931539d503cf 100644 (file)
@@ -339,6 +339,7 @@ void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src)
   Attribute *a;
 
   LttvAttributeValue value;
+  gboolean retval;
 
   nb = src->attributes->len;
 
@@ -355,10 +356,14 @@ void lttv_attribute_recursive_add(LttvAttribute *dest, LttvAttribute *src)
                                                dest, a->name), (LttvAttribute *)(a->value.dv_gobject));
     }
     else {
-                       if(a->is_named)
-             g_assert(lttv_attribute_find(dest, a->name, a->type, &value));
-                       else
-             g_assert(lttv_attribute_find_unnamed(dest, a->name, a->type, &value));
+      if(a->is_named) {
+        retval= lttv_attribute_find(dest, a->name, a->type, &value);
+        g_assert(retval);
+      }
+      else {
+        retval= lttv_attribute_find_unnamed(dest, a->name, a->type, &value);
+        g_assert(retval);
+      }
       switch(a->type) {
              case LTTV_INT:
           *value.v_int += a->value.dv_int;
index be60bb41e2b00d5474e35fff115f6e262d376954..3dd7725e5e58d17dc8ee5d6b1615b3424751994a 100644 (file)
@@ -801,6 +801,7 @@ static void init()
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+  gboolean retval;
 
   g_info("Init batchtest.c");
 
@@ -915,35 +916,43 @@ static void init()
   event_hook = lttv_hooks_new();
   
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_traceset;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_traceset;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_trace;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_trace;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/tracefile/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_tracefile;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_tracefile;
-  //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
-  //    LTTV_POINTER, &value));
+  //retval= lttv_iattribute_find_by_path(attributes, "hooks/event/before",
+  //    LTTV_POINTER, &value);
   //*(value.v_pointer) = before_event;
-  //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after",
-  //    LTTV_POINTER, &value));
+  //retval= lttv_iattribute_find_by_path(attributes, "hooks/event/after",
+  //    LTTV_POINTER, &value);
   //*(value.v_pointer) = after_event;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/event",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = event_hook;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/main/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((main_hooks = *(value.v_pointer)) != NULL);
   lttv_hooks_add(main_hooks, process_traceset, NULL, LTTV_PRIO_DEFAULT);
 }
index 28252b31bdfc3d32a41cf1a28cd9c731c210fa0e..fa5a1559dbd09211c79595315beb9a24cd70738a 100644 (file)
@@ -137,7 +137,8 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) {
   GString* f = NULL;
 
   if(fp->len < 2) return FALSE;
-  g_assert((f=ltt_g_ptr_array_remove_index_slow(fp,0)));
+  f=ltt_g_ptr_array_remove_index_slow(fp,0);
+  g_assert(f);
 
 
   /*
index eca23438b09cd6dc21eda2503598a777c65e705d..e894ac189b76ab7267c795f88b70c67547fc5895 100644 (file)
@@ -95,6 +95,7 @@ int main(int argc, char **argv)
     *profile_memory_long_option = "--memory";
 
   gboolean profile_memory = FALSE;
+  gboolean retval;
 
   LttvAttributeValue value;
 
@@ -136,17 +137,21 @@ int main(int argc, char **argv)
 
   /* Create a number of hooks lists */
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/options/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_options;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/options/after",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_options;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/main/before",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_main;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/main/after",
+      LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_main;
 
 
index 1a245500f8995ea7e211ab071e78f22a2fff6e86..d65ee57f67ef5c78f0cdc11dcdd9b85eb11a687f 100644 (file)
@@ -1707,6 +1707,7 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container)
   LttEventPosition *ep;
 
   LttvTracesetContext *tsc = self->parent.ts_context;
+  int retval;
 
   tracefiles_tree = lttv_attribute_find_subdir(container, 
       LTTV_STATE_TRACEFILES);
@@ -1794,9 +1795,10 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container)
     g_tree_remove(tsc->pqueue, tfc);
     
     if(ep != NULL) {
-      g_assert(ltt_tracefile_seek_position(tfc->tf, ep) == 0);
+      retval= ltt_tracefile_seek_position(tfc->tf, ep);
+      g_assert_cmpint(retval, ==, 0);
       tfc->timestamp = ltt_event_time(ltt_tracefile_get_event(tfc->tf));
-      g_assert(ltt_time_compare(tfc->timestamp, ltt_time_infinite) != 0);
+      g_assert_cmpint(ltt_time_compare(tfc->timestamp, ltt_time_infinite), !=, 0);
       g_tree_insert(tsc->pqueue, tfc, tfc);
       g_info("Restoring state for a tf at time %lu.%lu", tfc->timestamp.tv_sec, tfc->timestamp.tv_nsec);
     } else {
index 710cdecb0ad6f062bff12f9e68733035223f6078..0166e9e34c7d02344ad5f4fe32aaeeb4091cd635 100644 (file)
@@ -1287,7 +1287,10 @@ LttvTracefileContext *lttv_traceset_context_get_current_tfc(LttvTracesetContext
  */
 void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *tsc)
 {
-  g_assert(lttv_process_traceset_seek_position(tsc, tsc->sync_position) == 0);
+  int retval;
+
+  retval= lttv_process_traceset_seek_position(tsc, tsc->sync_position);
+  g_assert_cmpint(retval, ==, 0);
 }
 
 
@@ -1414,6 +1417,7 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self,
   LttTime time_offset;
   struct seek_back_data sd;
   LttvHooks *hooks = lttv_hooks_new();
+  int retval;
   
   sd.first_event = 0;
   sd.events_found = 0;
@@ -1506,11 +1510,13 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self,
     LttvTracesetContextPosition *pos =
       (LttvTracesetContextPosition*)g_ptr_array_index (sd.array,
                                                        sd.first_event);
-    g_assert(lttv_process_traceset_seek_position(self, pos) == 0);
+    retval= lttv_process_traceset_seek_position(self, pos);
+    g_assert_cmpint(retval, ==, 0);
   } else {
     /* Will seek to the last saved position : in the worst case, it will be the
      * original position (if events_found is 0) */
-    g_assert(lttv_process_traceset_seek_position(self, saved_pos) == 0);
+    retval= lttv_process_traceset_seek_position(self, saved_pos);
+    g_assert_cmpint(retval, ==, 0);
   }
   
   for(i=0;i<sd.array->len;i++) {
index d97628b021f3b9abed37236c0693a612328662b5..cdeedda0ddfeb3ac47cb92580d598e05bb882d2b 100644 (file)
@@ -214,6 +214,7 @@ gboolean draw_icon( void *hook_data, void *call_data)
 {
   PropertiesIcon *properties = (PropertiesIcon*)hook_data;
   DrawContext *draw_context = (DrawContext*)call_data;
+  gboolean retval;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
   LttvAttributeValue value;
@@ -222,8 +223,9 @@ gboolean draw_icon( void *hook_data, void *call_data)
 
   strcat(icon_name, properties->icon_name);
   
-  g_assert(lttv_iattribute_find_by_path(attributes, icon_name,
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, icon_name, LTTV_POINTER,
+    &value);
+  g_assert(retval);
   if(unlikely(*(value.v_pointer) == NULL))
   {
     *(value.v_pointer) = icon_info = g_new(IconStruct,1);
index 22bb4208eb11c31c7500a6eda6ff7b11b64eda67..7c9b66accbab489e8ab12cf046d9016b709fb5fa 100644 (file)
@@ -1310,6 +1310,7 @@ static void get_events(double new_value, EventViewerData *event_viewer_data)
   LttvTracesetContext *tsc = (LttvTracesetContext*)tss;
   guint i;
   gboolean seek_by_time;
+  int retval;
   
   if(lttvwindow_preempt_count > 0) return;
 
@@ -1398,7 +1399,8 @@ static void get_events(double new_value, EventViewerData *event_viewer_data)
                                    pos);
        
       } else if(relative_position < 0) {
-        g_assert(lttv_process_traceset_seek_position(tsc, pos) == 0); 
+        retval= lttv_process_traceset_seek_position(tsc, pos);
+               g_assert_cmpint(retval, ==, 0);
       }
     } else {
       /* There is nothing in the list : simply seek to the time value. */
index aafa515d48849a87a08c2fb87a2a953bbeb1929b..73bd3edfbca68b1a61852655f0ec4b716066dc12 100644 (file)
@@ -213,6 +213,7 @@ gboolean histo_draw_icon( void *hook_data, void *call_data)
 {
   histo_PropertiesIcon *properties = (histo_PropertiesIcon*)hook_data;
   histo_DrawContext *draw_context = (histo_DrawContext*)call_data;
+  gboolean retval;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
   LttvAttributeValue value;
@@ -221,8 +222,9 @@ gboolean histo_draw_icon( void *hook_data, void *call_data)
 
   strcat(icon_name, properties->icon_name);
   
-  g_assert(lttv_iattribute_find_by_path(attributes, icon_name,
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, icon_name,
+      LTTV_POINTER, &value);
+  g_assert(retval);
   if(unlikely(*(value.v_pointer) == NULL))
   {
     *(value.v_pointer) = icon_info = g_new(histo_IconStruct,1);
index 0b5756e9a2d318ba609e9d5f889737deb7eb47e2..565cec17a76d5876b3eea4395be020d0e483ed0e 100644 (file)
@@ -553,8 +553,9 @@ int SetTraceset(Tab * tab, LttvTraceset *traceset)
   gint retval = 0;
 
  
-  g_assert( lttv_iattribute_find_by_path(tab->attributes,
-     "hooks/updatetraceset", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
 
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) retval = 1;
@@ -603,8 +604,11 @@ void update_traceset(Tab *tab)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetraceset", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_call(tmp, NULL);
@@ -2100,6 +2104,8 @@ void redraw(GtkWidget *widget, gpointer user_data)
   GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
                       gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
   Tab *tab;
+  gboolean retval;
+
   if(!page) {
     return;
   } else {
@@ -2111,7 +2117,8 @@ void redraw(GtkWidget *widget, gpointer user_data)
   LttvHooks * tmp;
   LttvAttributeValue value;
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw", LTTV_POINTER, &value);
+  g_assert(retval);
 
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL)
@@ -2125,6 +2132,8 @@ void continue_processing(GtkWidget *widget, gpointer user_data)
   GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
                       gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
   Tab *tab;
+  gboolean retval;
+
   if(!page) {
     return;
   } else {
@@ -2136,8 +2145,9 @@ void continue_processing(GtkWidget *widget, gpointer user_data)
   LttvHooks * tmp;
   LttvAttributeValue value;
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-     "hooks/continue", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/continue",
+    LTTV_POINTER, &value);
+  g_assert(retval);
 
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL)
@@ -3307,17 +3317,20 @@ on_MWindow_destroy                     (GtkWidget       *widget,
   MainWindow *main_window = get_window_data_struct(widget);
   LttvIAttribute *attributes = main_window->attributes;
   LttvAttributeValue value;
+  gboolean retval;
  
   //This is unnecessary, since widgets will be destroyed
   //by the main window widget anyway.
   //remove_all_menu_toolbar_constructors(main_window, NULL);
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-           "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   lttv_menus_destroy((LttvMenus*)*(value.v_pointer));
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-           "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   lttv_toolbars_destroy((LttvToolbars*)*(value.v_pointer));
 
   g_object_unref(main_window->attributes);
@@ -3914,8 +3927,10 @@ void current_position_change_manager(Tab *tab,
   LttvTracesetContext *tsc =
     LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
   TimeInterval time_span = tsc->time_span;
+  int retval;
 
-  g_assert(lttv_process_traceset_seek_position(tsc, pos) == 0);
+  retval= lttv_process_traceset_seek_position(tsc, pos);
+  g_assert_cmpint(retval, ==, 0);
   LttTime new_time = lttv_traceset_context_position_get_time(pos);
   /* Put the context in a state coherent position */
   lttv_state_traceset_seek_time_closest((LttvTracesetState*)tsc, ltt_time_zero);
@@ -4170,29 +4185,32 @@ void add_all_menu_toolbar_constructors(MainWindow * mw, gpointer user_data)
   LttvIAttribute *global_attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
   LttvIAttribute *attributes = mw->attributes;
   GtkWidget * tool_menu_title_menu, *new_widget, *pixmap;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(global_attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(global_attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   global_menu = (LttvMenus*)*(value.v_pointer);
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   instance_menu = (LttvMenus*)*(value.v_pointer);
 
-
-
-  g_assert(lttv_iattribute_find_by_path(global_attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(global_attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   global_toolbar = (LttvToolbars*)*(value.v_pointer);
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   instance_toolbar = (LttvToolbars*)*(value.v_pointer);
@@ -4262,6 +4280,8 @@ void add_all_menu_toolbar_constructors(MainWindow * mw, gpointer user_data)
 
 MainWindow *construct_main_window(MainWindow * parent)
 {
+  gboolean retval;
+
   g_debug("construct_main_window()");
   GtkWidget  * new_window; /* New generated main window */
   MainWindow * new_m_window;/* New main window structure */
@@ -4282,12 +4302,14 @@ MainWindow *construct_main_window(MainWindow * parent)
   new_m_window->mwindow = new_window;
   new_m_window->attributes = attributes;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-           "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = lttv_menus_new();
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-           "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = lttv_toolbars_new();
 
   add_all_menu_toolbar_constructors(new_m_window, NULL);
index 83d35c96ca0ed274bd1f4c0cb38d2a28e4318c93..7689aa32abc39c9941131cb3e85edaea7114bd81 100644 (file)
@@ -134,6 +134,7 @@ static gboolean window_creation_hook(void *hook_data, void *call_data)
 static void init() {
 
   LttvAttributeValue value;
+  gboolean retval;
  
   // Global attributes only used for interaction with main() here.
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
@@ -173,8 +174,9 @@ static void init() {
       "pathname of the directory containing the trace", 
       LTTV_OPT_STRING, &a_trace, lttv_trace_option, NULL);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/main/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((main_hooks = *(value.v_pointer)) != NULL);
 
   lttv_hooks_add(main_hooks, window_creation_hook, NULL, LTTV_PRIO_DEFAULT);
index ebbaa06fd37fdeb050237b779238d2de4660136e..d48602082c37b3ebe98a6712647db824160ff3dd 100644 (file)
@@ -65,6 +65,7 @@ void set_time_window(Tab *tab, const TimeWindow *time_window)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   TimeWindowNotifyData time_window_notify_data;
   TimeWindow old_time_window = tab->time_window;
@@ -73,8 +74,9 @@ void set_time_window(Tab *tab, const TimeWindow *time_window)
   time_window_notify_data.new_time_window = 
                           &(tab->time_window);
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL) lttv_hooks_call(tmp, &time_window_notify_data);
 
@@ -94,11 +96,13 @@ void set_current_time(Tab *tab, const LttTime *current_time)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   tab->current_time = *current_time;
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL) lttv_hooks_call(tmp, &tab->current_time);
 }
@@ -115,11 +119,13 @@ void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   tab->current_time = lttv_traceset_context_position_get_time(pos);
 
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp != NULL) lttv_hooks_call(tmp, pos);
 }
@@ -132,9 +138,11 @@ void add_toolbar_constructor(MainWindow *mw, LttvToolbarClosure *toolbar_c)
   lttvwindow_viewer_constructor constructor;
   GtkWidget * tool_menu_title_menu, *new_widget, *pixmap;
   GdkPixbuf *pixbuf;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   instance_toolbar = (LttvToolbars*)*(value.v_pointer);
@@ -176,9 +184,11 @@ void add_menu_constructor(MainWindow *mw, LttvMenuClosure *menu_c)
   LttvToolbars * instance_menu;
   lttvwindow_viewer_constructor constructor;
   GtkWidget * tool_menu_title_menu, *new_widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   instance_menu = (LttvMenus*)*(value.v_pointer);
@@ -206,9 +216,11 @@ void remove_toolbar_constructor(MainWindow *mw, lttvwindow_viewer_constructor vi
   LttvAttributeValue value;
   LttvToolbars * instance_toolbar;
   GtkWidget * tool_menu_title_menu, *widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_toolbars_new();
   instance_toolbar = (LttvToolbars*)*(value.v_pointer);
@@ -226,9 +238,11 @@ void remove_menu_constructor(MainWindow *mw, lttvwindow_viewer_constructor viewe
   LttvAttributeValue value;
   LttvMenus * instance_menu;
   GtkWidget * tool_menu_title_menu, *widget;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes,
-          "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   if(*(value.v_pointer) == NULL)
     *(value.v_pointer) = lttv_menus_new();
   instance_menu = (LttvMenus*)*(value.v_pointer);
@@ -274,12 +288,14 @@ __EXPORT void lttvwindow_register_constructor
   LttvToolbarClosure toolbar_c;
   LttvMenuClosure menu_c;
   LttvAttributeValue value;
+  gboolean retval;
 
   if(view_constructor == NULL) return;
   
   if(pixmap != NULL) {
-    g_assert(lttv_iattribute_find_by_path(attributes_global,
-       "viewers/toolbar", LTTV_POINTER, &value));
+    retval= lttv_iattribute_find_by_path(attributes_global, "viewers/toolbar",
+      LTTV_POINTER, &value);
+    g_assert(retval);
     toolbar = (LttvToolbars*)*(value.v_pointer);
 
     if(toolbar == NULL) {
@@ -295,8 +311,9 @@ __EXPORT void lttvwindow_register_constructor
   }
 
   if(menu_path != NULL) {
-    g_assert(lttv_iattribute_find_by_path(attributes_global,
-       "viewers/menu", LTTV_POINTER, &value));
+    retval= lttv_iattribute_find_by_path(attributes_global, "viewers/menu",
+      LTTV_POINTER, &value);
+    g_assert(retval);
     menu = (LttvMenus*)*(value.v_pointer);
     
     if(menu == NULL) {
@@ -346,10 +363,12 @@ __EXPORT void lttvwindow_unregister_constructor
   LttvToolbars * toolbar;
   LttvMenus * menu;
   LttvAttributeValue value;
-       gboolean is_named;
+  gboolean is_named;
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes_global,
-     "viewers/toolbar", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes_global, "viewers/toolbar",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   toolbar = (LttvToolbars*)*(value.v_pointer);
   
   if(toolbar != NULL) {
@@ -359,8 +378,9 @@ __EXPORT void lttvwindow_unregister_constructor
     lttv_toolbars_remove(toolbar, view_constructor);
   }
 
-  g_assert(lttv_iattribute_find_by_path(attributes_global,
-     "viewers/menu", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes_global, "viewers/menu",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   menu = (LttvMenus*)*(value.v_pointer);
   
   if(menu != NULL) {
@@ -408,8 +428,11 @@ __EXPORT void lttvwindow_register_time_window_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -432,8 +455,11 @@ __EXPORT void lttvwindow_unregister_time_window_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetimewindow", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimewindow", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -452,8 +478,11 @@ __EXPORT void lttvwindow_register_traceset_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetraceset", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -476,8 +505,11 @@ __EXPORT void lttvwindow_unregister_traceset_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatetraceset", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetraceset", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -496,8 +528,11 @@ __EXPORT void lttvwindow_register_redraw_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/redraw", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -520,8 +555,11 @@ __EXPORT void lttvwindow_unregister_redraw_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/redraw", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -546,8 +584,11 @@ __EXPORT void lttvwindow_register_continue_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/continue", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/continue",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -571,8 +612,11 @@ __EXPORT void lttvwindow_unregister_continue_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/continue", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/continue",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -592,8 +636,11 @@ __EXPORT void lttvwindow_register_filter_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -617,8 +664,11 @@ __EXPORT void lttvwindow_unregister_filter_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -637,8 +687,11 @@ __EXPORT void lttvwindow_register_current_time_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -661,8 +714,11 @@ __EXPORT void lttvwindow_unregister_current_time_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrenttime", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrenttime", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -681,8 +737,11 @@ __EXPORT void lttvwindow_register_current_position_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -705,8 +764,11 @@ __EXPORT void lttvwindow_unregister_current_position_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatecurrentposition", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatecurrentposition", LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -726,8 +788,11 @@ void lttvwindow_register_show_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/showviewer", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/showviewer",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -750,8 +815,11 @@ void lttvwindow_unregister_show_notify(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/showviewer", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/showviewer",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -770,8 +838,11 @@ void lttvwindow_register_dividor(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL){    
     tmp = lttv_hooks_new();
@@ -795,8 +866,11 @@ void lttvwindow_unregister_dividor(Tab *tab,
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_remove_data(tmp, hook, hook_data);
@@ -903,8 +977,11 @@ void lttvwindow_report_dividor(Tab *tab, gint position)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/hpanedividor", LTTV_POINTER, &value));
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/hpanedividor",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_call(tmp, &position);
@@ -1075,12 +1152,14 @@ void lttvwindow_report_filter(Tab *tab, LttvFilter *filter)
 {
   LttvAttributeValue value;
   LttvHooks * tmp;
+  gboolean retval;
 
   //lttv_filter_destroy(tab->filter);
   //tab->filter = filter;
   
-  g_assert(lttv_iattribute_find_by_path(tab->attributes,
-           "hooks/updatefilter", LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(tab->attributes, "hooks/updatefilter",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   tmp = (LttvHooks*)*(value.v_pointer);
   if(tmp == NULL) return;
   lttv_hooks_call(tmp, filter);
index d97628b021f3b9abed37236c0693a612328662b5..5397f25bc8f3ecccdcf6e98983efe7afc6e83b73 100644 (file)
@@ -219,11 +219,13 @@ gboolean draw_icon( void *hook_data, void *call_data)
   LttvAttributeValue value;
   gchar icon_name[MAX_PATH_LEN] = "icons/";
   IconStruct *icon_info;
+  gboolean retval;
 
   strcat(icon_name, properties->icon_name);
   
-  g_assert(lttv_iattribute_find_by_path(attributes, icon_name,
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, icon_name, LTTV_POINTER,
+         &value);
+  g_assert(retval);
   if(unlikely(*(value.v_pointer) == NULL))
   {
     *(value.v_pointer) = icon_info = g_new(IconStruct,1);
index f78f37749f28e27f7d4f22ae5bfe6eea600f5c71..00286e2cc7066de96ad8a7cc29c94fa3e8ec79c7 100644 (file)
@@ -74,6 +74,7 @@ static gboolean process_traceset(void *hook_data, void *call_data)
   LttvTracesetContext *tc;
 
   LttTime start, end;
+  gboolean retval;
 
   g_info("BatchAnalysis begin process traceset");
 
@@ -91,11 +92,13 @@ static gboolean process_traceset(void *hook_data, void *call_data)
   lttv_state_add_event_hooks(tc);
   if(a_stats) lttv_stats_add_event_hooks(tscs);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
-      LTTV_POINTER, &value_expression));
+  retval= lttv_iattribute_find_by_path(attributes, "filter/expression",
+    LTTV_POINTER, &value_expression);
+  g_assert(retval);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/lttv_filter",
-      LTTV_POINTER, &value_filter));
+  retval= lttv_iattribute_find_by_path(attributes, "filter/lttv_filter",
+    LTTV_POINTER, &value_filter);
+  g_assert(retval);
 
   *(value_filter.v_pointer) = lttv_filter_new();
   //g_debug("Filter string: %s",((GString*)*(value_expression.v_pointer))->str);
@@ -157,6 +160,7 @@ static void init()
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+  gboolean retval;
 
   g_info("Init batchAnalysis.c");
 
@@ -184,23 +188,29 @@ static void init()
   //after_event = lttv_hooks_new();
   event_hook = lttv_hooks_new();
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_traceset;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_traceset;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_trace;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_trace;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/tracefile/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = before_tracefile;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = after_tracefile;
   //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
   //    LTTV_POINTER, &value));
@@ -208,12 +218,14 @@ static void init()
   //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after",
   //    LTTV_POINTER, &value));
   //*(value.v_pointer) = after_event;
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/event",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   *(value.v_pointer) = event_hook;
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/main/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((main_hooks = *(value.v_pointer)) != NULL);
   lttv_hooks_add(main_hooks, process_traceset, NULL, LTTV_PRIO_DEFAULT);
 }
index f23937b97544db3f9a1a75767158c34de7e3d91b..a6e015b55f0817e6d415cf6d06b0d543c3aa6715 100644 (file)
@@ -202,6 +202,7 @@ static void init()
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+  gboolean retval;
 
   g_info("Init precomputeState.c");
 
@@ -224,29 +225,34 @@ static void init()
       "Raw binary", 
       LTTV_OPT_NONE, &a_raw, NULL, NULL);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/event",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((event_hook = *(value.v_pointer)) != NULL);
   lttv_hooks_add(event_hook, for_each_event, &a_event_count, LTTV_PRIO_DEFAULT);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((before_trace = *(value.v_pointer)) != NULL);
   lttv_hooks_add(before_trace, write_trace_header, NULL, LTTV_PRIO_DEFAULT);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/after",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((after_trace = *(value.v_pointer)) != NULL);
   lttv_hooks_add(after_trace, write_trace_footer, NULL, LTTV_PRIO_DEFAULT);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/before",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((before_traceset = *(value.v_pointer)) != NULL);
   lttv_hooks_add(before_traceset, write_traceset_header, NULL,
       LTTV_PRIO_DEFAULT);
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/after",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   g_assert((after_traceset = *(value.v_pointer)) != NULL);
   lttv_hooks_add(after_traceset, write_traceset_footer, NULL,
       LTTV_PRIO_DEFAULT);
index 27425201dd9a246741031655165dc34a990adbbf..28b5c8ee9e7933b92986a90891426d699ff2a756 100644 (file)
@@ -67,6 +67,7 @@ void filter_analyze_file(void *hook_data) {
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+  gboolean retval;
 
   /*
         *      User may specify filtering options through static file
@@ -82,8 +83,6 @@ void filter_analyze_file(void *hook_data) {
 
   g_file_get_contents(a_file_name,&a_file_content,NULL,NULL);
   
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
-      LTTV_POINTER, &value));
 
   if(((GString*)*(value.v_pointer))->len != 0)
       g_string_append_c((GString*)*(value.v_pointer),'&');
@@ -91,6 +90,9 @@ void filter_analyze_file(void *hook_data) {
     g_string_append((GString*)*(value.v_pointer),a_file_content);
     g_string_append_c((GString*)*(value.v_pointer),')');
   
+  retval= lttv_iattribute_find_by_path(attributes, "filter/expression",
+    LTTV_POINTER, &value);
+  g_assert(retval);
 }
 
 /**
@@ -102,14 +104,13 @@ void filter_analyze_string(void *hook_data) {
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
-  
+  gboolean retval;
+
   /*
         *      User may specify filtering options through static file
         *      and/or command line string.  From these sources, an 
         *      option string is rebuilded and sent to the filter core
         */
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
-      LTTV_POINTER, &value));
 
   if(((GString*)*(value.v_pointer))->len != 0)
       g_string_append_c((GString*)*(value.v_pointer),'&');
@@ -117,6 +118,9 @@ void filter_analyze_string(void *hook_data) {
     g_string_append((GString*)*(value.v_pointer),a_string);
     g_string_append_c((GString*)*(value.v_pointer),')');
 
+  retval= lttv_iattribute_find_by_path(attributes, "filter/expression",
+    LTTV_POINTER, &value);
+  g_assert(retval);
 }
 
 /**
@@ -168,9 +172,11 @@ static void init() {
   LttvAttributeValue value;
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+  gboolean retval;
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "filter/expression",
+    LTTV_POINTER, &value);
+  g_assert(retval);
   
   *(value.v_pointer) = g_string_new("");
 
@@ -200,6 +206,8 @@ static void init() {
  *     Destroy the current module
  */
 static void destroy() {
+  gboolean retval;
+
   g_info("Destroy textFilter");
 
   lttv_option_remove("expression");
@@ -212,8 +220,9 @@ static void destroy() {
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
 
-  g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
-      LTTV_POINTER, &value));
+  retval= lttv_iattribute_find_by_path(attributes, "filter/expression",
+    LTTV_POINTER, &value);
+  g_assert(retval);
  
   g_string_free((GString*)*(value.v_pointer),TRUE);
   
This page took 0.039534 seconds and 4 git commands to generate.