Fixes for some warnings from sparse/gcc



Here's a patch that's been sitting in bugzilla for a while:

http://bugzilla.gnome.org/show_bug.cgi?id=149714

Cheers
Kjartan

? depcomp
? stamp-h1
? warnings.sparse
? src/.nautilus-window.c.swp
Index: libnautilus-private/nautilus-directory-background.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-directory-background.c,v
retrieving revision 1.96
diff -u -p -r1.96 nautilus-directory-background.c
--- libnautilus-private/nautilus-directory-background.c	16 Mar 2005 08:32:20 -0000	1.96
+++ libnautilus-private/nautilus-directory-background.c	11 Jul 2005 12:09:05 -0000
@@ -248,7 +248,7 @@ nautilus_file_background_write_desktop_s
 }
 
 static void
-nautilus_file_background_write_desktop_default_settings ()
+nautilus_file_background_write_desktop_default_settings (void)
 {
 	/* We just unset all the gconf keys so they go back to
 	 * defaults
Index: libnautilus-private/nautilus-file.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v
retrieving revision 1.367
diff -u -p -r1.367 nautilus-file.c
--- libnautilus-private/nautilus-file.c	16 Jun 2005 15:18:35 -0000	1.367
+++ libnautilus-private/nautilus-file.c	11 Jul 2005 12:09:06 -0000
@@ -2918,7 +2918,7 @@ nautilus_file_get_where_string (Nautilus
 		 get_where_string, (file));
 }
 
-const char *TODAY_TIME_FORMATS [] = {
+static const char *TODAY_TIME_FORMATS [] = {
 	/* Today, use special word.
 	 * strftime patterns preceeded with the widest
 	 * possible resulting string for that pattern.
@@ -2949,7 +2949,7 @@ const char *TODAY_TIME_FORMATS [] = {
 	NULL
 };
 
-const char *YESTERDAY_TIME_FORMATS [] = {
+static const char *YESTERDAY_TIME_FORMATS [] = {
 	/* Yesterday, use special word.
 	 * Note to localizers: Same issues as "today" string.
 	 */
@@ -2968,7 +2968,7 @@ const char *YESTERDAY_TIME_FORMATS [] = 
 	NULL
 };
 
