[gnumeric] compilation: warning fixes.



commit d0a371de433d92928bda6d45bbdc4024808d7964
Author: Morten Welinder <terra gnome org>
Date:   Fri Nov 13 09:28:19 2009 -0500

    compilation: warning fixes.

 plugins/html/html.c                  |    6 ++++--
 plugins/uihello/uihello.c            |    3 ++-
 src/dialogs/dialog-analysis-tools.c  |   12 ++++++++----
 src/dialogs/dialog-consolidate.c     |    6 +++---
 src/dialogs/dialog-define-names.c    |    3 ++-
 src/dialogs/dialog-merge.c           |   10 +++++-----
 src/dialogs/dialog-plugin-manager.c  |    7 ++++---
 src/dialogs/dialog-preferences.c     |    8 ++++----
 src/dialogs/dialog-scenarios.c       |    3 ++-
 src/dialogs/dialog-search-replace.c  |    3 ++-
 src/dialogs/dialog-search.c          |    2 +-
 src/dialogs/dialog-solver.c          |    2 +-
 src/dialogs/dialog-stf-format-page.c |    3 ++-
 src/dialogs/dialog-stf-main-page.c   |    3 ++-
 src/dialogs/dialog-view.c            |    3 ++-
 src/gui-file.c                       |   13 +++++++------
 src/stf.c                            |    2 +-
 src/wbc-gtk-actions.c                |    3 ++-
 18 files changed, 54 insertions(+), 38 deletions(-)
---
diff --git a/plugins/html/html.c b/plugins/html/html.c
index 2e304c9..3dc2e9e 100644
--- a/plugins/html/html.c
+++ b/plugins/html/html.c
@@ -287,12 +287,13 @@ html_write_cell_content (GsfOutput *output, GnmCell *cell, GnmStyle const *style
 				gsf_output_puts (output, "<u>");
 			if (font_is_monospaced (style))
 				gsf_output_puts (output, "<tt>");
-			if (gnm_style_get_font_strike (style))
+			if (gnm_style_get_font_strike (style)) {
 				if (version == HTML32)
 					gsf_output_puts (output, "<strike>");
 				else
 					gsf_output_puts (output, 
 							 "<span style=\"text-decoration: line-through;\">");
+			}
 			switch (gnm_style_get_font_script (style)) {
 			case GO_FONT_SCRIPT_SUB:
 				gsf_output_puts (output, "<sub>");
@@ -339,11 +340,12 @@ html_write_cell_content (GsfOutput *output, GnmCell *cell, GnmStyle const *style
 		if (hlink_target)
 			gsf_output_puts (output, "</a>");
 		if (style != NULL) {
-			if (gnm_style_get_font_strike (style))
+			if (gnm_style_get_font_strike (style)) {
 				if (version == HTML32)
 					gsf_output_puts (output, "</strike>");
 				else
 					gsf_output_puts (output, "</span>");
+			}
 			switch (gnm_style_get_font_script (style)) {
 			case GO_FONT_SCRIPT_SUB:
 				gsf_output_puts (output, "</sub>");
diff --git a/plugins/uihello/uihello.c b/plugins/uihello/uihello.c
index 41215d8..6c482db 100644
--- a/plugins/uihello/uihello.c
+++ b/plugins/uihello/uihello.c
@@ -31,7 +31,8 @@ hello_message (GnmAction const *action, WorkbookControl *wbc)
 	char *msg = g_strdup_printf (
 		_("This is message from the \"%s\" plugin."),
 		go_plugin_get_name (uihello_plugin));
-	go_gtk_notice_dialog (wbcg_toplevel (WBC_GTK (wbc)), GTK_MESSAGE_INFO, msg);
+	go_gtk_notice_dialog (wbcg_toplevel (WBC_GTK (wbc)), GTK_MESSAGE_INFO,
+			      "%s", msg);
 	g_free (msg);
 }
 
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 1d2352e..4392e8c 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -272,8 +272,9 @@ void
 error_in_entry (GenericToolState *state, GtkWidget *entry, char const *err_str)
 {
         go_gtk_notice_nonmodal_dialog ((GtkWindow *) state->dialog,
-				  &(state->warning_dialog),
-				  GTK_MESSAGE_ERROR, err_str);
+				       &(state->warning_dialog),
+				       GTK_MESSAGE_ERROR,
+				       "%s", err_str);
 
 	if (IS_GNM_EXPR_ENTRY (entry))
 		gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (entry), TRUE);
@@ -482,14 +483,17 @@ dialog_tool_init (GenericToolState *state,
 
 	gnumeric_keyed_dialog (wbcg, GTK_WINDOW (state->dialog), key);
 
-	gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog), state->wbcg,
+	gnm_dialog_setup_destroy_handlers (GTK_DIALOG (state->dialog),
+					   state->wbcg,
 					   GNM_DIALOG_DESTROY_SHEET_REMOVED |
 					   GNM_DIALOG_DESTROY_SHEET_RENAMED);
 
 	return FALSE;
 
  dialog_tool_init_error:
-	go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR, error_str);
+	go_gtk_notice_dialog (wbcg_toplevel (wbcg),
+			      GTK_MESSAGE_ERROR,
+			      "%s", error_str);
 	g_free (state);
 	return TRUE;
 }
diff --git a/src/dialogs/dialog-consolidate.c b/src/dialogs/dialog-consolidate.c
index 331f7df..2c0503d 100644
--- a/src/dialogs/dialog-consolidate.c
+++ b/src/dialogs/dialog-consolidate.c
@@ -302,9 +302,9 @@ cb_consolidate_ok_clicked (GtkWidget *button, ConsolidateState *state)
 	 */
 	if (cs == NULL) {
 		go_gtk_notice_nonmodal_dialog (GTK_WINDOW (state->base.dialog),
-					  &state->base.warning_dialog,
-					  GTK_MESSAGE_ERROR,
-					  state->construct_error);
+					       &state->base.warning_dialog,
+					       GTK_MESSAGE_ERROR,
+					       "%s", state->construct_error);
 		g_free (state->construct_error);
 		g_free (dao);
 		state->construct_error = NULL;
diff --git a/src/dialogs/dialog-define-names.c b/src/dialogs/dialog-define-names.c
index a832037..b4e1149 100644
--- a/src/dialogs/dialog-define-names.c
+++ b/src/dialogs/dialog-define-names.c
@@ -415,7 +415,8 @@ name_guru_add (NameGuruState *state)
 			return TRUE;
 
 		go_gtk_notice_dialog (GTK_WINDOW (state->dialog),
-				 GTK_MESSAGE_ERROR, perr.err->message);
+				      GTK_MESSAGE_ERROR,
+				      "%s", perr.err->message);
 		gtk_widget_grab_focus (GTK_WIDGET (state->expr_entry));
 		parse_error_free (&perr);
 		return FALSE;
