[Goodies-commits] r6386 - in sion/trunk: . src

Enrico Troeger enrico at xfce.org
Thu Jan 1 17:21:08 CET 2009


Author: enrico
Date: 2009-01-01 16:21:08 +0000 (Thu, 01 Jan 2009)
New Revision: 6386

Modified:
   sion/trunk/ChangeLog
   sion/trunk/src/backendgvfs.c
   sion/trunk/src/bookmarkdialog.c
   sion/trunk/src/bookmarkeditdialog.c
   sion/trunk/src/compat.c
   sion/trunk/src/compat.h
   sion/trunk/src/main.c
   sion/trunk/src/menubuttonaction.c
   sion/trunk/src/passworddialog.c
   sion/trunk/src/preferencesdialog.c
   sion/trunk/src/window.c
   sion/trunk/wscript
Log:
Enable more compiler warning options and fix some warnings.

Modified: sion/trunk/ChangeLog
===================================================================
--- sion/trunk/ChangeLog	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/ChangeLog	2009-01-01 16:21:08 UTC (rev 6386)
@@ -1,3 +1,11 @@
+2008-12-30  Enrico Tröger  <enrico(at)xfce(dot)org>
+
+ * src/backendgvfs.c, src/bookmarkdialog.c, src/bookmarkeditdialog.c,
+   src/compat.c, src/compat.h, src/main.c, src/menubuttonaction.c,
+   src/passworddialog.c, src/preferencesdialog.c, src/window.c, wscript:
+   Enable more compiler warning options and fix some warnings.
+
+
 2008-12-29  Enrico Tröger  <enrico(at)xfce(dot)org>
 
  * src/common.c, src/common.h, src/bookmark.c, src/window.c:

Modified: sion/trunk/src/backendgvfs.c
===================================================================
--- sion/trunk/src/backendgvfs.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/backendgvfs.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -91,10 +91,10 @@
 
 static void sion_backend_gvfs_cclosure_marshal_VOID__STRING_STRING(
 											GClosure		*closure,
-											GValue			*return_value,
+							  G_GNUC_UNUSED GValue			*return_value,
 											guint			 n_param_values,
 											const GValue	*param_values,
-											gpointer		 invocation_hint,
+							  G_GNUC_UNUSED gpointer		 invocation_hint,
 											gpointer		 marshal_data)
 {
 	typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer		 data1,
@@ -210,7 +210,7 @@
 }
 
 
-static void mount_volume_changed_cb(GVolumeMonitor *vm, GMount *mnt, gpointer backend)
+static void mount_volume_changed_cb(GVolumeMonitor *vm, G_GNUC_UNUSED GMount *mnt, gpointer backend)
 {
 	GList *mounts, *volumes, *item;
 	GFile *file;
@@ -327,7 +327,7 @@
 }
 
 
-static void sion_backend_gvfs_init(SionBackendGVFS *self)
+static void sion_backend_gvfs_init(G_GNUC_UNUSED SionBackendGVFS *self)
 {
 }
 
@@ -473,7 +473,7 @@
 }
 
 
