From 6843100aba151c7bf7dcb7ccf3d0e12473634d76 Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 13 Aug 2004 18:06:42 +0000 Subject: [PATCH] performance tweaks git-svn-id: http://ltt.polymtl.ca/svn@727 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/attribute.c | 7 ++++--- ltt/branches/poly/lttv/lttv/tracecontext.c | 2 +- .../lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/attribute.c b/ltt/branches/poly/lttv/lttv/attribute.c index a0d30704..54985867 100644 --- a/ltt/branches/poly/lttv/lttv/attribute.c +++ b/ltt/branches/poly/lttv/lttv/attribute.c @@ -41,7 +41,8 @@ typedef struct _Attribute { } Attribute; -LttvAttributeValue address_of_value(LttvAttributeType t, AttributeValue *v) +static __inline LttvAttributeValue address_of_value(LttvAttributeType t, + AttributeValue *v) { LttvAttributeValue va; @@ -514,12 +515,12 @@ attribute_interface_init (gpointer g_iface, gpointer iface_data) } - static void attribute_instance_init (GTypeInstance *instance, gpointer g_class) { LttvAttribute *self = (LttvAttribute *)instance; - self->names = g_hash_table_new(g_direct_hash, g_direct_equal); + self->names = g_hash_table_new(g_direct_hash, + g_direct_equal); self->attributes = g_array_new(FALSE, FALSE, sizeof(Attribute)); } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 2150ae37..3af6045c 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -577,7 +577,7 @@ lttv_tracefile_context_get_type(void) -gboolean get_first(gpointer key, gpointer value, gpointer user_data) { +static gboolean get_first(gpointer key, gpointer value, gpointer user_data) { *((LttvTracefileContext **)user_data) = (LttvTracefileContext *)value; return TRUE; } diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c index 51fb7b2d..aa424772 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c @@ -880,10 +880,10 @@ gint find_viewer (const EventsRequest *a, gconstpointer b) void lttvwindow_events_request_remove_all(Tab *tab, gconstpointer viewer) { - GSList *element; + GSList *element = tab->events_requests; while((element = - g_slist_find_custom(tab->events_requests, viewer, + g_slist_find_custom(element, viewer, (GCompareFunc)find_viewer)) != NULL) { EventsRequest *events_request = (EventsRequest *)element->data; @@ -895,6 +895,8 @@ void lttvwindow_events_request_remove_all(Tab *tab, //} g_free(events_request); tab->events_requests = g_slist_remove_link(tab->events_requests, element); + element = g_slist_next(element); + if(element == NULL) break; /* end of list */ } if(g_slist_length(tab->events_requests) == 0) { tab->events_request_pending = FALSE; -- 2.34.1