diff --git a/src/dialogs/dialog-merge.c b/src/dialogs/dialog-merge.c
index d4518d1..b032cc5 100644
--- a/src/dialogs/dialog-merge.c
+++ b/src/dialogs/dialog-merge.c
@@ -260,9 +260,9 @@ cb_merge_merge_clicked (G_GNUC_UNUSED GtkWidget *ignore,
 			text = g_strdup_printf (_("%i fields are not part of the merge zone!"),
 						field_problems);
 		go_gtk_notice_nonmodal_dialog ((GtkWindow *) state->dialog,
-					  &(state->warning_dialog),
-					  GTK_MESSAGE_ERROR,
-					  text);
+					       &(state->warning_dialog),
+					       GTK_MESSAGE_ERROR,
+					       "%s", text);
 		g_free (text);
 		value_release (v_zone);
 		range_list_destroy (data_list);
@@ -279,8 +279,8 @@ cb_merge_merge_clicked (G_GNUC_UNUSED GtkWidget *ignore,
 						"%i and proceed?"), min_length, max_length,
 					      min_length);
 
-		if (go_gtk_query_yes_no (
-			    GTK_WINDOW (state->dialog), TRUE, text)) {
+		if (go_gtk_query_yes_no (GTK_WINDOW (state->dialog), TRUE,
+					 "%s", text)) {
 			g_slist_foreach (data_list, cb_merge_trim_data, &min_length);
 			g_free (text);
 		} else {
diff --git a/src/dialogs/dialog-plugin-manager.c b/src/dialogs/dialog-plugin-manager.c
index 002b7b5..14cf80b 100644
--- a/src/dialogs/dialog-plugin-manager.c
+++ b/src/dialogs/dialog-plugin-manager.c
@@ -600,9 +600,10 @@ cb_active_toggled (G_GNUC_UNUSED GtkCellRendererToggle *celltoggle,
 			);
 			g_string_append (s, _("\nDo you want to activate this plugin together with its dependencies?"));
 			if (n_inactive_deps > 0) {
-				want_activate = go_gtk_query_yes_no (GTK_WINDOW (pm_gui->dialog_pm),
-								     TRUE,
-								     s->str);
+				want_activate = go_gtk_query_yes_no
+					(GTK_WINDOW (pm_gui->dialog_pm),
+					 TRUE,
+					 "%s", s->str);
 			}
 			g_string_free (s, TRUE);
 		}
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index 2fd79e6..224f6b0 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -1040,9 +1040,9 @@ typedef struct {
 
 static gboolean   
 dialog_pref_select_page_search (GtkTreeModel *model,
-					GtkTreePath *path,
-					GtkTreeIter *iter,
-					page_search_t *pst)
+				GtkTreePath *path,
+				GtkTreeIter *iter,
+				page_search_t *pst)
 {
 	int page;
 	gtk_tree_model_get (model, iter, PAGE_NUMBER, &page, -1);
@@ -1086,7 +1086,7 @@ cb_dialog_pref_selection_changed (GtkTreeSelection *selection,
 				    -1);
 		gtk_notebook_set_current_page (state->notebook, page);
 	} else {
-		dialog_pref_select_page (state, "0");
+		dialog_pref_select_page (state, 0);
 	}
 }
 