-static void set_password_cb(GMountOperation *op, gchar *message, gchar *default_user,
+static void set_password_cb(GMountOperation *op, G_GNUC_UNUSED gchar *message, gchar *default_user,
 							gchar *default_domain, GAskPasswordFlags flags, const gchar *domain)
 {
 	GMountOperationResult result;

Modified: sion/trunk/src/bookmarkdialog.c
===================================================================
--- sion/trunk/src/bookmarkdialog.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/bookmarkdialog.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -139,7 +139,7 @@
 }
 
 
-static void add_button_click_cb(GtkButton *button, GtkWidget *dialog)
+static void add_button_click_cb(G_GNUC_UNUSED GtkButton *button, GtkWidget *dialog)
 {
 	GtkWidget *edit_dialog = sion_bookmark_edit_dialog_new(dialog, SION_BE_MODE_CREATE);
 	SionBookmarkDialogPrivate *priv = SION_BOOKMARK_DIALOG_GET_PRIVATE(dialog);
@@ -163,7 +163,7 @@
 }
 
 
-static void edit_button_click_cb(GtkButton *button, GtkWidget *dialog)
+static void edit_button_click_cb(G_GNUC_UNUSED GtkButton *button, GtkWidget *dialog)
 {
 	GtkTreeSelection *treesel;
 	GtkTreeIter iter;
@@ -193,7 +193,7 @@
 }
 
 
-static void delete_button_click_cb(GtkButton *button, gpointer user_data)
+static void delete_button_click_cb(G_GNUC_UNUSED GtkButton *button, gpointer user_data)
 {
 	GtkTreeSelection *treesel;
 	GtkTreeIter iter;
@@ -234,8 +234,9 @@
 }
 
 
-static void tree_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path,
-								  GtkTreeViewColumn *arg2, gpointer data)
+static void tree_row_activated_cb(G_GNUC_UNUSED GtkTreeView *treeview,
+								  G_GNUC_UNUSED GtkTreePath *path,
+								  G_GNUC_UNUSED GtkTreeViewColumn *arg2, gpointer data)
 {
 	edit_button_click_cb(NULL, data);
 }
@@ -250,7 +251,8 @@
 }
 
 
-static gboolean tree_button_press_event_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
+static gboolean tree_button_press_event_cb(G_GNUC_UNUSED GtkWidget *widget,
+										   GdkEventButton *event, gpointer data)
 {
 	if (event->button == 3)
 	{

Modified: sion/trunk/src/bookmarkeditdialog.c
===================================================================
--- sion/trunk/src/bookmarkeditdialog.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/bookmarkeditdialog.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -184,7 +184,7 @@
 		// perform some error checking and don't return until entered values are sane
 		else
 		{
-			if (GTK_WIDGET_VISIBLE(priv->name_entry))
+			if (sion_widget_get_flags(priv->name_entry) & GTK_VISIBLE)
 			{	// check the name only if we are creating/editing a bookmark
 				tmp = gtk_entry_get_text(GTK_ENTRY(priv->name_entry));
 				if (! *tmp)
@@ -288,7 +288,8 @@
 }
 
 
-gboolean combo_foreach(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
+static gboolean combo_foreach(GtkTreeModel *model, G_GNUC_UNUSED GtkTreePath *path,
+							  GtkTreeIter *iter, gpointer data)
 {
 	gint idx = GPOINTER_TO_INT(data);
 	gint i;
@@ -369,7 +370,7 @@
 
 	gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(priv->type_combo)),
 			    &iter, COLUMN_INDEX, &idx, -1);
-	g_return_if_fail(idx < methods_len && idx >= 0);
+	g_return_if_fail(idx < methods_len);
 	meth = &(methods[idx]);
 
 	if (gtk_widget_get_parent(priv->uri_entry) != NULL)
@@ -512,7 +513,8 @@
 }
 
 
-static void combo_changed_callback(GtkComboBox *combo_box, SionBookmarkEditDialog *dialog)
+static void combo_changed_callback(G_GNUC_UNUSED GtkComboBox *combo_box,
+								   SionBookmarkEditDialog *dialog)
 {
 	setup_for_type(dialog);
 }

Modified: sion/trunk/src/compat.c
===================================================================
--- sion/trunk/src/compat.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/compat.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -45,6 +45,25 @@
 }
 
 
+guint32 sion_widget_get_flags(GtkWidget *widget)
+{
+#ifdef GSEAL_ENABLE
+	/* This is an ugly hack to get GTK_WIDGET_FLAGS() flags working with GSEAL enabled,
+	 * we simply create a fake object which looks like a GtkObject and then access its flags field */
+	typedef struct
+	{
+		GInitiallyUnowned parent_instance;
+		guint32 flags;
+	} FakeGtkObject;
+	FakeGtkObject *fgo = (FakeGtkObject*) widget;
+
+	return fgo->flags;
+#else
+	return widget->flags;
+#endif
+}
+
+
 void sion_status_icon_set_tooltip_text(GtkStatusIcon *status_icon, const gchar *tooltip_text)
 {
 #if GTK_CHECK_VERSION(2, 16, 0)

Modified: sion/trunk/src/compat.h
===================================================================
--- sion/trunk/src/compat.h	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/compat.h	2009-01-01 16:21:08 UTC (rev 6386)
@@ -27,6 +27,7 @@
 
 void sion_status_icon_set_tooltip_text(GtkStatusIcon *status_icon, const gchar *tooltip_text);
 
+guint32 sion_widget_get_flags(GtkWidget *widget);
 
 #endif /* __COMPAT_H__ */
 

Modified: sion/trunk/src/main.c
===================================================================
--- sion/trunk/src/main.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/main.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -70,7 +70,7 @@
 }
 
 
-void print_supported_schemes(void)
+static void print_supported_schemes(void)
 {
 	const gchar* const *supported;
 	gint j;

Modified: sion/trunk/src/menubuttonaction.c
===================================================================
--- sion/trunk/src/menubuttonaction.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/menubuttonaction.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -82,13 +82,13 @@
 }
 
 
-static void delegate_button_clicked(GtkToolButton *button, GtkAction *action)
+static void delegate_button_clicked(G_GNUC_UNUSED GtkToolButton *button, GtkAction *action)
 {
 	g_signal_emit(action, signals[BUTTON_CLICKED], 0);
 }
 
 
-static GtkWidget *sion_menu_button_action_create_menu_item(GtkAction *action)
+static GtkWidget *sion_menu_button_action_create_menu_item(G_GNUC_UNUSED GtkAction *action)
 {
 	GtkWidget *menuitem;
 
@@ -246,7 +246,7 @@
 }
 
 
-static void sion_menu_button_action_init(SionMenubuttonAction *action)
+static void sion_menu_button_action_init(G_GNUC_UNUSED SionMenubuttonAction *action)
 {
 }
 

Modified: sion/trunk/src/passworddialog.c
===================================================================
--- sion/trunk/src/passworddialog.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/passworddialog.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -84,7 +84,7 @@
 }
 
 
