[anjuta] bgo #608701 - Compiler warnings



commit 2fb53e2586172b082292d81e8453d1d1341cd1b7
Author: Jonh Wendell <jwendell gnome org>
Date:   Tue Feb 2 16:01:17 2010 +0100

    bgo #608701 -  Compiler warnings

 libanjuta/anjuta-project.c                         |    6 +-
 plugins/debug-manager/chunk_view.c                 |    2 +-
 plugins/dir-project/dir-project.c                  |   35 -----
 plugins/file-manager/plugin.h                      |    2 +
 plugins/gbf-am/test.c                              |    2 +-
 plugins/gbf-mkfile/gbf-mkfile-project.c            |    4 +-
 plugins/glade/plugin.c                             |   12 --
 plugins/gtodo/egg-datetime.c                       |    2 +-
 plugins/gtodo/libgtodo.c                           |    2 +-
 .../language-support-cpp-java/cpp-java-assist.c    |    2 +-
 plugins/macro/macro-actions.c                      |    2 +-
 plugins/project-manager/gbf-project-model.c        |  161 --------------------
 plugins/project-manager/plugin.c                   |  103 +------------
 plugins/project-wizard/druid.c                     |    2 +-
 plugins/project-wizard/property.c                  |    4 +-
 15 files changed, 17 insertions(+), 324 deletions(-)
---
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index aa7c394..4b73e5e 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -259,7 +259,7 @@ anjuta_project_group_get_node_from_file (const AnjutaProjectGroup *root, GFile *
 	GFile *data;
 	
 	data = directory;
-	g_node_traverse	(root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, anjuta_project_group_compare, &data);
+	g_node_traverse	((GNode *)root, G_PRE_ORDER, G_TRAVERSE_ALL, -1, anjuta_project_group_compare, &data);
 
 	return (data == directory) ? NULL : (AnjutaProjectNode *)data;
 }
@@ -299,7 +299,7 @@ anjuta_project_target_get_node_from_name (const AnjutaProjectGroup *parent, cons
 	const gchar *data;
 	
 	data = name;
-	g_node_traverse	(parent, G_PRE_ORDER, G_TRAVERSE_ALL, 2, anjuta_project_target_compare, &data);
+	g_node_traverse	((GNode *)parent, G_PRE_ORDER, G_TRAVERSE_ALL, 2, anjuta_project_target_compare, &data);
 
 	return (data == name) ? NULL : (AnjutaProjectTarget *)data;
 }
@@ -327,7 +327,7 @@ anjuta_project_source_get_node_from_file (const AnjutaProjectNode *parent, GFile
 	GFile *data;
 	
 	data = file;
-	g_node_traverse	(parent, G_PRE_ORDER, G_TRAVERSE_ALL, 2, anjuta_project_source_compare, &data);
+	g_node_traverse	((GNode *)parent, G_PRE_ORDER, G_TRAVERSE_ALL, 2, anjuta_project_source_compare, &data);
 
 	return (data == file) ? NULL : (AnjutaProjectNode *)data;
 }
