anjuta r4409 - in trunk: . plugins/symbol-db
- From: mcora svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4409 - in trunk: . plugins/symbol-db
- Date: Sun, 30 Nov 2008 11:24:26 +0000 (UTC)
Author: mcora
Date: Sun Nov 30 11:24:26 2008
New Revision: 4409
URL: http://svn.gnome.org/viewvc/anjuta?rev=4409&view=rev
Log:
* plugins/symbol-db/Makefile.am:
* plugins/symbol-db/plugin.c
(on_editor_buffer_symbols_update_timeout),
(value_added_current_editor), (do_add_new_files),
(on_importing_project_end), (on_received_project_import_end):
* plugins/symbol-db/readtags.c (readNext), (readFieldValue):
(sdb_engine_ctags_launcher_create):
* plugins/symbol-db/symbol-db-view-locals.c
(do_add_child_symbol_to_view), (traverse_on_scan_end),
(add_waiting_for_symbol_to_view), (trigger_on_symbol_inserted),
(add_new_waiting_for), (do_recurse_subtree_and_invalidate),
(prepare_for_adding), (consume_symbols_inserted_queue_idle),
(do_recurse_subtree_and_remove), (on_symbol_removed),
(on_symbol_scope_updated), (on_symbol_inserted):
* plugins/symbol-db/symbol-db-view.c (traverse_free_waiting_for),
(symbol_db_view_clear_cache), (do_add_child_symbol_to_view),
(add_waiting_for_symbol_to_view), (trigger_on_symbol_inserted),
(add_new_waiting_for), (do_recurse_subtree_and_invalidate),
(prepare_for_adding), (on_symbol_inserted),
(do_recurse_subtree_and_remove), (on_symbol_removed),
(sdb_view_row_expanded_idle_destroy), (sdb_view_row_expanded_idle),
(sdb_view_namespace_row_expanded), (sdb_view_global_row_expanded),
(sdb_view_vars_row_expanded), (symbol_db_view_row_expanded),
(symbol_db_view_row_collapsed),
(sdb_view_build_and_display_base_tree), (symbol_db_view_open):
code cleaning, fixed two critical warnings.
Added -DG_LOG_DOMAIN=\"libanjuta-symbol-db\" for debug purposes.
* plugins/symbol-db/symbol-db-engine.c:
added --sort=no option, probably speeding up tags generation.
Modified:
trunk/ChangeLog
trunk/plugins/symbol-db/Makefile.am
trunk/plugins/symbol-db/plugin.c
trunk/plugins/symbol-db/readtags.c
trunk/plugins/symbol-db/symbol-db-engine.c
trunk/plugins/symbol-db/symbol-db-view-locals.c
trunk/plugins/symbol-db/symbol-db-view.c
Modified: trunk/plugins/symbol-db/Makefile.am
==============================================================================
--- trunk/plugins/symbol-db/Makefile.am (original)
+++ trunk/plugins/symbol-db/Makefile.am Sun Nov 30 11:24:26 2008
@@ -34,7 +34,8 @@
$(DEPRECATED_FLAGS) \
$(GDL_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
- $(PLUGIN_SYMBOL_DB_CFLAGS)
+ $(PLUGIN_SYMBOL_DB_CFLAGS) \
+ -DG_LOG_DOMAIN=\"libanjuta-symbol-db\"
# Where to install the plugin
plugindir = $(anjuta_plugin_dir)
Modified: trunk/plugins/symbol-db/plugin.c
==============================================================================
--- trunk/plugins/symbol-db/plugin.c (original)
+++ trunk/plugins/symbol-db/plugin.c Sun Nov 30 11:24:26 2008
@@ -136,6 +136,7 @@
GPtrArray *real_files_list;
GPtrArray *text_buffers;
GPtrArray *buffer_sizes;
+ gint i;
g_return_val_if_fail (user_data != NULL, FALSE);
@@ -186,7 +187,6 @@
/* ok that's good. Let's have a last check: is the current file present
* on the buffer_update_files?
*/
- gint i;
for (i = 0; i < sdb_plugin->buffer_update_files->len; i++)
{
if (strcmp (g_ptr_array_index (sdb_plugin->buffer_update_files, i),
@@ -228,10 +228,7 @@
gchar * local_path_dup = g_strdup (local_path);
g_ptr_array_add (sdb_plugin->buffer_update_files, local_path_dup);
/* add the id too */
- g_ptr_array_add (sdb_plugin->buffer_update_ids, (gpointer)proc_id);
-
-
- DEBUG_PRINT ("******** proc_id is %d", proc_id);
+ g_ptr_array_add (sdb_plugin->buffer_update_ids, (gpointer)proc_id);
}
g_free (current_buffer);
@@ -356,7 +353,6 @@
/* we have an editor added, so let locals to display something */
symbol_db_view_locals_display_nothing (
SYMBOL_DB_VIEW_LOCALS (sdb_plugin->dbv_view_tree_locals), FALSE);
-
if (sdb_plugin->session_loading)
{
@@ -384,19 +380,12 @@
local_path = g_file_get_path (file);
uri = g_file_get_uri (file);
- DEBUG_PRINT ("value_added_current_editor () gonna refresh local syms: local_path %s "
- "uri %s", local_path, uri);
+
if (local_path == NULL)
{
- g_critical ("FIXME local_path == NULL");
+ g_critical ("local_path == NULL");
return;
- }
-
- if (strstr (local_path, "//") != NULL)
- {
- g_critical ("WARNING FIXME: bad file uri passed to symbol-db from editor. There's "
- "a trailing slash left. Please fix this at editor side");
- }
+ }
symbol_db_view_locals_update_list (
SYMBOL_DB_VIEW_LOCALS (sdb_plugin->dbv_view_tree_locals),
@@ -835,9 +824,15 @@
g_object_unref (gfile);
g_object_unref (gfile_info);
}
-
- symbol_db_engine_add_new_files (sdb_plugin->sdbe_project, sdb_plugin->project_opened,
+
+ /* last but not least check if we had some files in that GPtrArray. It that's not
+ * the case just pass over
+ */
+ if (to_scan_array->len > 0)
+ {
+ symbol_db_engine_add_new_files (sdb_plugin->sdbe_project, sdb_plugin->project_opened,
to_scan_array, languages_array, TRUE);
+ }
g_ptr_array_foreach (languages_array, (GFunc)g_free, NULL);
g_ptr_array_free (languages_array, TRUE);
@@ -1069,18 +1064,7 @@
return;
local_path = g_file_get_path (file);
- if (local_path == NULL)
- {
- g_critical ("FIXME local_path == NULL");
- return;
- }
- if (strstr (local_path, "//") != NULL)
- {
- g_critical ("WARNING FIXME: bad file uri passed to symbol-db from editor. There's "
- "a trailing slash left. Please fix this at editor side");
- }
-
symbol_db_view_locals_update_list (
SYMBOL_DB_VIEW_LOCALS (sdb_plugin->dbv_view_tree_locals),
sdb_plugin->sdbe_project, local_path);
@@ -1303,8 +1287,7 @@
symbol_db_system_scan_package (sdb_plugin->sdbs, item->data);
item = item->next;
- }
-
+ }
/* the resume thing */
GPtrArray *sys_src_array = NULL;
Modified: trunk/plugins/symbol-db/readtags.c
==============================================================================
--- trunk/plugins/symbol-db/readtags.c (original)
+++ trunk/plugins/symbol-db/readtags.c Sun Nov 30 11:24:26 2008
@@ -523,7 +523,7 @@
free (file);
}
-static tagResult readNext (tagFile *const file, tagEntry *const entry)
+static inline tagResult readNext (tagFile *const file, tagEntry *const entry)
{
tagResult result = TagFailure;
if (file == NULL || ! file->initialized)
@@ -539,7 +539,7 @@
return result;
}
-static const char *readFieldValue (
+static inline const char *readFieldValue (
const tagEntry *const entry, const char *const key)
{
const char *result = NULL;
Modified: trunk/plugins/symbol-db/symbol-db-engine.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine.c (original)
+++ trunk/plugins/symbol-db/symbol-db-engine.c Sun Nov 30 11:24:26 2008
@@ -1792,7 +1792,7 @@
g_signal_connect (G_OBJECT (priv->ctags_launcher), "child-exited",
G_CALLBACK (on_scan_files_end_1), NULL);
- exe_string = g_strdup_printf ("%s --fields=afmiKlnsStz --c++-kinds=+p "
+ exe_string = g_strdup_printf ("%s --sort=no --fields=afmiKlnsStz --c++-kinds=+p "
"--filter=yes --filter-terminator='"CTAGS_MARKER"'",
priv->ctags_path);
Modified: trunk/plugins/symbol-db/symbol-db-view-locals.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-view-locals.c (original)
+++ trunk/plugins/symbol-db/symbol-db-view-locals.c Sun Nov 30 11:24:26 2008
@@ -431,7 +431,7 @@
return NULL;
/* look up the row ref in the hashtable, then get its associated gtktreeiter */
- row_ref = g_tree_lookup (priv->nodes_displayed, (gpointer)parent_symbol_id);
+ row_ref = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (parent_symbol_id));
if (sdb_view_locals_get_iter_from_row_ref (dbvl, row_ref, &iter) == FALSE)
{
@@ -515,7 +515,7 @@
if (grandparent_id > 0)
{
row_ref =
- g_tree_lookup (priv->nodes_displayed, (gpointer)grandparent_id);
+ g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (grandparent_id));
if (row_ref != NULL)
{
/* hey we have a namespace or something which is the parent of
@@ -527,7 +527,7 @@
row_ref = do_add_child_symbol_to_view (dbvl, grandparent_id, pixbuf,
symbol_name, parent_id);
- g_tree_insert (priv->nodes_displayed, (gpointer)parent_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (parent_id),
row_ref);
}
/* DEBUG_PRINT ("traverse_on_scan_end (): row_ref %d", row_ref);*/
@@ -539,7 +539,7 @@
row_ref = do_add_root_symbol_to_view (dbvl, pixbuf,
symbol_name, parent_id);
- g_tree_insert (priv->nodes_displayed, (gpointer)parent_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (parent_id),
row_ref);
}
@@ -573,7 +573,7 @@
symbol_id_added = wfs->child_symbol_id;
/* add a new entry on gtree 'nodes_displayed' */
- g_tree_insert (priv->nodes_displayed, (gpointer)wfs->child_symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (wfs->child_symbol_id),
child_tree_row_ref);
/* and now trigger the inserted symbol... (recursive function). */
@@ -595,7 +595,7 @@
/*DEBUG_PRINT ("trigger_on_symbol_inserted (): triggering %d", symbol_id);*/
/* try to find a waiting for symbol */
- slist = g_tree_lookup (priv->waiting_for, (gpointer)symbol_id);
+ slist = g_tree_lookup (priv->waiting_for, GINT_TO_POINTER (symbol_id));
if (slist == NULL)
{
@@ -623,7 +623,7 @@
}
/* remove the waiting for key/value */
- g_tree_remove (priv->waiting_for, (gpointer)symbol_id);
+ g_tree_remove (priv->waiting_for, GINT_TO_POINTER (symbol_id));
g_slist_free (slist);
}
}
@@ -639,6 +639,11 @@
g_return_if_fail (dbvl != NULL);
priv = dbvl->priv;
+ /* we don't want a negative parent_symbol_id */
+ if (parent_symbol_id < 0)
+ return;
+
+
/* check if we already have some children waiting for a
* specific father to be inserted, then add this symbol_id to the list
* (or create a new one)
@@ -652,7 +657,7 @@
/* DEBUG_PRINT ("add_new_waiting_for (): looking up waiting_for %d",
parent_symbol_id);*/
- node = g_tree_lookup (priv->waiting_for, (gpointer)parent_symbol_id);
+ node = g_tree_lookup (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id));
if (node == NULL)
{
/* no lists already set. Create one. */
@@ -665,7 +670,7 @@
"waiting_for [%d]", parent_symbol_id);*/
/* add it to the binary tree. */
- g_tree_insert (priv->waiting_for, (gpointer)parent_symbol_id,
+ g_tree_insert (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id),
slist);
}
else
@@ -679,7 +684,7 @@
parent_symbol_id, symbol_name);*/
slist = g_slist_prepend (slist, wfs);
- g_tree_replace (priv->waiting_for, (gpointer)parent_symbol_id,
+ g_tree_replace (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id),
slist);
}
}
@@ -730,7 +735,7 @@
curr_symbol_id, curr_pixbuf);
gtk_tree_store_remove (store, parent_subtree_iter);
- g_tree_remove (priv->nodes_displayed, (gpointer) curr_symbol_id);
+ g_tree_remove (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
/* don't forget to free this gchar */
g_free (curr_symbol_name);
@@ -764,7 +769,7 @@
symbol_id);
/* we'll fake the gpointer to store an int */
- g_tree_insert (priv->nodes_displayed, (gpointer)symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (symbol_id),
curr_tree_row_ref);
/* let's trigger the insertion of the symbol_id, there may be some children
@@ -778,7 +783,7 @@
/* do we already have that parent_symbol displayed in gtktreeview?
* If that's the case add it as children.
*/
- node = g_tree_lookup (priv->nodes_displayed, (gpointer)parent_symbol_id);
+ node = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (parent_symbol_id));
if (node != NULL)
{
@@ -791,7 +796,7 @@
pixbuf, symbol_name, symbol_id);
/* add the children_path to the GTree. */
- g_tree_insert (priv->nodes_displayed, (gpointer)symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (symbol_id),
child_row_ref);
trigger_on_symbol_inserted (dbvl, symbol_id);
}
@@ -967,7 +972,7 @@
symbol_db_engine_iterator_node_get_symbol_id (iter_node);
row_ref = g_tree_lookup (priv->nodes_displayed,
- (gpointer)curr_child_id);
+ GINT_TO_POINTER (curr_child_id));
if (row_ref == NULL)
continue;
@@ -1069,7 +1074,7 @@
}
gtk_tree_store_remove (store, parent_subtree_iter);
- g_tree_remove (priv->nodes_displayed, (gpointer) curr_symbol_id);
+ g_tree_remove (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
/* don't forget to free this gchar */
g_free (curr_symbol_name);
@@ -1096,7 +1101,7 @@
DEBUG_PRINT ("on_symbol_removed (): -local- %d", symbol_id);
- row_ref = g_tree_lookup (priv->nodes_displayed, (gpointer)symbol_id);
+ row_ref = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (symbol_id));
if (sdb_view_locals_get_iter_from_row_ref (dbvl, row_ref, &iter) == FALSE)
{
return;
@@ -1124,7 +1129,7 @@
}
DEBUG_PRINT ("on_symbol_scope_updated () -local- %d", symbol_id);
- row_ref = g_tree_lookup (priv->nodes_displayed, (gpointer)symbol_id);
+ row_ref = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (symbol_id));
if (sdb_view_locals_get_iter_from_row_ref (dbvl, row_ref, &iter) == FALSE)
{
return;
@@ -1133,7 +1138,7 @@
do_recurse_subtree_and_remove (dbvl, &iter);
/* save the symbol_id to be added in the queue and just return */
- g_queue_push_head (priv->symbols_inserted_ids, (gpointer)symbol_id);
+ g_queue_push_head (priv->symbols_inserted_ids, GINT_TO_POINTER (symbol_id));
}
static void
@@ -1153,7 +1158,7 @@
}
/* save the symbol_id to be added in the queue and just return */
- g_queue_push_head (priv->symbols_inserted_ids, (gpointer)symbol_id);
+ g_queue_push_head (priv->symbols_inserted_ids, GINT_TO_POINTER (symbol_id));
}
gint
Modified: trunk/plugins/symbol-db/symbol-db-view.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-view.c (original)
+++ trunk/plugins/symbol-db/symbol-db-view.c Sun Nov 30 11:24:26 2008
@@ -88,7 +88,7 @@
static void
waiting_for_symbol_destroy (WaitingForSymbol *wfs)
-{
+{
g_return_if_fail (wfs != NULL);
g_free (wfs->child_symbol_name);
g_free (wfs);
@@ -128,7 +128,7 @@
static gboolean
traverse_free_waiting_for (gpointer key, gpointer value, gpointer data)
{
- if (value == NULL)
+ if (value == NULL || key == NULL)
return FALSE;
g_slist_foreach ((GSList*)value, (GFunc)waiting_for_symbol_destroy, NULL);
@@ -150,7 +150,7 @@
if (store != NULL)
g_object_unref (store);
- /* this will free alto the priv->row_ref* instances */
+ /* this will free also the priv->row_ref* instances */
if (priv->nodes_displayed)
{
g_tree_destroy (priv->nodes_displayed);
@@ -181,7 +181,7 @@
/* void the waiting_for symbols */
/* free the waiting_for structs before destroying the tree itself */
if (priv->waiting_for)
- {
+ {
g_tree_foreach (priv->waiting_for, traverse_free_waiting_for, data);
g_tree_destroy (priv->waiting_for);
@@ -250,7 +250,7 @@
store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (dbv)));
/* look up the row ref in the hashtable, then get its associated gtktreeiter */
- row_ref = g_tree_lookup (priv->nodes_displayed, (gpointer)parent_symbol_id);
+ row_ref = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (parent_symbol_id));
if (sdb_view_get_iter_from_row_ref (dbv, row_ref, &iter) == FALSE)
{
@@ -296,7 +296,7 @@
symbol_id_added = wfs->child_symbol_id;
/* add a new entry on gtree 'nodes_displayed' */
- g_tree_insert (priv->nodes_displayed, (gpointer)wfs->child_symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (wfs->child_symbol_id),
child_tree_row_ref);
/* and now trigger the inserted symbol... (recursive function). */
@@ -316,10 +316,10 @@
priv = dbv->priv;
-/* DEBUG_PRINT ("trigger_on_symbol_inserted (): triggering %d", symbol_id);*/
+ /*DEBUG_PRINT ("trigger_on_symbol_inserted (): triggering %d", symbol_id);*/
/* try to find a waiting for symbol */
- slist = g_tree_lookup (priv->waiting_for, (gpointer)symbol_id);
+ slist = g_tree_lookup (priv->waiting_for, GINT_TO_POINTER (symbol_id));
if (slist == NULL)
{
@@ -331,7 +331,7 @@
gint i;
gint length = g_slist_length (slist);
-/* DEBUG_PRINT ("trigger_on_symbol_inserted (): consuming slist for parent %d",
+ /*DEBUG_PRINT ("trigger_on_symbol_inserted (): consuming slist for parent %d",
symbol_id);*/
for (i=0; i < length-1; i++)
@@ -347,7 +347,7 @@
}
/* remove the waiting for key/value */
- g_tree_remove (priv->waiting_for, (gpointer)symbol_id);
+ g_tree_remove (priv->waiting_for, GINT_TO_POINTER (symbol_id));
g_slist_free (slist);
}
}
@@ -364,6 +364,10 @@
g_return_if_fail (dbv != NULL);
priv = dbv->priv;
+ /* we don't want a negative parent_symbol_id */
+ if (parent_symbol_id < 0)
+ return;
+
/* check if we already have some children waiting for a
* specific father to be inserted, then add this symbol_id to the list
* (or create a new one)
@@ -375,7 +379,7 @@
wfs->child_symbol_name = g_strdup (symbol_name);
wfs->pixbuf = pixbuf;
- node = g_tree_lookup (priv->waiting_for, (gpointer)parent_symbol_id);
+ node = g_tree_lookup (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id));
if (node == NULL)
{
/* no lists already set. Create one. */
@@ -383,9 +387,9 @@
slist = g_slist_alloc ();
slist = g_slist_prepend (slist, wfs);
-
+
/* add it to the binary tree. */
- g_tree_insert (priv->waiting_for, (gpointer)parent_symbol_id,
+ g_tree_insert (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id),
slist);
}
else
@@ -395,8 +399,8 @@
slist = (GSList*)node;
slist = g_slist_prepend (slist, wfs);
-
- g_tree_replace (priv->waiting_for, (gpointer)parent_symbol_id,
+
+ g_tree_replace (priv->waiting_for, GINT_TO_POINTER (parent_symbol_id),
slist);
}
}
@@ -448,7 +452,7 @@
curr_symbol_id, curr_pixbuf);
gtk_tree_store_remove (store, parent_subtree_iter);
- g_tree_remove (priv->nodes_displayed, (gpointer) curr_symbol_id);
+ g_tree_remove (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
/* don't forget to free this gchar */
g_free (curr_symbol_name);
@@ -502,7 +506,7 @@
{
gpointer node;
/* Vars/Other may not be displayed already. Check it. */
- node = g_tree_lookup (priv->nodes_displayed, (gpointer)-ROOT_GLOBAL);
+ node = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (-ROOT_GLOBAL));
if (node != NULL)
{
@@ -528,7 +532,7 @@
}
/* we'll fake the gpointer to store an int */
- g_tree_insert (priv->nodes_displayed, (gpointer)symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (symbol_id),
curr_tree_row_ref);
/* let's trigger the insertion of the symbol_id, there may be some children
@@ -560,7 +564,7 @@
/* do we already have that parent_symbol displayed in gtktreeview?
* If that's the case add it as children.
*/
- node = g_tree_lookup (priv->nodes_displayed, (gpointer)parent_symbol_id);
+ node = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (parent_symbol_id));
if (node != NULL)
{
@@ -570,7 +574,7 @@
pixbuf, symbol_name, symbol_id);
/* add the children_path to the GTree. */
- g_tree_insert (priv->nodes_displayed, (gpointer)symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (symbol_id),
child_row_ref);
trigger_on_symbol_inserted (dbv, symbol_id);
}
@@ -678,7 +682,7 @@
symbol_db_engine_iterator_node_get_symbol_id (iter_node);
row_ref = g_tree_lookup (priv->nodes_displayed,
- (gpointer)curr_child_id);
+ GINT_TO_POINTER (curr_child_id));
if (row_ref == NULL)
continue;
@@ -735,7 +739,7 @@
}
gtk_tree_store_remove (store, parent_subtree_iter);
- g_tree_remove (priv->nodes_displayed, (gpointer) curr_symbol_id);
+ g_tree_remove (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
/* don't forget to free this gchar */
g_free (curr_symbol_name);
@@ -760,7 +764,7 @@
DEBUG_PRINT ("on_symbol_removed (): -global- %d", symbol_id);
- row_ref = g_tree_lookup (priv->nodes_displayed, (gpointer)symbol_id);
+ row_ref = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (symbol_id));
if (sdb_view_get_iter_from_row_ref (dbv, row_ref, &iter) == FALSE)
{
return;
@@ -825,7 +829,7 @@
/* remove from the GTree the ids of the func expanding */
g_tree_remove (dbv->priv->expanding_gfunc_ids,
- (gpointer)node_expand->expanded_symbol_id);
+ GINT_TO_POINTER (node_expand->expanded_symbol_id));
if (node_expand->expanded_path != NULL) {
gtk_tree_path_free (node_expand->expanded_path);
@@ -866,7 +870,7 @@
iter_node = SYMBOL_DB_ENGINE_ITERATOR_NODE (iterator);
curr_symbol_id = symbol_db_engine_iterator_node_get_symbol_id (iter_node);
- node = g_tree_lookup (priv->nodes_displayed, (gpointer)curr_symbol_id);
+ node = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
if (node != NULL)
{
@@ -890,7 +894,7 @@
}
/* we'll fake the gpointer to store an int */
- g_tree_insert (priv->nodes_displayed, (gpointer)curr_symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id),
curr_tree_row_ref);
sdb_view_get_iter_from_row_ref (dbv, curr_tree_row_ref, &iter);
@@ -912,9 +916,10 @@
{
return TRUE;
}
- else {
+ else
+ {
if (g_tree_lookup (priv->nodes_displayed,
- (gpointer)-node_expand->expanded_symbol_id) == NULL)
+ GINT_TO_POINTER (-node_expand->expanded_symbol_id)) == NULL)
{
GtkTreeRowReference *others_row_ref;
GtkTreeIter others_dummy_node;
@@ -926,7 +931,7 @@
/* insert a negative node ... */
g_tree_insert (priv->nodes_displayed,
- (gpointer)-node_expand->expanded_symbol_id,
+ GINT_TO_POINTER (-node_expand->expanded_symbol_id),
others_row_ref);
/* ... and a dummy child */
@@ -958,7 +963,7 @@
DEBUG_PRINT ("%s", "sdb_view_namespace_row_expanded ");
/* check if there's another expanding idle_func running */
- node = g_tree_lookup (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id);
+ node = g_tree_lookup (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id));
if (node != NULL)
{
return;
@@ -1004,8 +1009,8 @@
(GDestroyNotify) sdb_view_row_expanded_idle_destroy);
/* insert the idle_id into a g_tree */
- g_tree_insert (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id,
- (gpointer)idle_id);
+ g_tree_insert (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id),
+ GINT_TO_POINTER (idle_id));
}
}
@@ -1028,7 +1033,7 @@
DEBUG_PRINT ("%s", "sdb_view_global_row_expanded ()");
/* check if there's another expanding idle_func running */
- node = g_tree_lookup (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id);
+ node = g_tree_lookup (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id));
if (node != NULL)
{
return;
@@ -1074,8 +1079,8 @@
/* insert the idle_id into a g_tree for (eventually) a later retrieval */
DEBUG_PRINT ("Inserting into g_tree expanded_symbol_id %d and idle_id %d",
expanded_symbol_id, idle_id);
- g_tree_insert (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id,
- (gpointer)idle_id);
+ g_tree_insert (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id),
+ GINT_TO_POINTER (idle_id));
}
}
@@ -1099,7 +1104,7 @@
DEBUG_PRINT ("%s", "sdb_view_vars_row_expanded ()");
/* check if there's another expanding idle_func running */
- node = g_tree_lookup (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id);
+ node = g_tree_lookup (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id));
if (node != NULL)
{
return;
@@ -1157,8 +1162,8 @@
(GDestroyNotify) sdb_view_row_expanded_idle_destroy);
/* insert the idle_id into a g_tree */
- g_tree_insert (priv->expanding_gfunc_ids, (gpointer)expanded_symbol_id,
- (gpointer)idle_id);
+ g_tree_insert (priv->expanding_gfunc_ids, GINT_TO_POINTER (expanded_symbol_id),
+ GINT_TO_POINTER (idle_id));
}
}
@@ -1278,7 +1283,7 @@
* check if the curr_symbol_id is already displayed. In that case
* skip to the next symbol
*/
- node = g_tree_lookup (priv->nodes_displayed, (gpointer)curr_symbol_id);
+ node = g_tree_lookup (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id));
if (node != NULL)
{
@@ -1312,7 +1317,7 @@
/* insert the just append row_ref into the GTree for a quick retrieval
* later
*/
- g_tree_insert (priv->nodes_displayed, (gpointer)curr_symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id),
child_row_ref);
/* good. Let's check now for a child (B) of the just appended child (A).
@@ -1353,7 +1358,7 @@
/* do a quick check to see if the collapsed_symbol_id is listed into the
* currently expanding symbols. If that's the case remove the gsource func.
*/
- node = g_tree_lookup (priv->expanding_gfunc_ids, (gpointer)collapsed_symbol_id);
+ node = g_tree_lookup (priv->expanding_gfunc_ids, GINT_TO_POINTER (collapsed_symbol_id));
if (node == NULL)
{
@@ -1362,7 +1367,7 @@
}
else {
g_source_remove ((gint)node);
- g_tree_remove (priv->expanding_gfunc_ids, (gpointer)collapsed_symbol_id);
+ g_tree_remove (priv->expanding_gfunc_ids, GINT_TO_POINTER (collapsed_symbol_id));
}
}
@@ -1729,7 +1734,7 @@
}
/* we'll fake the gpointer to store an int */
- g_tree_insert (priv->nodes_displayed, (gpointer)curr_symbol_id,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (curr_symbol_id),
curr_tree_row_ref);
if (sdb_view_get_iter_from_row_ref (dbv, curr_tree_row_ref,
@@ -1760,7 +1765,7 @@
{
return;
}
- g_tree_insert (priv->nodes_displayed, (gpointer)ROOT_GLOBAL,
+ g_tree_insert (priv->nodes_displayed, GINT_TO_POINTER (ROOT_GLOBAL),
global_tree_row_ref);
if (sdb_view_get_iter_from_row_ref (dbv, global_tree_row_ref,
@@ -1841,7 +1846,7 @@
priv = dbv->priv;
- DEBUG_PRINT ("%s", "symbol_db_view_open ()");
+ /*DEBUG_PRINT ("%s", "symbol_db_view_open ()");*/
symbol_db_view_clear_cache (dbv);
store = sdb_view_create_new_store ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]