-static void entry_activate_cb(GtkEntry *entry, gpointer user_data)
+static void entry_activate_cb(G_GNUC_UNUSED GtkEntry *entry, gpointer user_data)
 {
 	gtk_dialog_response(GTK_DIALOG(user_data), GTK_RESPONSE_OK);
 }

Modified: sion/trunk/src/preferencesdialog.c
===================================================================
--- sion/trunk/src/preferencesdialog.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/preferencesdialog.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -278,7 +278,7 @@
 }
 
 
-static gboolean entry_focus_out_event_cb(GtkEntry *entry, GdkEventFocus *event,
+static gboolean entry_focus_out_event_cb(GtkEntry *entry, G_GNUC_UNUSED GdkEventFocus *event,
 										 SionSettings *settings)
 {
 	const gchar *text = gtk_entry_get_text(entry);
@@ -346,7 +346,7 @@
 	if (strcmp(sion_settings_get_vm_impl(settings), "hal") == 0)
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio1), TRUE);
 	gtk_box_pack_start(GTK_BOX(frame_vbox), radio1, FALSE, FALSE, 0);
-	g_object_set_data(G_OBJECT(radio1), "impl", "hal");
+	g_object_set_data(G_OBJECT(radio1), "impl", (gpointer) "hal");
 
 	radio2 = gtk_radio_button_new_with_mnemonic(rlist, _("Use _Unix based volume manager"));
 	gtk_widget_set_tooltip_text(radio2, _("This option sets the implementation of the volume manager. In general, this should be left to HAL. Please note, this option requires a restart of Sion."));
@@ -354,7 +354,7 @@
 	if (strcmp(sion_settings_get_vm_impl(settings), "unix") == 0)
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio2), TRUE);
 	gtk_box_pack_start(GTK_BOX(frame_vbox), radio2, FALSE, FALSE, 0);