diff --git a/src/dialogs/dialog-scenarios.c b/src/dialogs/dialog-scenarios.c
index 568b47c..1b334c9 100644
--- a/src/dialogs/dialog-scenarios.c
+++ b/src/dialogs/dialog-scenarios.c
@@ -694,7 +694,8 @@ dialog_scenarios (WBCGtk *wbcg)
         return;
 
  error_out:
-	go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR, error_str);
+	go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
+			      "%s", error_str);
 	g_free (state->scenario_state);
 	g_free (state);
 
diff --git a/src/dialogs/dialog-search-replace.c b/src/dialogs/dialog-search-replace.c
index 8ec3354..1dc3df7 100644
--- a/src/dialogs/dialog-search-replace.c
+++ b/src/dialogs/dialog-search-replace.c
@@ -138,7 +138,8 @@ ok_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
 
 	err = gnm_search_replace_verify (sr, TRUE);
 	if (err) {
-		go_gtk_notice_dialog (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR, err);
+		go_gtk_notice_dialog (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR,
+				      "%s", err);
 		g_free (err);
 		g_object_unref (sr);
 		return;
diff --git a/src/dialogs/dialog-search.c b/src/dialogs/dialog-search.c
index fa93a57..41a0ef9 100644
--- a/src/dialogs/dialog-search.c
+++ b/src/dialogs/dialog-search.c
@@ -322,7 +322,7 @@ search_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
 	err = gnm_search_replace_verify (sr, FALSE);
 	if (err) {
 		go_gtk_notice_dialog (GTK_WINDOW (dd->dialog),
-				      GTK_MESSAGE_ERROR, err);
+				      GTK_MESSAGE_ERROR, "%s", err);
 		g_free (err);
 		g_object_unref (sr);
 		return;
diff --git a/src/dialogs/dialog-solver.c b/src/dialogs/dialog-solver.c
index 366c597..644ab48 100644
--- a/src/dialogs/dialog-solver.c
+++ b/src/dialogs/dialog-solver.c
@@ -780,7 +780,7 @@ cb_dialog_solve_clicked (G_GNUC_UNUSED GtkWidget *button,
 			(GTK_WINDOW (state->dialog),
 			 &(state->warning_dialog),
 			 GTK_MESSAGE_ERROR,
-			 err->message);
+			 "%s", err->message);
 	}
 
  out:
