[geany/geany] e13aac: Remove unused tm_workspace_find_namespace_members()

Jiří Techet git-noreply at xxxxx
Thu Feb 11 14:35:54 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Sun, 10 Jan 2016 11:31:46 UTC
Commit:      e13aac0deab9533ca5f40c170895dcee0ca807c3
             https://github.com/geany/geany/commit/e13aac0deab9533ca5f40c170895dcee0ca807c3

Log Message:
-----------
Remove unused tm_workspace_find_namespace_members()

The implementation of this function is almost the same like the original
m_workspace_find_scoped_members() and there's nothing interesting here
we wouldn't be able to recreate trivially.


Modified Paths:
--------------
    tagmanager/src/tm_workspace.c

Modified: tagmanager/src/tm_workspace.c
203 lines changed, 0 insertions(+), 203 deletions(-)
===================================================================
@@ -956,209 +956,6 @@ void tm_workspace_dump(void)
 
 #if 0
 
-static int
-find_namespace_members_tags (const GPtrArray * all, GPtrArray * tags,
-						 	const langType langJava, const char *name,
-						 	const char *filename)
-{
-	GPtrArray *local = g_ptr_array_new ();
-	unsigned int i;
-	TMTag *tag;
-	size_t len = strlen (name);
-
-	g_return_val_if_fail (all != NULL, 0);
-
-	for (i = 0; (i < all->len); ++i)
-	{
-		tag = TM_TAG (all->pdata[i]);
-		if (filename && tag->file &&
-			0 != strcmp (filename,
-						 tag->file->short_name))
-		{
-			continue;
-		}
-
-		if (tag && tag->scope && tag->scope[0] != '\0')
-		{
-			if (0 == strncmp (name, tag->scope, len))
-			{
-				g_ptr_array_add (local, tag);
-			}
-		}
-	}
-
-	if (local->len > 0)
-	{
-		char *scope;
-		for (i = 0; (i < local->len); ++i)
-		{
-			tag = TM_TAG (local->pdata[i]);
-			scope = tag->scope;
-
-			/* if we wanna complete something like
-			 * namespace1::
-			 * we'll just return the tags that have "namespace1"
-			 * as their scope. So we won't return classes/members/namespaces
-			 * under, for example, namespace2, where namespace1::namespace2
-			 */
-			if (scope && 0 == strcmp (name, scope))
-			{
-				g_ptr_array_add (tags, tag);
-			}
-		}
-	}
-
-	g_ptr_array_free (local, TRUE);
-	return (int) tags->len;
-}
-
-static const GPtrArray *
-tm_workspace_find_namespace_members (const GPtrArray * file_tags, const char *name,
-								 gboolean search_global)
-{
-	static GPtrArray *tags = NULL;
-	GPtrArray *local = NULL;
-	char *new_name = (char *) name;
-	char *filename = NULL;
-	int found = 0, del = 0;
-	static langType langJava = -1;
-	TMTag *tag = NULL;
-
-	g_return_val_if_fail (name && name[0] != '\0', NULL);
-
-	if (!tags)
-		tags = g_ptr_array_new ();
-
-	while (1)
-	{
-		const GPtrArray *tags2;
-		guint got = 0;
-		TMTagType types = (tm_tag_class_t
-						   tm_tag_struct_t | tm_tag_typedef_t |
-						   tm_tag_union_t | tm_tag_enum_t);
-
-		if (file_tags)
-		{
-			g_ptr_array_set_size (tags, 0);
-			got = fill_find_tags_array (tags, file_tags,
-										  new_name, NULL, types, FALSE, -1, FALSE);
-		}
-
-
-		if (got)
-		{
-			tags2 = tags;
-		}
-		else
-		{
-			TMTagAttrType attrs[] = {
-				tm_tag_attr_name_t, tm_tag_attr_type_t,
-				tm_tag_attr_none_t
-			};
-			tags2 = tm_workspace_find (new_name, types, attrs, FALSE, -1);
-		}
-
-		if ((tags2) && (tags2->len == 1) && (tag = TM_TAG (tags2->pdata[0])))
-		{
-			if (tag->type == tm_tag_typedef_t && tag->var_type
-				&& tag->var_type[0] != '\0')
-			{
-				new_name = tag->var_type;
-				continue;
-			}
-			filename = (tag->file ?
-						tag->file->short_name : NULL);
-			if (tag->scope && tag->scope[0] != '\0')
-			{
-				del = 1;
-				if (tag->file &&
-					tag->file->lang == langJava)
-				{
-					new_name = g_strdup_printf ("%s.%s",
-												tag->scope,
-												new_name);
-				}
-				else
-				{
-					new_name = g_strdup_printf ("%s::%s",
-												tag->scope,
-												new_name);
-				}
-			}
-			break;
-		}
-		else
-		{
-			return NULL;
-		}
-	}
-
-	g_ptr_array_set_size (tags, 0);
-
-	if (tag && tag->file)
-	{
-		local = tm_tags_extract (tag->file->tags_array,
-								 (tm_tag_function_t |
-								  tm_tag_field_t | tm_tag_enumerator_t |
-								  tm_tag_namespace_t | tm_tag_class_t ));
-	}
-	else
-	{
-		local = tm_tags_extract (theWorkspace->tags_array,
-								 (tm_tag_function_t | tm_tag_prototype_t |
-								  tm_tag_member_t |
-								  tm_tag_field_t | tm_tag_enumerator_t |
-								  tm_tag_namespace_t | tm_tag_class_t ));
-	}
-
-	if (local)
-	{
-		found = find_namespace_members_tags (local, tags,
-										 langJava, new_name, filename);
-		g_ptr_array_free (local, TRUE);
-	}
-
-
-	if (!found && search_global)
-	{
-		GPtrArray *global = tm_tags_extract (theWorkspace->global_tags,
-											 (tm_tag_member_t |
-											  tm_tag_prototype_t |
-											  tm_tag_field_t |
-											  tm_tag_method_t |
-											  tm_tag_function_t |
-											  tm_tag_enumerator_t |
-											  tm_tag_namespace_t |
-											  tm_tag_class_t ));
-
-		if (global)
-		{
-			find_namespace_members_tags (global, tags, langJava,
-									 new_name, filename);
-/*/
-			DEBUG_PRINT ("returning these");
-  		    gint i;
-			for (i=0; i < tags->len; i++) {
-				TMTag *cur_tag;
-
-				cur_tag = (TMTag*)g_ptr_array_index (tags, i);
-				tm_tag_print (cur_tag, stdout );
-			}
-/*/
-			g_ptr_array_free (global, TRUE);
-		}
-	}
-
-
-	if (del)
-	{
-		g_free (new_name);
-	}
-
-	return tags;
-}
-
-
 /* Returns a list of parent classes for the given class name
  @param name Name of the class
  @return A GPtrArray of TMTag pointers (includes the TMTag for the class) */



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list