-	g_object_set_data(G_OBJECT(radio2), "impl", "unix");
+	g_object_set_data(G_OBJECT(radio2), "impl", (gpointer) "unix");
 
 	g_signal_connect(radio1, "toggled", G_CALLBACK(vm_imple_toggle_cb), settings);
 	g_signal_connect(radio2, "toggled", G_CALLBACK(vm_imple_toggle_cb), settings);

Modified: sion/trunk/src/window.c
===================================================================
--- sion/trunk/src/window.c	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/src/window.c	2009-01-01 16:21:08 UTC (rev 6386)
@@ -136,7 +136,7 @@
 }
 
 
-static gboolean sion_window_delete_event(GtkWidget *widget, GdkEventAny *event)
+static gboolean sion_window_delete_event(GtkWidget *widget, G_GNUC_UNUSED GdkEventAny *event)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(widget);
 	gint geo[5];
@@ -188,7 +188,7 @@
 }
 
 
-static void trayicon_activate_cb(GtkStatusIcon *status_icon, GtkWindow *window)
+static void trayicon_activate_cb(G_GNUC_UNUSED GtkStatusIcon *status_icon, GtkWindow *window)
 {
 	if (gtk_window_is_active(window))
 		gtk_widget_hide(GTK_WIDGET(window));
@@ -200,7 +200,7 @@
 }
 
 
-static void trayicon_popup_menu_cb(GtkStatusIcon *status_icon, guint button,
+static void trayicon_popup_menu_cb(G_GNUC_UNUSED GtkStatusIcon *status_icon, guint button,
 								   guint activate_time, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
@@ -259,7 +259,7 @@
 }
 
 
-static void action_mount_cb(GtkAction *button, SionWindow *window)
+static void action_mount_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	GtkTreeIter iter;
@@ -300,7 +300,7 @@
 }
 
 
-static void action_preferences_cb(GtkAction *button, SionWindow *window)
+static void action_preferences_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
 	GtkWidget *dialog;
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
@@ -313,7 +313,7 @@
 }
 
 
-static void action_unmount_cb(GtkAction *button, SionWindow *window)
+static void action_unmount_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	GtkTreeIter iter;
@@ -333,14 +333,14 @@
 }
 
 
-static void action_quit_cb(GtkAction *button, SionWindow *window)
+static void action_quit_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
     sion_window_delete_event(GTK_WIDGET(window), NULL);
     gtk_widget_destroy(GTK_WIDGET(window));
 }
 
 
-static void action_bookmark_edit_cb(GtkAction *button, SionWindow *window)
+static void action_bookmark_edit_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	GtkWidget *dialog;
@@ -352,13 +352,14 @@
 }
 
 
-static void about_activate_link(GtkAboutDialog *about, const gchar *uri, gpointer data)
+static void about_activate_link(G_GNUC_UNUSED GtkAboutDialog *dialog,
+								const gchar *uri, G_GNUC_UNUSED gpointer data)
 {
 	sion_show_uri(uri);
 }
 
 
-static void action_about_cb(GtkAction *button, SionWindow *window)
+static void action_about_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
     const gchar *authors[]= { "Enrico Tröger <enrico at xfce.org>", NULL };
 
@@ -388,7 +389,7 @@
 }
 
 
-static void action_open_cb(GtkAction *button, SionWindow *window)
+static void action_open_cb(G_GNUC_UNUSED GtkAction *action, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	GtkTreeIter iter;
@@ -558,7 +559,7 @@
 }
 
 
-static void mounts_changed_cb(SionBackendGVFS *backend, SionWindow *window)
+static void mounts_changed_cb(G_GNUC_UNUSED SionBackendGVFS *backend, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	gint view_mode = sion_settings_get_integer(priv->settings, "view-mode");
@@ -574,15 +575,15 @@
 }
 
 