diff --git a/src/dialogs/dialog-stf-format-page.c b/src/dialogs/dialog-stf-format-page.c
index 451b465..0263256 100644
--- a/src/dialogs/dialog-stf-format-page.c
+++ b/src/dialogs/dialog-stf-format-page.c
@@ -189,7 +189,8 @@ cb_col_check_clicked (GtkToggleButton *togglebutton, gpointer _i)
 				GNM_MAX_COLS);
 			gtk_toggle_button_set_active (togglebutton, FALSE);
 			go_gtk_notice_dialog (GTK_WINDOW (pagedata->dialog),
-					 GTK_MESSAGE_WARNING, msg);
+					      GTK_MESSAGE_WARNING,
+					      "%s", msg);
 			g_free (msg);
 		}
 	}
diff --git a/src/dialogs/dialog-stf-main-page.c b/src/dialogs/dialog-stf-main-page.c
index 9ad8334..b50fe1f 100644
--- a/src/dialogs/dialog-stf-main-page.c
+++ b/src/dialogs/dialog-stf-main-page.c
@@ -188,7 +188,8 @@ encodings_changed_cb (GOCharmapSel *cs, char const *new_charmap,
 			   "please select another encoding."),
 			 name ? name : new_charmap);
 		go_gtk_notice_dialog (GTK_WINDOW (pagedata->dialog),
-				 GTK_MESSAGE_ERROR, msg);
+				      GTK_MESSAGE_ERROR,
+				      "%s", msg);
 		g_free (msg);
 
 		go_charmap_sel_set_encoding (pagedata->main.charmap_selector,
diff --git a/src/dialogs/dialog-view.c b/src/dialogs/dialog-view.c
index ef39c2e..338529a 100644
--- a/src/dialogs/dialog-view.c
+++ b/src/dialogs/dialog-view.c
@@ -83,7 +83,8 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 						 name);
 			gtk_widget_destroy (state->dialog);
 			go_gtk_notice_dialog (wbcg_toplevel (wbcg),
-					 GTK_MESSAGE_ERROR, error_str);
+					      GTK_MESSAGE_ERROR,
+					      "%s", error_str);
 			g_free (error_str);
 			return;
 		}
diff --git a/src/gui-file.c b/src/gui-file.c
index f5595e5..75fceba 100644
--- a/src/gui-file.c
+++ b/src/gui-file.c
@@ -384,13 +384,14 @@ check_multiple_sheet_support_if_needed (GOFileSaver *fs,
 	if (go_file_saver_get_save_scope (fs) != GO_FILE_SAVE_WORKBOOK &&
 	    gnm_conf_get_core_file_save_single_sheet ()) {
 		Workbook *wb = wb_view_get_workbook (wb_view);
-		gchar *msg = _("Selected file format doesn't support "
-			       "saving multiple sheets in one file.\n"
-			       "If you want to save all sheets, save them "
-			       "in separate files or select different file format.\n"
-			       "Do you want to save only current sheet?");
+		const char *msg =
+			_("Selected file format doesn't support "
+			  "saving multiple sheets in one file.\n"
+			  "If you want to save all sheets, save them "
+			  "in separate files or select different file format.\n"
+			  "Do you want to save only current sheet?");
 		if (workbook_sheet_count (wb) > 1) {
-			ret_val = go_gtk_query_yes_no (parent, TRUE, msg);
+			ret_val = go_gtk_query_yes_no (parent, TRUE, "%s", msg);
 		}
 	}
 	return (ret_val);
diff --git a/src/stf.c b/src/stf.c
index 9f7ec8f..bb4481c 100644
--- a/src/stf.c
+++ b/src/stf.c
@@ -420,7 +420,7 @@ stf_read_workbook_auto_csvtab (GOFileOpener const *fo, gchar const *enc,
 				go_gtk_notice_dialog
 					(wbcg_toplevel (WBC_GTK (context->impl)),
 					 GTK_MESSAGE_WARNING,
-					 msg);
+					 "%s", msg);
 			else
 				g_warning ("%s", msg);
 #if 0
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index e3c8c8a..97344aa 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -479,7 +479,8 @@ cb_edit_search_replace_query (GnmSearchReplaceQuery q, GnmSearchReplace *sr, ...
 			 old_text,
 			 new_text);
 
-		go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR, err);
+		go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
+				      "%s", err);
 		g_free (err);
 		res = GTK_RESPONSE_NO;
 		break;



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