warning fixed for lttvwindow and controlflow view
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 15 Aug 2004 05:52:38 +0000 (05:52 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 15 Aug 2004 05:52:38 +0000 (05:52 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@773 04897980-b3bd-0310-b5e0-8ef037075253

17 files changed:
ltt/branches/poly/ltt/trace.h
ltt/branches/poly/lttv/lttv/hook.h
ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c
ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c
ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h
ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c
ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c
ltt/branches/poly/lttv/modules/gui/controlflow/module.c
ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c
ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/menu.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c

index 73adc0bffd0adae25032957e113e5c1ed970fe89..96931524af3a814acb4bba0b8520c91351b8eb5d 100644 (file)
@@ -173,5 +173,6 @@ LttTracefile *ltt_tracefile_new();
 void ltt_tracefile_destroy(LttTracefile *tf);
 void ltt_tracefile_copy(LttTracefile *dest, const LttTracefile *src);
 
+void get_absolute_pathname(const char *pathname, char * abs_pathname);
 
 #endif // TRACE_H
index 7da21346f2c2cd3f82b55e3e658bed53b0ed49f6..1227203514dd20a18d51cffded051b56fcb73bcd 100644 (file)
@@ -22,6 +22,7 @@
 #define HOOK_H
 
 #include <glib.h>
+#include <ltt/compiler.h>
 
 /* A hook is a function to call with the supplied hook data, and with 
    call site specific data (e.g., hooks for events are called with a 
index ce77e4d5ecf936245cccc31e24e68d90735ce777..0917305aa4235ac51106bd5a9bc2a8421abea12c 100644 (file)
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
+#include <lttv/lttv.h>
+#include <lttvwindow/lttvwindow.h>
 
 #include "cfv.h"
 #include "drawing.h"
 #include "processlist.h"
 #include "eventhooks.h"
-#include <lttv/lttv.h>
 
 extern GSList *g_control_flow_data_list;
 
index 918d8c3bc5110c643cb7eb19075017a002eb95be..9030a37b49367ca6a4dcdb996769f4c267acc548 100644 (file)
@@ -20,6 +20,8 @@
 #include <gdk/gdk.h>
 #include <string.h>
 
+#include <ltt/trace.h>
+
 #include <lttv/lttv.h>
 #include <lttv/tracecontext.h>
 #include <lttvwindow/lttvwindow.h>
@@ -126,13 +128,13 @@ void drawing_data_request(Drawing_t *drawing,
   LttTime start, time_end;
   LttTime window_end = time_window.end_time;
 
-  g_debug("req : window start_time : %u, %u", time_window.start_time.tv_sec, 
+  g_debug("req : window start_time : %lu, %lu", time_window.start_time.tv_sec, 
                                        time_window.start_time.tv_nsec);
 
-  g_debug("req : window time width : %u, %u", time_window.time_width.tv_sec, 
+  g_debug("req : window time width : %lu, %lu", time_window.time_width.tv_sec, 
                                        time_window.time_width.tv_nsec);
   
-  g_debug("req : window_end : %u, %u", window_end.tv_sec, 
+  g_debug("req : window_end : %lu, %lu", window_end.tv_sec, 
                                        window_end.tv_nsec);
 
   g_debug("x is : %i, x+width is : %i", x, x+width);
@@ -166,8 +168,6 @@ void drawing_data_request(Drawing_t *drawing,
 
     LttvTraceHook hook;
 
-    LttvAttributeValue val;
-
     nb_trace = lttv_traceset_number(traceset);
     // FIXME : eventually request for more traces
     // for(i = 0 ; i < nb_trace ; i++) {
@@ -335,10 +335,10 @@ void drawing_data_request(Drawing_t *drawing,
       events_request->before_request = before_request_hook;
       events_request->after_request = after_request_hook;
 
-      g_debug("req : start : %u, %u", start.tv_sec, 
+      g_debug("req : start : %lu, %lu", start.tv_sec, 
                                           start.tv_nsec);
 
-      g_debug("req : end : %u, %u", time_end.tv_sec, 
+      g_debug("req : end : %lu, %lu", time_end.tv_sec, 
                                          time_end.tv_nsec);
 
       lttvwindow_events_request(tab, events_request);
@@ -404,7 +404,6 @@ void drawing_data_request_begin(EventsRequest *events_request, LttvTracesetState
   LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
   TimeWindow time_window = 
     lttvwindow_get_time_window(cfd->tab);
-  LttTime end_time = time_window.end_time;
 
   guint width = cfd->drawing->width;
   guint x=0;
@@ -427,7 +426,7 @@ void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss)
   g_debug("Begin of chunk");
   ControlFlowData *cfd = events_request->viewer_data;
   LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
-  LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
+  //LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
   guint num_cpu = 
     ltt_trace_per_cpu_tracefile_number(tss->parent.traces[TRACE_NUMBER]->t);
 
@@ -446,7 +445,7 @@ void drawing_request_expose(EventsRequest *events_request,
   gint x, x_end, width;
 
   ControlFlowData *cfd = events_request->viewer_data;
-  LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
+  LttvTracesetContext *tsc = (LttvTracesetContext*)tss;
   Drawing_t *drawing = cfd->drawing;
   
   TimeWindow time_window = 
@@ -454,37 +453,17 @@ void drawing_request_expose(EventsRequest *events_request,
 
   g_debug("request expose");
   
-  LttTime window_end = time_window.end_time;
-
-#if 0
-  convert_time_to_pixels(
-        time_window,
-        cfd->drawing->last_start,
-        drawing->width,
-        &x);
-
-#endif //0
   convert_time_to_pixels(
         time_window,
         end_time,
         drawing->width,
         &x_end);
   x = drawing->damage_begin;
- // x_end = drawing->damage_end;
+
   width = x_end - x;
 
   drawing->damage_begin = x+width;
-  //drawing->damage_end = drawing->width;
-
-  /* ask for the buffer to be redrawn */
-
-  //gtk_widget_queue_draw_area ( drawing->drawing_area,
-  //                             0, 0,
-  //                             drawing->width, drawing->height);
 
-  /* FIXME
-   * will need more precise pixel_to_time and time_to_pixel conversion
-   * functions to redraw only the needed area. */
   gtk_widget_queue_draw_area ( drawing->drawing_area,
                                x, 0,
                                width, drawing->height);
@@ -701,9 +680,6 @@ button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data
   {
     LttTime time;
 
-    LttTime window_end = time_window.end_time;
-
-
     /* left mouse button click */
     g_debug("x click is : %f", event->x);
 
@@ -1034,7 +1010,7 @@ void drawing_remove_square(Drawing_t *drawing,
 {
   GdkPixmap *pixmap;
 
-  if(unlikely(drawing->height == height)) {
+  if(unlikely((guint)drawing->height == height)) {
     pixmap = gdk_pixmap_new(
         drawing->drawing_area->window,
         drawing->width + SAFETY,
@@ -1111,11 +1087,9 @@ expose_ruler( GtkWidget *widget, GdkEventExpose *event, gpointer user_data )
   
   PangoContext *context;
   PangoLayout *layout;
-  PangoAttribute *attribute;
   PangoFontDescription *FontDesc;
-  gint Font_Size;
   PangoRectangle ink_rect;
-  guint global_width=0;
+  gint global_width=0;
   GdkColor foreground = { 0, 0, 0, 0 };
   GdkColor background = { 0, 0xffff, 0xffff, 0xffff };
 
index 05114beea86e95cb4b50dbf4d60d24e6962b911e..5a4dc820a27f48f407a2f9111eca7e3f7b1eef16 100644 (file)
@@ -118,6 +118,13 @@ void drawing_destroy(Drawing_t *drawing);
 GtkWidget *drawing_get_widget(Drawing_t *drawing);
 GtkWidget *drawing_get_drawing_area(Drawing_t *drawing);
 
+
+void drawing_data_request(Drawing_t *drawing,
+      GdkPixmap **pixmap,
+      gint x, gint y,
+      gint width,
+      gint height);
+
 void drawing_draw_line( Drawing_t *drawing,
       GdkPixmap *pixmap,
       guint x1, guint y1,
index 22cc9865fa4583d013bfbbcebd2e3990aa4c9cac..60cf7706dfb05c2d2c06546c293f16f9a406688c 100644 (file)
 
 #include <lttv/tracecontext.h>
 #include <lttv/state.h>
+#include <lttv/lttv.h>
 
 #include "drawitem.h"
 
@@ -118,9 +119,7 @@ gboolean draw_text( void *hook_data, void *call_data)
 
   PangoContext *context;
   PangoLayout *layout;
-  PangoAttribute *attribute;
   PangoFontDescription *font_desc;// = pango_font_description_new();
-  gint font_size;
   PangoRectangle ink_rect;
     
   layout = draw_context->pango_layout;
index df945e3a44998a24db105a9391c38f9c27593a00..28fdc1832f1b7fdc2a804e86c08aa4c1a043f133 100644 (file)
@@ -120,7 +120,7 @@ struct _DrawOperation {
   DrawableItems item;
   LttvHooks *hook;
 };
-
+#if 0
 /*
  * We define here each items that can be drawn, together with their
  * associated priority. Many item types can have the same priority,
@@ -138,6 +138,7 @@ static int Items_Priorities[] = {
   30, /* ITEM_POINT */
   10  /* ITEM_BACKGROUND */
 };
+#endif //0
 
 /*
  * Here are the different structures describing each item type that can be
index 154593775217ac2029d20a084678d2c9a2f1b901..29ebfeb7c1b4b204e0daa9029e928a68f0d44f51 100644 (file)
@@ -141,8 +141,6 @@ gint background_ready(void *hook_data, void *call_data)
 {
   ControlFlowData *control_flow_data = (ControlFlowData *)hook_data;
   LttvTrace *trace = (LttvTrace*)call_data;
-  LttvTracesetContext *tsc =
-        lttvwindow_get_traceset_context(control_flow_data->tab);
 
   control_flow_data->background_info_waiting--;
   
@@ -266,6 +264,7 @@ int event_selected_hook(void *hook_data, void *call_data)
 
   g_debug("DEBUG : event selected by main window : %u", *event_number);
   
+  return 0;
 }
 
 /* Function that selects the color of status&exemode line */
@@ -461,12 +460,6 @@ int before_schedchange_hook(void *hook_data, void *call_data)
        * We definitely can draw the items related to the ending state.
        */
       
-      /* Check if the x position is unset. In can have been left unset by
-       * a draw closure from a after chunk hook. This should never happen,
-       * because it must be set by before chunk hook to the damage_begin
-       * value.
-       */
-      g_assert(hashed_process_data->x.middle != -1);
       if(ltt_time_compare(hashed_process_data->next_good_time,
                           evtime) > 0)
       {
@@ -633,13 +626,6 @@ int before_schedchange_hook(void *hook_data, void *call_data)
        * We definitely can draw the items related to the ending state.
        */
       
-      /* Check if the x position is unset. In can have been left unset by
-       * a draw closure from a after chunk hook. This should never happen,
-       * because it must be set by before chunk hook to the damage_begin
-       * value.
-       */
-      g_assert(hashed_process_data->x.middle != -1);
-
       if(ltt_time_compare(hashed_process_data->next_good_time,
                           evtime) > 0)
       {
@@ -1388,9 +1374,9 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   LttTime evtime = ltt_event_time(e);
 
   /* Add process to process list (if not present) */
-  LttvProcessState *process_out, *process_in;
+  LttvProcessState *process_in;
   LttTime birth;
-  guint y_in = 0, y_out = 0, height = 0, pl_height = 0;
+  guint y_in = 0, height = 0, pl_height = 0;
   HashedProcessData *hashed_process_data_in = NULL;
 
   ProcessList *process_list = control_flow_data->process_list;
@@ -2058,13 +2044,6 @@ int before_execmode_hook(void *hook_data, void *call_data)
   /* Now, the process is in the state hash and our own process hash.
    * We definitely can draw the items related to the ending state.
    */
-  
-  /* Check if the x position is unset. In can have been left unset by
-   * a draw closure from a after chunk hook. This should never happen,
-   * because it must be set by before chunk hook to the damage_begin
-   * value.
-   */
-  g_assert(hashed_process_data->x.over != -1);
 
   if(likely(ltt_time_compare(hashed_process_data->next_good_time,
                       evtime) > 0))
@@ -2382,13 +2361,6 @@ int before_process_hook(void *hook_data, void *call_data)
      * We definitely can draw the items related to the ending state.
      */
     
-    /* Check if the x position is unset. In can have been left unset by
-     * a draw closure from a after chunk hook. This should never happen,
-     * because it must be set by before chunk hook to the damage_begin
-     * value.
-     */
-    g_assert(hashed_process_data->x.over != -1);
-
     if(likely(ltt_time_compare(hashed_process_data->next_good_time,
                         evtime) > 0))
     {
@@ -2750,13 +2722,13 @@ gint update_time_window_hook(void *hook_data, void *call_data)
    * currently shown time interval. (reuse is only for scrolling)
    */
 
-  g_info("Old time window HOOK : %u, %u to %u, %u",
+  g_info("Old time window HOOK : %lu, %lu to %lu, %lu",
       old_time_window->start_time.tv_sec,
       old_time_window->start_time.tv_nsec,
       old_time_window->time_width.tv_sec,
       old_time_window->time_width.tv_nsec);
 
-  g_info("New time window HOOK : %u, %u to %u, %u",
+  g_info("New time window HOOK : %lu, %lu to %lu, %lu",
       new_time_window->start_time.tv_sec,
       new_time_window->start_time.tv_nsec,
       new_time_window->time_width.tv_sec,
@@ -2946,7 +2918,6 @@ gint traceset_notify(void *hook_data, void *call_data)
 {
   ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
   Drawing_t *drawing = control_flow_data->drawing;
-  GtkWidget *widget = drawing->drawing_area;
 
 
   drawing_clear(control_flow_data->drawing);
@@ -2954,24 +2925,6 @@ gint traceset_notify(void *hook_data, void *call_data)
   redraw_notify(control_flow_data, NULL);
 
   request_background_data(control_flow_data);
-#if 0
-  drawing->damage_begin = 0;
-  drawing->damage_end = drawing->width;
-  if(drawing->damage_begin < drawing->damage_end)
-  {
-    drawing_data_request(drawing,
-                         &drawing->pixmap,
-                         drawing->damage_begin,
-                         0,
-                         drawing->damage_end-drawing->damage_begin,
-                         drawing->height);
-  }
-
-  gtk_widget_queue_draw_area(drawing->drawing_area,
-                             0,0,
-                             drawing->width,
-                             drawing->height);
-#endif //0
  
   return FALSE;
 }
@@ -3021,7 +2974,6 @@ gint continue_notify(void *hook_data, void *call_data)
 {
   ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
   Drawing_t *drawing = control_flow_data->drawing;
-  GtkWidget *widget = drawing->drawing_area;
 
   //g_assert(widget->allocation.width == drawing->damage_end);
 
@@ -3065,7 +3017,7 @@ gint update_current_time_hook(void *hook_data, void *call_data)
   LttTime trace_start = tsc->time_span.start_time;
   LttTime trace_end = tsc->time_span.end_time;
   
-  g_info("New current time HOOK : %u, %u", current_time.tv_sec,
+  g_info("New current time HOOK : %lu, %lu", current_time.tv_sec,
               current_time.tv_nsec);
 
 
@@ -3168,9 +3120,8 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
       
       /* Only draw for processes that are currently in the trace states */
 
-      guint y = 0, height = 0, pl_height = 0;
+      guint y = 0, height = 0;
       ProcessList *process_list = control_flow_data->process_list;
-      LttTime birth = process_info->birth;
 #ifdef EXTRA_CHECK
       /* Should be alike when background info is ready */
       if(control_flow_data->background_info_waiting==0)
@@ -3187,13 +3138,6 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
        * We definitely can draw the items related to the ending state.
        */
       
-      /* Check if the x position is unset. In can have been left unset by
-       * a draw closure from a after chunk hook. This should never happen,
-       * because it must be set by before chunk hook to the damage_begin
-       * value.
-       */
-      g_assert(hashed_process_data->x.over != -1);
-
       if(unlikely(ltt_time_compare(hashed_process_data->next_good_time,
                             evtime) <= 0))
       {
@@ -3316,7 +3260,6 @@ int after_request(void *hook_data, void *call_data)
   EventsRequest *events_request = (EventsRequest*)hook_data;
   ControlFlowData *control_flow_data = events_request->viewer_data;
   LttvTracesetState *tss = (LttvTracesetState*)call_data;
-  LttvTracesetContext *tsc = (LttvTracesetContext*)call_data;
   
   ProcessList *process_list = control_flow_data->process_list;
   LttTime end_time = events_request->end_time;
index d2099fc47ca3108f961a46d93f0b47df72b26f3f..dd99d1302348a0237ef803ac4cb5d1fd361885e1 100644 (file)
 
 #include "hGuiControlFlowInsert.xpm"
 
-static LttvModule *Main_Win_Module;
-
-
 /** Array containing instanced objects. Used when module is unloaded */
 GSList *g_control_flow_data_list = NULL ;
 
 
-
-
 /*****************************************************************************
  *                 Functions for module loading/unloading                    *
  *****************************************************************************/
@@ -94,7 +89,6 @@ void destroy_walk(gpointer data, gpointer user_data)
  */
 static void destroy() {
   g_info("GUI Control Flow Viewer destroy()");
-  int i;
 
   g_slist_foreach(g_control_flow_data_list, destroy_walk, NULL );
   
index 6f792f0e0826448a20418ea97595c60b6030e8df..a482927c7ae0230c71157cb6bf99ece3065e5530 100644 (file)
@@ -235,8 +235,8 @@ gint process_sort_func  ( GtkTreeModel *model,
 
 static guint process_list_hash_fct(gconstpointer key)
 {
-  guint pid = ((ProcessInfo*)key)->pid;
-  return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((ProcessInfo*)key)->cpu);
+  guint pid = ((const ProcessInfo*)key)->pid;
+  return ((pid>>8 ^ pid>>4 ^ pid>>2 ^ pid) ^ ((const ProcessInfo*)key)->cpu);
 }
 
 /* If hash is good, should be different */
@@ -534,7 +534,6 @@ int processlist_remove( ProcessList *process_list,
       guint trace_num)
 {
   ProcessInfo process_info;
-  gint *path_indices;
   HashedProcessData *hashed_process_data;
   GtkTreeIter iter;
   
index ebb32a30236e73c88f8be3e9570e82df761fa0aa..03da021d79015711b7c1dcb1ab35ce18b6b0fe43 100644 (file)
@@ -145,8 +145,6 @@ static inline HashedProcessData *processlist_get_process_data(
           guint pid, guint cpu, LttTime *birth, guint trace_num)
 {
   ProcessInfo process_info;
-  gint *path_indices;
-  GtkTreePath *tree_path;
 
   process_info.pid = pid;
   if(pid == 0)
index be473deafd31b25bfae1465e6d6fa251d475f22a..21d09fc5529cc9fd89a79970649c41b6020be413 100644 (file)
@@ -386,7 +386,7 @@ static void connect_focus_recursive(GtkWidget *widget,
 
   }
   if(GTK_IS_TREE_VIEW(widget)) {
-    gtk_tree_view_set_headers_clickable(widget, TRUE);
+    gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(widget), TRUE);
   }
   gtk_widget_add_events(widget, GDK_BUTTON_PRESS_MASK);
   g_signal_connect (G_OBJECT(widget),
@@ -403,10 +403,7 @@ static void connect_focus_recursive(GtkWidget *widget,
 void
 insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data)
 {
-  guint val = 20;
-
   insert_viewer((GtkWidget*)menuitem, (lttvwindow_viewer_constructor)user_data);
-  //  selected_hook(&val);
 }
 
 
@@ -669,7 +666,7 @@ MainWindow * get_window_data_struct(GtkWidget * widget)
   
   mw_data = (MainWindow *) g_object_get_data(G_OBJECT(mw),"main_window_data");
   if(mw_data == NULL){
-    g_printf("Main window data does not exist\n");
+    g_warning("Main window data does not exist\n");
     return NULL;
   }
   return mw_data;
@@ -726,7 +723,8 @@ gint viewer_container_position(GtkWidget *container, GtkWidget *child)
   if(child == NULL) return -1;
 
   gint pos;
-  GValue value = { 0, };
+  GValue value;
+  memset(&value, 0, sizeof(GValue));
   g_value_init(&value, G_TYPE_INT);
   gtk_container_child_get_property(GTK_CONTAINER(container),
                                    child,
@@ -936,9 +934,6 @@ static void events_request_free(EventsRequest *events_request)
 
 gboolean lttvwindow_process_pending_requests(Tab *tab)
 {
-  unsigned max_nb_events;
-  GdkWindow * win;
-  GdkCursor * new;
   GtkWidget* widget;
   LttvTracesetContext *tsc;
   LttvTracefileContext *tfc;
@@ -1052,7 +1047,6 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
           ltime = g_slist_append(ltime, g_slist_nth_data(list_out, 0));
         for(iter=g_slist_nth(list_out,1);iter!=NULL;iter=g_slist_next(iter)) {
           /* Find all time requests with the lowest start time in list_out */
-          guint index_ltime = g_array_index(ltime, guint, 0);
           EventsRequest *event_request_ltime = (EventsRequest*)g_slist_nth_data(ltime, 0);
           EventsRequest *event_request_list_out = (EventsRequest*)iter->data;
 
@@ -1236,7 +1230,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                 events_request->event_by_id);
           else {
             guint nb_trace = lttv_traceset_number(tsc->ts);
-            g_assert(events_request->trace < nb_trace &&
+            g_assert((guint)events_request->trace < nb_trace &&
                       events_request->trace > -1);
             LttvTraceContext *tc = tsc->traces[events_request->trace];
 
@@ -1273,7 +1267,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                 events_request->event_by_id);
           else {
             guint nb_trace = lttv_traceset_number(tsc->ts);
-            g_assert(events_request->trace < nb_trace &&
+            g_assert((guint)events_request->trace < nb_trace &&
                       events_request->trace > -1);
             LttvTraceContext *tc = tsc->traces[events_request->trace];
 
@@ -1337,7 +1331,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
                   events_request->event_by_id);
             else {
               guint nb_trace = lttv_traceset_number(tsc->ts);
-              g_assert(events_request->trace < nb_trace &&
+              g_assert((guint)events_request->trace < nb_trace &&
                         events_request->trace > -1);
               LttvTraceContext *tc = tsc->traces[events_request->trace];
 
@@ -1450,7 +1444,7 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
 
     {
       /* 4. Call process traceset middle */
-      g_debug("Calling process traceset middle with %p, %lu sec %lu nsec, %lu nb ev, %p end pos", tsc, end_time.tv_sec, end_time.tv_nsec, end_nb_events, end_position);
+      g_debug("Calling process traceset middle with %p, %lu sec %lu nsec, %u nb ev, %p end pos", tsc, end_time.tv_sec, end_time.tv_nsec, end_nb_events, end_position);
       count = lttv_process_traceset_middle(tsc, end_time, end_nb_events, end_position);
 
       tfc = lttv_traceset_context_get_current_tfc(tsc);
@@ -1829,7 +1823,6 @@ void add_trace(GtkWidget * widget, gpointer user_data)
   const char * dir;
   char abs_path[PATH_MAX];
   gint id;
-  gint i;
   MainWindow * mw_data = get_window_data_struct(widget);
   GtkWidget * notebook = lookup_widget(widget, "MNotebook");
 
@@ -2259,7 +2252,7 @@ void zoom(GtkWidget * widget, double size)
 {
   TimeInterval time_span;
   TimeWindow new_time_window;
-  LttTime    current_time, time_delta, time_s, time_e, time_tmp;
+  LttTime    current_time, time_delta;
   MainWindow * mw_data = get_window_data_struct(widget);
   LttvTracesetContext *tsc;
   GtkWidget * notebook = lookup_widget(widget, "MNotebook");
@@ -2742,7 +2735,7 @@ on_load_library_activate                (GtkMenuItem     *menuitem,
         lttv_module_require(str1, &error);
 #endif //0   
         lttv_library_load(str1, &error);
-        if(error != NULL) g_warning(error->message);
+        if(error != NULL) g_warning("%s", error->message);
         else g_printf("Load library: %s\n", str);
         g_strfreev(dir);
       case GTK_RESPONSE_REJECT:
@@ -2769,40 +2762,39 @@ on_unload_library_activate              (GtkMenuItem     *menuitem,
 {
   MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
 
-  LttvLibrary *library;
-  {
-    GPtrArray *name;
-    guint nb,i;
-    gchar *lib_name;
-    name = g_ptr_array_new();
-    nb = lttv_library_number();
-    LttvLibraryInfo *lib_info = g_new(LttvLibraryInfo,nb);
-    /* ask for the library name */
+  LttvLibrary *library = NULL;
 
+  GPtrArray *name;
+  guint nb,i;
+  gchar *lib_name;
+  name = g_ptr_array_new();
+  nb = lttv_library_number();
+  LttvLibraryInfo *lib_info = g_new(LttvLibraryInfo,nb);
+  /* ask for the library name */
+
+  for(i=0;i<nb;i++){
+    LttvLibrary *iter_lib = lttv_library_get(i);
+    lttv_library_info(iter_lib, &lib_info[i]);
+    
+    gchar *path = lib_info[i].name;
+    g_ptr_array_add(name, path);
+  }
+  lib_name = get_selection((char **)(name->pdata), name->len,
+                           "Select a library", "Libraries");
+  if(lib_name != NULL) {
     for(i=0;i<nb;i++){
-      LttvLibrary *iter_lib = lttv_library_get(i);
-      lttv_library_info(iter_lib, &lib_info[i]);
-      
-      gchar *path = lib_info[i].name;
-      g_ptr_array_add(name, lib_info[i].name);
-    }
-    lib_name = get_selection((char **)(name->pdata), name->len,
-                             "Select a library", "Libraries");
-    if(lib_name != NULL) {
-      for(i=0;i<nb;i++){
-        if(strcmp(lib_name, lib_info[i].name) == 0) {
-          library = lttv_library_get(i);
-          break;
-        }
+      if(strcmp(lib_name, lib_info[i].name) == 0) {
+        library = lttv_library_get(i);
+        break;
       }
     }
-    g_ptr_array_free(name, TRUE);
-    g_free(lib_info);
-
-    if(lib_name == NULL) return;
   }
-  
-  lttv_library_unload(library);
+  g_ptr_array_free(name, TRUE);
+  g_free(lib_info);
+
+  if(lib_name == NULL) return;
+
+  if(library != NULL) lttv_library_unload(library);
 }
 
 
@@ -2817,7 +2809,7 @@ on_load_module_activate                (GtkMenuItem     *menuitem,
   GError *error = NULL;
   MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
 
-  LttvLibrary *library;
+  LttvLibrary *library = NULL;
   {
     GPtrArray *name;
     guint nb,i;
@@ -2888,8 +2880,8 @@ on_load_module_activate                (GtkMenuItem     *menuitem,
   }
   
   lttv_module_require(module_name_out, &error);
-  if(error != NULL) g_warning(error->message);
-  else g_printf("Load module: %s\n", module_name_out);
+  if(error != NULL) g_warning("%s", error->message);
+  else g_printf("Load module: %s", module_name_out);
 
 
 #if 0
@@ -2997,7 +2989,7 @@ on_unload_module_activate              (GtkMenuItem     *menuitem,
     if(lib_name == NULL) return;
   }
 
-  LttvModule *module;
+  LttvModule *module = NULL;
   {
     /* Ask for the module to load : list modules in the selected lib */
     GPtrArray *name;
@@ -3397,11 +3389,6 @@ on_MWindow_configure                   (GtkWidget         *widget,
                                         gpointer           user_data)
 {
   MainWindow * mw_data = get_window_data_struct((GtkWidget*)widget);
-  float width = event->width;
-  TimeWindow time_win;
-  double ratio;
-  TimeInterval *time_span;
-  LttTime time;
        
        // MD : removed time width modification upon resizing of the main window.
        // The viewers will redraw themselves completely, without time interval
@@ -4230,10 +4217,11 @@ char * get_selection(char ** loaded_module_name, int nb_module,
   }
 
   id = gtk_dialog_run(GTK_DIALOG(dialogue));
+  GtkTreeModel **store_model = &store;  /* for strict aliasing */
   switch(id){
     case GTK_RESPONSE_ACCEPT:
     case GTK_RESPONSE_OK:
-      if (gtk_tree_selection_get_selected (select, (GtkTreeModel**)&store, &iter)){
+      if (gtk_tree_selection_get_selected (select, store_model, &iter)){
          gtk_tree_model_get ((GtkTreeModel*)store, &iter, MODULE_COLUMN, &unload_module_name, -1);
       }
     case GTK_RESPONSE_REJECT:
@@ -4254,7 +4242,7 @@ char * get_selection(char ** loaded_module_name, int nb_module,
 
 void add_all_menu_toolbar_constructors(MainWindow * mw, gpointer user_data)
 {
-  int i;
+  guint i;
   GdkPixbuf *pixbuf;
   lttvwindow_viewer_constructor constructor;
   LttvMenus * global_menu, * instance_menu;
@@ -4527,7 +4515,6 @@ Tab* create_tab(MainWindow * mw, Tab *copy_tab,
 {
   GList * list;
   Tab * tab;
-  LttTime tmp_time;
   
   //create a new tab data structure
   tab = g_new(Tab,1);
index 6a932ed098cdd29bd407682e00103756faa21fd2..dfb747a19412c2eb69a652d08021bef1f65ab3b7 100644 (file)
@@ -452,6 +452,7 @@ gtk_dir_selection_get_type (void)
        sizeof (GtkDirSelection),
        0,              /* n_preallocs */
        (GInstanceInitFunc) gtk_dir_selection_init,
+  NULL  /* GValue */
       };
 
       file_selection_type =
@@ -2305,7 +2306,8 @@ gtk_dir_selection_file_changed (GtkTreeSelection *selection,
            index = new_names->len - 1;
          else
            {
-             gint i = 0, j = 0, cmp;
+             guint i = 0, j = 0;
+        gint cmp;
 
              /* do a quick diff, stopping at the first file not in the
               * old list
@@ -2425,7 +2427,8 @@ gtk_dir_selection_dir_changed (GtkTreeSelection *selection,
            index = new_names->len - 1;
          else
            {
-             gint i = 0, j = 0, cmp;
+             guint i = 0, j = 0;
+        gint cmp;
 
              /* do a quick diff, stopping at the first file not in the
               * old list
@@ -2483,7 +2486,7 @@ gtk_dir_selection_dir_changed (GtkTreeSelection *selection,
       gchar str[256];
       err = gtk_label_get_text (GTK_LABEL (fs->selection_text));
       err += 11;  //pass over "Selection: "
-      sprintf(str,"%s\0",err);
+      sprintf(str,"%s",err);
       
       
       if (fs->last_selected != NULL)
@@ -2535,7 +2538,7 @@ gtk_dir_selection_get_selections (GtkDirSelection *filesel)
   gchar **selections;
   gchar *filename, *dirname;
   gchar *current, *buf;
-  gint i, count;
+  guint i, count;
   gboolean unselected_entry;
 
   g_return_val_if_fail (GTK_IS_DIR_SELECTION (filesel), NULL);
@@ -2843,7 +2846,6 @@ cmpl_completion_matches (gchar           *text_to_complete,
                         gchar          **remaining_text,
                         CompletionState *cmpl_state)
 {
-  gchar* first_slash;
   PossibleCompletion *poss;
 
   prune_memory_usage (cmpl_state);
@@ -3163,18 +3165,16 @@ open_new_dir (gchar       *dir_name,
 
   for (i = 0; i < entry_count; i += 1)
     {
-      GError *error = NULL;
-
       if (i == 0)
-       dirent = ".";
+             dirent = ".";
       else if (i == 1)
-       dirent = "..";
+               dirent = "..";
       else
-       {
-         dirent = g_dir_read_name (directory);
-         if (!dirent)          /* Directory changed */
-           break;
-       }
+      {
+        dirent = g_dir_read_name (directory);
+        if (!dirent)           /* Directory changed */
+          break;
+           }
 
       sent->entries[n_entries].entry_name = g_filename_to_utf8 (dirent, -1, NULL, NULL, &error);
       if (sent->entries[n_entries].entry_name == NULL
@@ -4038,8 +4038,8 @@ compare_cmpl_dir (const void *a,
                  const void *b)
 {
   
-  return strcmp (((CompletionDirEntry*)a)->sort_key,
-                (((CompletionDirEntry*)b))->sort_key);
+  return strcmp (((const CompletionDirEntry*)a)->sort_key,
+                (((const CompletionDirEntry*)b))->sort_key);
 }
 
 static gint
index e39d2ed9fa0e8c67048d7e587c4e78f0200a2e9a..923dd23dce69e3d245313f5910b5bf165737cb55 100644 (file)
@@ -712,4 +712,29 @@ LttvTracesetStats* lttvwindow_get_traceset_stats(Tab *tab);
 LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab);
 
 
+/* set_time_window 
+ *
+ * It updates the time window of the tab, then calls the updatetimewindow
+ * hooks of each viewer.
+ *
+ * This is called whenever the scrollbar value changes.
+ *
+ * This is mostly an internal function.
+ */
+
+void set_time_window(Tab *tab, const TimeWindow *time_window);
+
+
+/* set_current_time
+ *
+ * It updates the current time of the tab, then calls the updatetimewindow
+ * hooks of each viewer.
+ *
+ * This is called whenever the current time value changes.
+ *
+ * This is mostly an internal function.
+ */
+
+void set_current_time(Tab *tab, const LttTime *current_time);
+
 #endif //VIEWER_H
index 05c24b7a7f7cfadadf4bb696817725d558cb7b30..7e8a2a8eff3d31a0c7e126af01bcac76dc479b19 100644 (file)
@@ -23,6 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <string.h>
 
 #include <ltt/time.h>
 #include <ltt/trace.h>
@@ -65,7 +66,6 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace);
 
 LttvTrace *lttvwindowtraces_get_trace_by_name(gchar *path)
 {
-  LttvAttribute *attribute = lttv_global_attributes();
   guint i;
 
   for(i=0;i<lttvwindowtraces_get_number();i++) {
@@ -829,7 +829,6 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
   LttvAttributeValue value;
   LttvAttributeType type;
   gboolean ret_val;
-  LttvHooks *before_request, *after_request;
 
   if(trace == NULL)
     return FALSE;
@@ -957,7 +956,6 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
                                              &value);
           g_assert(type == LTTV_POINTER);
           LttvHooks *before_request = (LttvHooks*)*(value.v_pointer);
-
  
           if(before_request != NULL) lttv_hooks_call(before_request, tsc);
           
index 90a782b5ba76dcf1ba8898fc46f2ca94ab0a8f7e..d201ac0ec46c323748b36756a76d7d8096709288 100644 (file)
@@ -38,14 +38,11 @@ LttvMenuClosure lttv_menus_add(LttvMenus *h,
 {
   LttvMenuClosure c;
 
-  /* if h is null, do nothing, or popup a warning message */
-  if(h == NULL)return;
-
   c.con = f;
   c.menu_path = menu_path;
   c.menu_text = menu_text;
   c.widget = widget;
-  g_array_append_val(h,c);
+  if(h != NULL) g_array_append_val(h,c);
 
   return c;
 }
@@ -53,7 +50,7 @@ LttvMenuClosure lttv_menus_add(LttvMenus *h,
 GtkWidget *lttv_menus_remove(LttvMenus *h, lttvwindow_viewer_constructor f)
 {
   LttvMenuClosure * tmp;
-  gint i;
+  guint i;
   GtkWidget *widget;
   
   for(i=0;i<h->len;i++){
index 8a7eb4a227e228d3cca56c2ef5b635ed384ea068..72f4a1573bf87e4bc985d3126f51d5b941aee920 100644 (file)
@@ -37,14 +37,11 @@ LttvToolbarClosure lttv_toolbars_add(LttvToolbars *h,
 {
   LttvToolbarClosure c;
 
-  /* if h is null, do nothing, or popup a warning message */
-  if(h == NULL)return;
-
   c.con = f;
   c.tooltip = tooltip;
   c.pixmap = pixmap;
   c.widget = widget;
-  g_array_append_val(h,c);
+  if(h != NULL) g_array_append_val(h,c);
 
   return c;
 }
@@ -52,7 +49,7 @@ LttvToolbarClosure lttv_toolbars_add(LttvToolbars *h,
 GtkWidget *lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f)
 {
   LttvToolbarClosure * tmp;
-  gint i;
+  guint i;
   GtkWidget *widget;
 
   for(i=0;i<h->len;i++){
This page took 0.038622 seconds and 4 git commands to generate.