-const char *CURRENT_WEEK_TIME_FORMATS [] = {
+static const char *CURRENT_WEEK_TIME_FORMATS [] = {
 	/* Current week, include day of week.
 	 * Note to localizers: Same issues as "today" string.
 	 * The width measurement templates correspond to
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.392
diff -u -p -r1.392 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	6 Jul 2005 12:18:27 -0000	1.392
+++ libnautilus-private/nautilus-icon-container.c	11 Jul 2005 12:09:12 -0000
@@ -5402,7 +5402,7 @@ nautilus_icon_container_get_selection (N
 {
 	GList *list, *p;
 
-	g_return_val_if_fail (NAUTILUS_IS_ICON_CONTAINER (container), FALSE);
+	g_return_val_if_fail (NAUTILUS_IS_ICON_CONTAINER (container), NULL);
 
 	list = NULL;
 	for (p = container->details->icons; p != NULL; p = p->next) {
Index: libnautilus-private/nautilus-icon-factory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-factory.c,v
retrieving revision 1.314
diff -u -p -r1.314 nautilus-icon-factory.c
--- libnautilus-private/nautilus-icon-factory.c	21 May 2005 16:13:58 -0000	1.314
+++ libnautilus-private/nautilus-icon-factory.c	11 Jul 2005 12:09:12 -0000
@@ -270,7 +270,7 @@ nautilus_icon_factory_get_icon_theme (vo
 }
 
 GnomeThumbnailFactory *
-nautilus_icon_factory_get_thumbnail_factory ()
+nautilus_icon_factory_get_thumbnail_factory (void)
 {
 	NautilusIconFactory *factory;
 
Index: libnautilus-private/nautilus-metafile.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-metafile.c,v
retrieving revision 1.39
diff -u -p -r1.39 nautilus-metafile.c
--- libnautilus-private/nautilus-metafile.c	22 Nov 2004 15:24:36 -0000	1.39
+++ libnautilus-private/nautilus-metafile.c	11 Jul 2005 12:09:12 -0000
@@ -263,8 +263,8 @@ nautilus_metafile_get (const char *direc
  * We may want to consider limiting writes as well.
  */
 
-int num_reads_in_progress;
-GList *pending_reads;
+static int num_reads_in_progress;
+static GList *pending_reads;
 
 #if 0
 #define DEBUG_METADATA_IO
Index: libnautilus-private/nautilus-program-choosing.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-program-choosing.c,v
retrieving revision 1.78
diff -u -p -r1.78 nautilus-program-choosing.c
--- libnautilus-private/nautilus-program-choosing.c	2 May 2005 13:44:34 -0000	1.78
+++ libnautilus-private/nautilus-program-choosing.c	11 Jul 2005 12:09:12 -0000
@@ -387,7 +387,7 @@ slowly_and_stupidly_obtain_timestamp (Di
 				       0,
 				       CopyFromParent,
 				       CopyFromParent,
-				       CopyFromParent,
+				       (Visual *)CopyFromParent,
 				       CWOverrideRedirect | CWEventMask,
 				       &attrs);
 		
Index: src/nautilus-bookmark-list.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-bookmark-list.c,v
retrieving revision 1.46
diff -u -p -r1.46 nautilus-bookmark-list.c
--- src/nautilus-bookmark-list.c	23 Jun 2005 14:16:58 -0000	1.46
+++ src/nautilus-bookmark-list.c	11 Jul 2005 12:09:14 -0000
@@ -123,7 +123,7 @@ new_bookmark_from_uri (const char *uri, 
 }
 
 static char *
-nautilus_bookmark_list_get_file_path ()
+nautilus_bookmark_list_get_file_path (void)
 {
 	char *file_path;
 	file_path = g_build_filename (g_get_home_dir (),
@@ -449,6 +449,7 @@ static void
 nautilus_bookmark_list_load_file (NautilusBookmarkList *bookmarks)
 {
 	char *filename, *contents;
+	GError **error = NULL;
 
 	filename = nautilus_bookmark_list_get_file_path ();
 
@@ -462,7 +463,6 @@ nautilus_bookmark_list_load_file (Nautil
 	}
 
 	/* Read new list from file */
-	GError **error = NULL;
 	if (g_file_get_contents (filename, &contents, NULL, error)) {
         	char **lines;
       		int i;
Index: src/nautilus-bookmarks-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-bookmarks-window.c,v
retrieving revision 1.84
diff -u -p -r1.84 nautilus-bookmarks-window.c
--- src/nautilus-bookmarks-window.c	23 Jun 2005 08:27:28 -0000	1.84
+++ src/nautilus-bookmarks-window.c	11 Jul 2005 12:09:14 -0000
@@ -602,7 +602,7 @@ on_jump_button_clicked (GtkButton *butto
 }
 
 static void
-bookmarks_delete_bookmark ()
+bookmarks_delete_bookmark (void)
 {
 	GtkTreeIter iter;
 	GtkTreePath *path;
Index: src/nautilus-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-main.c,v
retrieving revision 1.146
diff -u -p -r1.146 nautilus-main.c
--- src/nautilus-main.c	19 Apr 2005 12:42:48 -0000	1.146
+++ src/nautilus-main.c	11 Jul 2005 12:09:14 -0000
@@ -216,7 +216,7 @@ slowly_and_stupidly_obtain_timestamp (Di
 				       0,
 				       CopyFromParent,
 				       CopyFromParent,
-				       CopyFromParent,
+				       (Visual *)CopyFromParent,
 				       CWOverrideRedirect | CWEventMask,
 				       &attrs);
 		
Index: src/nautilus-self-check-functions.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-self-check-functions.c,v
retrieving revision 1.6
diff -u -p -r1.6 nautilus-self-check-functions.c
--- src/nautilus-self-check-functions.c	15 Sep 2001 19:18:02 -0000	1.6
+++ src/nautilus-self-check-functions.c	11 Jul 2005 12:09:14 -0000
@@ -32,7 +32,7 @@
 
 #include "nautilus-self-check-functions.h"
 
-void nautilus_run_self_checks()
+void nautilus_run_self_checks(void)
 {
 	NAUTILUS_FOR_EACH_SELF_CHECK_FUNCTION (NAUTILUS_CALL_SELF_CHECK_FUNCTION)
 }
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.311
diff -u -p -r1.311 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	5 Jul 2005 12:23:35 -0000	1.311
+++ src/file-manager/fm-icon-view.c	11 Jul 2005 12:09:16 -0000
@@ -1219,7 +1219,7 @@ fm_icon_view_can_zoom_out (FMDirectoryVi
 static GtkWidget * 
 fm_icon_view_get_background_widget (FMDirectoryView *view) 
 {
-	g_return_val_if_fail (FM_IS_ICON_VIEW (view), FALSE);
+	g_return_val_if_fail (FM_IS_ICON_VIEW (view), NULL);
 
 	return GTK_WIDGET (get_icon_container (FM_ICON_VIEW (view)));
 }
Index: src/file-manager/fm-tree-model.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-tree-model.c,v
retrieving revision 1.9
diff -u -p -r1.9 fm-tree-model.c
--- src/file-manager/fm-tree-model.c	7 Jun 2005 19:10:35 -0000	1.9
+++ src/file-manager/fm-tree-model.c	11 Jul 2005 12:09:17 -0000
@@ -1736,8 +1736,8 @@ fm_tree_model_iter_get_file (FMTreeModel
 {
 	TreeNode *node;
 
-	g_return_val_if_fail (FM_IS_TREE_MODEL (model), 0);
-	g_return_val_if_fail (iter_is_valid (FM_TREE_MODEL (model), iter), 0);
+	g_return_val_if_fail (FM_IS_TREE_MODEL (model), NULL);
+	g_return_val_if_fail (iter_is_valid (FM_TREE_MODEL (model), iter), NULL);
 
 	node = iter->user_data;
 	return node == NULL ? NULL : nautilus_file_ref (node->file);


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