From 2eef04b5f3234a4e303bd6162eb20d055b7d44cf Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 15 Aug 2004 05:52:38 +0000 Subject: [PATCH] warning fixed for lttvwindow and controlflow view git-svn-id: http://ltt.polymtl.ca/svn@773 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/trace.h | 1 + ltt/branches/poly/lttv/lttv/hook.h | 1 + .../poly/lttv/modules/gui/controlflow/cfv.c | 3 +- .../lttv/modules/gui/controlflow/drawing.c | 50 ++------- .../lttv/modules/gui/controlflow/drawing.h | 7 ++ .../lttv/modules/gui/controlflow/drawitem.c | 3 +- .../lttv/modules/gui/controlflow/drawitem.h | 3 +- .../lttv/modules/gui/controlflow/eventhooks.c | 71 ++---------- .../lttv/modules/gui/controlflow/module.c | 6 - .../modules/gui/controlflow/processlist.c | 5 +- .../modules/gui/controlflow/processlist.h | 2 - .../gui/lttvwindow/lttvwindow/callbacks.c | 103 ++++++++---------- .../gui/lttvwindow/lttvwindow/gtkdirsel.c | 32 +++--- .../gui/lttvwindow/lttvwindow/lttvwindow.h | 25 +++++ .../lttvwindow/lttvwindow/lttvwindowtraces.c | 4 +- .../modules/gui/lttvwindow/lttvwindow/menu.c | 7 +- .../gui/lttvwindow/lttvwindow/toolbar.c | 7 +- 17 files changed, 126 insertions(+), 204 deletions(-) diff --git a/ltt/branches/poly/ltt/trace.h b/ltt/branches/poly/ltt/trace.h index 73adc0bf..96931524 100644 --- a/ltt/branches/poly/ltt/trace.h +++ b/ltt/branches/poly/ltt/trace.h @@ -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 diff --git a/ltt/branches/poly/lttv/lttv/hook.h b/ltt/branches/poly/lttv/lttv/hook.h index 7da21346..12272035 100644 --- a/ltt/branches/poly/lttv/lttv/hook.h +++ b/ltt/branches/poly/lttv/lttv/hook.h @@ -22,6 +22,7 @@ #define HOOK_H #include +#include /* 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 diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c index ce77e4d5..0917305a 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c @@ -19,12 +19,13 @@ #include #include #include +#include +#include #include "cfv.h" #include "drawing.h" #include "processlist.h" #include "eventhooks.h" -#include extern GSList *g_control_flow_data_list; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 918d8c3b..9030a37b 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -20,6 +20,8 @@ #include #include +#include + #include #include #include @@ -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 }; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h index 05114bee..5a4dc820 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.h @@ -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, diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c index 22cc9865..60cf7706 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c @@ -104,6 +104,7 @@ #include #include +#include #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; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h index df945e3a..28fdc183 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.h @@ -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 diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index 15459377..29ebfeb7 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -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; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/module.c b/ltt/branches/poly/lttv/modules/gui/controlflow/module.c index d2099fc4..dd99d130 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/module.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/module.c @@ -47,15 +47,10 @@ #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 ); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index 6f792f0e..a482927c 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -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; diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h index ebb32a30..03da021d 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h @@ -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) diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index be473dea..21d09fc5 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -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;ipdata), name->len, + "Select a library", "Libraries"); + if(lib_name != NULL) { for(i=0;ipdata), name->len, - "Select a library", "Libraries"); - if(lib_name != NULL) { - for(i=0;imessage); - 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); diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c index 6a932ed0..dfb747a1 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c @@ -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 diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h index e39d2ed9..923dd23d 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h @@ -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 diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index 05c24b7a..7e8a2a8e 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -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;ilen;i++){ diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c index 8a7eb4a2..72f4a157 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c @@ -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;ilen;i++){ -- 2.34.1