-static void mount_operation_failed(SionBackendGVFS *backend, const gchar *message,
+static void mount_operation_failed_cb(G_GNUC_UNUSED SionBackendGVFS *backend, const gchar *message,
 								   const gchar *error_message, SionWindow *window)
 {
 	sion_error_dialog((gpointer) window, message, error_message);
 }
 
 
-static void tree_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path,
-								  GtkTreeViewColumn *arg2, SionWindow *window)
+static void tree_row_activated_cb(G_GNUC_UNUSED GtkTreeView *treeview, GtkTreePath *path,
+								  G_GNUC_UNUSED GtkTreeViewColumn *arg2, SionWindow *window)
 {
 	GtkTreeIter iter;
 	gint ref_type;
@@ -605,13 +606,15 @@
 }
 
 
-static void iconview_item_activated_cb(GtkIconView *iconview, GtkTreePath *path, SionWindow *window)
+static void iconview_item_activated_cb(G_GNUC_UNUSED GtkIconView *iconview,
+									   GtkTreePath *path, SionWindow *window)
 {
 	tree_row_activated_cb(NULL, path, NULL, window);
 }
 
 
-static gboolean tree_button_press_event_cb(GtkWidget *widget, GdkEventButton *event, SionWindow *window)
+static gboolean tree_button_press_event_cb(G_GNUC_UNUSED GtkWidget *widget,
+										   GdkEventButton *event, SionWindow *window)
 {
 	if (event->button == 3)
 	{
@@ -668,7 +671,8 @@
 }
 
 
-static void action_bookmark_activate_cb(SionMenubuttonAction *action, GtkWidget *item, SionWindow *window)
+static void action_bookmark_activate_cb(G_GNUC_UNUSED SionMenubuttonAction *action,
+										GtkWidget *item, SionWindow *window)
 {
 	SionBookmark *bm = g_object_get_data(G_OBJECT(item), "bookmark");
 
@@ -700,7 +704,7 @@
 }
 
 
-static void action_create_bookmark_cb(GtkAction *button, SionWindow *window)
+static void action_create_bookmark_cb(G_GNUC_UNUSED GtkAction *button, SionWindow *window)
 {
 	SionWindowPrivate *priv = SION_WINDOW_GET_PRIVATE(window);
 	GtkTreeIter iter;
@@ -1100,7 +1104,8 @@
 	/* Init the GVFS backend */
 	priv->backend_gvfs = sion_backend_gvfs_new(priv->store);
 	g_signal_connect(priv->backend_gvfs, "mounts-changed", G_CALLBACK(mounts_changed_cb), window);
-	g_signal_connect(priv->backend_gvfs, "operation-failed", G_CALLBACK(mount_operation_failed), window);
+	g_signal_connect(priv->backend_gvfs, "operation-failed",
+		G_CALLBACK(mount_operation_failed_cb), window);
 
 	/* UI Manager */
 	ui_manager = gtk_ui_manager_new();

Modified: sion/trunk/wscript
===================================================================
--- sion/trunk/wscript	2008-12-31 17:50:13 UTC (rev 6385)
+++ sion/trunk/wscript	2009-01-01 16:21:08 UTC (rev 6386)
@@ -59,7 +59,7 @@
 
 	# debug flags
 	if Options.options.debug:
-		conf.env.append_value('CCFLAGS', '-g -DDEBUG -O0 -Wdeclaration-after-statement -Wmissing-field-initializers -Wsign-compare -Wfloat-equal -Wshadow -Wpointer-arith -Wnested-externs -D_FORTIFY_SOURCE=2 -Wformat=2 -Wformat-security -fno-common -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE')
+		conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG -DGSEAL_ENABLE -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -D_FORTIFY_SOURCE=2 -fno-common -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wundef -Wwrite-strings')
 
 	Utils.pprint('BLUE', 'Summary:')
 	print_message(conf, 'Install sion ' + VERSION + ' in', conf.env['PREFIX'])




More information about the Goodies-commits mailing list