diff --git a/plugins/debug-manager/chunk_view.c b/plugins/debug-manager/chunk_view.c
index 8591a5f..d03b657 100644
--- a/plugins/debug-manager/chunk_view.c
+++ b/plugins/debug-manager/chunk_view.c
@@ -78,7 +78,7 @@ dma_chunk_view_move_cursor (GtkTextView *text_view,
 	GtkTextBuffer *buffer;
 	GtkTextIter cur;
 	gint line;
-	gdouble value, step_increment;
+	gdouble value = 0, step_increment;
 	
 	switch (step)
 	{
diff --git a/plugins/dir-project/dir-project.c b/plugins/dir-project/dir-project.c
index 60c6f3b..fda62e8 100644
--- a/plugins/dir-project/dir-project.c
+++ b/plugins/dir-project/dir-project.c
@@ -131,28 +131,6 @@ static GObject *parent_class;
 /* Helper functions
  *---------------------------------------------------------------------------*/
 
-static void
-error_set (GError **error, gint code, const gchar *message)
-{
-        if (error != NULL) {
-                if (*error != NULL) {
-                        gchar *tmp;
-
-                        /* error already created, just change the code
-                         * and prepend the string */
-                        (*error)->code = code;
-                        tmp = (*error)->message;
-                        (*error)->message = g_strconcat (message, "\n\n", tmp, NULL);
-                        g_free (tmp);
-
-                } else {
-                        *error = g_error_new_literal (IANJUTA_PROJECT_ERROR,
-                                                      code,
-                                                      message);
-                }
-        }
-}
-
 /*
  * File monitoring support --------------------------------
  * FIXME: review these
@@ -284,19 +262,6 @@ dir_group_free (DirGroup *node)
 /* Target objects
  *---------------------------------------------------------------------------*/
 
-static DirTarget*
-dir_target_new (const gchar *name, AnjutaProjectTargetType type)
-{
-    DirTargetData *target = NULL;
-
-	target = g_slice_new0(DirTargetData); 
-	target->base.node.type = ANJUTA_PROJECT_TARGET;
-	target->base.name = g_strdup (name);
-	target->base.type = type;
-
-    return g_node_new (target);
-}
-
 static void
 dir_target_free (DirTarget *node)
 {
diff --git a/plugins/file-manager/plugin.h b/plugins/file-manager/plugin.h
index de209ba..a4966c1 100644
--- a/plugins/file-manager/plugin.h
+++ b/plugins/file-manager/plugin.h
@@ -34,6 +34,8 @@
 typedef struct _AnjutaFileManager AnjutaFileManager;
 typedef struct _AnjutaFileManagerClass AnjutaFileManagerClass;
 
+extern GType file_manager_get_type (GTypeModule *module);
+
 struct _AnjutaFileManager {
 	AnjutaPlugin parent;
 	AnjutaFileView* fv;
diff --git a/plugins/gbf-am/test.c b/plugins/gbf-am/test.c
index f2a559e..a3b20d3 100644
--- a/plugins/gbf-am/test.c
+++ b/plugins/gbf-am/test.c
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
 	dir = argv [1];
 	
 	g_print ("+ Creating new gbf-am project\n");
-	project = gbf_am_project_new ();
+	project = GBF_PROJECT (gbf_am_project_new ());
 	if (!project) {
 		g_print ("! Project creation failed\n");
 		return 0;
diff --git a/plugins/gbf-mkfile/gbf-mkfile-project.c b/plugins/gbf-mkfile/gbf-mkfile-project.c
index eb13bec..e88a896 100644
--- a/plugins/gbf-mkfile/gbf-mkfile-project.c
+++ b/plugins/gbf-mkfile/gbf-mkfile-project.c
@@ -1269,9 +1269,9 @@ sax_start_element (void *ctxt, const xmlChar *name, const xmlChar **attrs)
 		}
 		PARSER_ASSERT (uri != NULL);
 
-		if (g_path_is_absolute (uri))
+		if (g_path_is_absolute ((const gchar *)uri))
 		{
-			GFile *file = g_file_new_for_path (uri);
+			GFile *file = g_file_new_for_path ((const gchar *)uri);
 			source_uri = g_file_get_uri (file);
 			g_object_unref (file);
 		}
diff --git a/plugins/glade/plugin.c b/plugins/glade/plugin.c
index 0aeed9b..d641c51 100644
--- a/plugins/glade/plugin.c
+++ b/plugins/glade/plugin.c
@@ -927,18 +927,6 @@ update_actions (GladePlugin *plugin)
 static void
 update_prefs_page (GladePlugin *plugin);
 
-static gchar *
-claim_xml_string (xmlChar *str)
-{
-	gchar *new_str = NULL;
-
-
-	if (xmlStrcmp (str, BAD_CAST ("")) != 0)
-		new_str = g_strdup ((gchar *) str);
-	xmlFree (str);
-	return new_str;
-}
-
 static void
 glade_plugin_load_preferences (GladePlugin *plugin, xmlDocPtr xml_doc, xmlNodePtr node)
 {
diff --git a/plugins/gtodo/egg-datetime.c b/plugins/gtodo/egg-datetime.c
index 63b1635..2121710 100644
--- a/plugins/gtodo/egg-datetime.c
+++ b/plugins/gtodo/egg-datetime.c
@@ -1105,7 +1105,7 @@ time_popup_changed (EggDateTime *edt, Timelist *timelist)
 
 	normalize_time (edt);
 
-	if (gtk_widget_get_visible (timelist))
+	if (gtk_widget_get_visible (GTK_WIDGET (timelist)))
 		update_time_label (edt);
 
 	g_signal_emit (G_OBJECT (edt), egg_datetime_signals[SIGNAL_TIME_CHANGED], 0);
diff --git a/plugins/gtodo/libgtodo.c b/plugins/gtodo/libgtodo.c
index ea8dd9d..09d217a 100644
--- a/plugins/gtodo/libgtodo.c
+++ b/plugins/gtodo/libgtodo.c
@@ -1112,7 +1112,7 @@ gboolean gtodo_client_save_todo_item(GTodoClient *cl, GTodoItem *item)
 			}
 			/* last edited (to the start date attribute) */
 			{
-				temp1 = g_strdup_printf("%u", time(NULL));
+				temp1 = g_strdup_printf("%li", time(NULL));
 				xmlSetProp(newa, (xmlChar *)"last_edited", (xmlChar *)temp1);
 				g_free(temp1);
 			}
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index d36866a..923f88f 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -109,7 +109,7 @@ cpp_java_assist_tag_destroy (CppJavaAssistTag *tag)
 {
 	g_free (tag->name);
 	if (tag->icon)
-		gdk_pixbuf_unref (tag->icon);
+		g_object_unref (tag->icon);
 	g_free (tag);
 }
 
diff --git a/plugins/macro/macro-actions.c b/plugins/macro/macro-actions.c
index abdb9d7..5c6df46 100644
--- a/plugins/macro/macro-actions.c
+++ b/plugins/macro/macro-actions.c
@@ -65,7 +65,7 @@ on_shortcut_pressed (GtkWidget * window, GdkEventKey * event,
 	/* Plase note that this implementation is deprecated but
 	 * I could not figure out how to do this with GtkIMContext as 
 	 * proposed by the gtk docs */
-#warning FIXME: Deprecated
+/* FIXME: Deprecated */
 	if (event->length)
 		key = event->string[0];
 	else
diff --git a/plugins/project-manager/gbf-project-model.c b/plugins/project-manager/gbf-project-model.c
index 23ccdd6..f3ec7a9 100644
--- a/plugins/project-manager/gbf-project-model.c
+++ b/plugins/project-manager/gbf-project-model.c
@@ -91,25 +91,6 @@ static GtkTreeStoreClass *parent_class = NULL;
 
 /* Helper functions */
 
-static void
-my_gtk_tree_model_foreach_child (GtkTreeModel *const model,
-                           GtkTreeIter *const parent,
-                           GtkTreeModelForeachFunc func,
-                           gpointer user_data)
-{
-  GtkTreeIter iter;
-  gboolean success = gtk_tree_model_iter_children(model, &iter, parent);
-  while(success)
-  {
-    if(gtk_tree_model_iter_has_child(model, &iter))
-        my_gtk_tree_model_foreach_child (model, &iter, func, NULL);
-
-        success = (!func(model, NULL, &iter, user_data) &&
-               gtk_tree_model_iter_next (model, &iter));
-  }
-}
-
-
 /* Type & interfaces initialization */
 
 static void
@@ -775,148 +756,6 @@ gbf_project_model_find_tree_data (GbfProjectModel 	*model,
 	return retval;
 }
 
-static GbfTreeData *
-recursive_find_group (GtkTreeModel   	*model,
-		   GtkTreeIter     	*parent,
-    		   GtkTreeIter		*found,
-		   GFile		*file)
-{
-	GtkTreeIter iter;
-	gboolean next;
-	GbfTreeData *data = NULL;
-
-	for (next = gtk_tree_model_iter_children (model, &iter, parent);
-	    next;
-	    next = gtk_tree_model_iter_next (model, &iter))
-	{
-		gtk_tree_model_get (model, &iter,
-		    GBF_PROJECT_MODEL_COLUMN_DATA, &data, -1);
-
-		if (data->type == GBF_TREE_NODE_SHORTCUT)
-		{
-			data = data->shortcut;
-		}
-		if ((data->type == GBF_TREE_NODE_GROUP) && (data->group != NULL) && g_file_equal (data->group, file))
-		{
-			if (found != NULL) *found = iter;
-			return data;
-		}
-
-		data = recursive_find_group (model, &iter, found, file);
-		if (data != NULL) return data;
-	}
-
-	return NULL;
-}
-
-static GbfTreeData *
-recursive_find_target (GtkTreeModel   	*model,
-		   GtkTreeIter     	*parent,
-    		   GtkTreeIter		*found,
-		   const gchar	        *name)
-{
-	GtkTreeIter iter;
-	gboolean next;
-	GbfTreeData *data = NULL;
-
-	for (next = gtk_tree_model_iter_children (model, &iter, parent);
-	    next;
-	    next = gtk_tree_model_iter_next (model, &iter))
-	{
-		gtk_tree_model_get (model, &iter,
-		    GBF_PROJECT_MODEL_COLUMN_DATA, &data, -1);
-
-		if (data->type == GBF_TREE_NODE_SHORTCUT)
-		{
-			data = data->shortcut;
-		}
-		if ((data->type == GBF_TREE_NODE_TARGET) && (data->name != NULL) && (strcmp (data->name, name) == 0))
-		{
-			if (found != NULL) *found = iter;
-			return data;
-		}
-		else
-		{
-			return NULL;
-		}
-	}
-
-	return NULL;
-}
-
-static GbfTreeData *
-recursive_find_source (GtkTreeModel   	*model,
-		   GtkTreeIter     	*parent,
-		   GtkTreeIter     	*found,
-		   GFile		*file)
-{
-	GtkTreeIter iter;
-	gboolean next;
-	GbfTreeData *data = NULL;
-
-	for (next = gtk_tree_model_iter_children (model, &iter, parent);
-	    next;
-	    next = gtk_tree_model_iter_next (model, &iter))
-	{
-		gtk_tree_model_get (model, &iter,
-		    GBF_PROJECT_MODEL_COLUMN_DATA, &data, -1);
-
-		if (data->type == GBF_TREE_NODE_SHORTCUT)
-		{
-			data = data->shortcut;
-		}
-		if ((data->type == GBF_TREE_NODE_SOURCE) && (data->source != NULL) && g_file_equal (data->source, file))
-		{
-			if (found != NULL) *found = iter;
-			return data;
-		}
-		
-		data = recursive_find_group (model, &iter, found, file);
-		if (data != NULL) return data;
-	}
-
-	return NULL;
-}
-
-static GbfTreeData*
-gbf_project_model_find_uri (GbfProjectModel     *model,
-    			    const gchar         *uri,
-    			    GbfTreeNodeType     type)
-{
-	GFile *file;
-	GFile *group;
-	gchar *name;
-	GbfTreeData *data = NULL;
-	GtkTreeIter iter;
-
-	file = g_file_new_for_uri (uri);
-	switch (type)
-	{
-	case GBF_TREE_NODE_SOURCE:
-		data = recursive_find_source (GTK_TREE_MODEL (model), NULL, NULL, file);
-		break;
-	case GBF_TREE_NODE_GROUP:
-		data = recursive_find_group (GTK_TREE_MODEL (model), NULL, NULL, file);
-		break;
-	case GBF_TREE_NODE_TARGET:
-		group = g_file_get_parent (file);
-		name = g_file_get_basename (file);
-		if (recursive_find_group (GTK_TREE_MODEL (model), NULL, &iter, group))
-		{
-			data = recursive_find_target (GTK_TREE_MODEL (model), &iter, NULL, name);
-		}
-		g_free (name);
-		g_object_unref (group);
-		break;
-	default:
-		break;
-	}
-		
-	g_object_unref (file);
-
-	return data;
-}
-
 GbfProjectModel *
 gbf_project_model_new (IAnjutaProject *project)
 {
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index aa3124b..7128160 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -238,7 +238,7 @@ find_missing_files (GList *pre, GList *post)
 	GList *ret = NULL;
 	GList *node;
 	
-	hash = g_hash_table_new (g_file_hash, g_file_equal);
+	hash = g_hash_table_new (g_file_hash, (GEqualFunc) g_file_equal);
 	node = pre;
 	while (node)
 	{
@@ -1825,28 +1825,6 @@ project_manager_plugin_class_init (GObjectClass *klass)
 
 /* IAnjutaProjectManager implementation */
 
-static GFileType
-get_uri_vfs_type (const gchar *uri)
-{
-	GFileType retval = G_FILE_TYPE_UNKNOWN;
-	GFile *file;
-	GFileInfo *file_info;
-
-	file = g_file_new_for_uri (uri);
-	file_info = g_file_query_info (file,
-		G_FILE_ATTRIBUTE_STANDARD_TYPE,
-		G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
-		NULL, NULL);
-	if (file_info)
-	{
-		retval = g_file_info_get_file_type (file_info);
-		g_object_unref (file_info);
-	}
-
-	g_object_unref (file);
-	return retval;
-}
-
 static gboolean
 file_is_inside_project (ProjectManagerPlugin *plugin, GFile *file)
 {
@@ -1937,85 +1915,6 @@ get_element_file_from_node (ProjectManagerPlugin *plugin, AnjutaProjectNode *nod
 	return file;
 }
 
-static const gchar *
-get_element_relative_path (ProjectManagerPlugin *plugin, const gchar *uri, const gchar *root)
-{
-	const gchar *project_root = NULL;
-	
-	anjuta_shell_get (ANJUTA_PLUGIN (plugin)->shell,
-					  root, G_TYPE_STRING,
-					  &project_root, NULL);
-	if (project_root == NULL)
-	{
-		/* Perhaps missing build URI, use project URI instead */
-		anjuta_shell_get (ANJUTA_PLUGIN (plugin)->shell,
-					  IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
-					  G_TYPE_STRING,
-					  &project_root,
-					  NULL);
-	}
-	if (project_root)
-	{
-		if (uri[0] != '/')
-		{
-			return uri + strlen (project_root);
-		}
-		else
-		{
-			const gchar *project_root_path = strchr (project_root, ':');
-			if (project_root_path)
-				project_root_path += 3;
-			else
-				project_root_path = project_root;
-			return uri + strlen (project_root_path);
-		}
-	}
-	return NULL;
-}
-
-static AnjutaProjectNode*
-get_node_from_file (AnjutaProjectNode *parent, GFile *file)
-{
-	AnjutaProjectNode *node;
-	GFile *target_file = NULL;
-
-	for (node = anjuta_project_node_first_child (parent); node != NULL; node = anjuta_project_node_next_sibling (node))
-	{
-		switch (anjuta_project_node_get_type (node))
-		{
-		case ANJUTA_PROJECT_GROUP:
-			if (g_file_equal (anjuta_project_group_get_directory (node), file))
-			{
-				return node;
-			}
-			else
-			{
-				return get_node_from_file (node, file);
-			}
-			break;
-		case ANJUTA_PROJECT_TARGET:
-			target_file = g_file_get_child (anjuta_project_group_get_directory (parent), anjuta_project_target_get_name (node));
-			if (g_file_equal (target_file, file))
-			{
-				g_object_unref (target_file);
-				return node;
-			}
-			g_object_unref (target_file);
-			break;
-		case ANJUTA_PROJECT_SOURCE:
-			if (g_file_equal (anjuta_project_source_get_file (node), file))
-			{
-				return node;
-			}
-			break;
-		default:
-			break;
-		}
-	}
-				
-	return NULL;		
-}
-
 static AnjutaProjectNode*
 get_project_node_from_file (ProjectManagerPlugin *plugin, GFile *file, AnjutaProjectNodeType type)
 {
diff --git a/plugins/project-wizard/druid.c b/plugins/project-wizard/druid.c
index f734bbf..e36ec4e 100644
--- a/plugins/project-wizard/druid.c
+++ b/plugins/project-wizard/druid.c
@@ -807,7 +807,7 @@ on_install_button_clicked (GtkWidget *button, NPWDruid *druid)
 	 */
 	anjuta_util_glist_strings_prefix (missing_programs, "/usr/bin/");
 
-	g_list_foreach (missing_packages, (GFunc *) strip_package_version_info,
+	g_list_foreach (missing_packages, (GFunc) strip_package_version_info,
 					NULL);
 	anjuta_util_glist_strings_prefix (missing_packages,
 									  "/usr/lib/pkgconfig/");
diff --git a/plugins/project-wizard/property.c b/plugins/project-wizard/property.c
index 67953cd..7a90b4e 100644
--- a/plugins/project-wizard/property.c
+++ b/plugins/project-wizard/property.c
@@ -519,9 +519,9 @@ npw_property_create_widget (NPWProperty* prop)
 		child = gtk_bin_get_child (GTK_BIN (entry));
 		if (!(prop->options & NPW_EDITABLE_OPTION))
 		{
-			gtk_editable_set_editable (child, FALSE);
+			gtk_editable_set_editable (GTK_EDITABLE (child), FALSE);
 		}
-		if (value) gtk_entry_set_text (child, value);
+		if (value) gtk_entry_set_text (GTK_ENTRY (child), value);
 		break;
 	}
 	default:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]