Commit b918dd64 authored by Paolo Borelli's avatar Paolo Borelli Committed by Paolo Borelli

Fix "format not a string literal" compiler warning.

2008-09-07  Paolo Borelli  <pborelli@katamail.com>

	* plugins/docinfo/gedit-docinfo-plugin.c:
	* plugins/changecase/gedit-changecase-plugin.c:
	* plugins/filebrowser/gedit-file-browser-plugin.c:
	* plugins/sort/gedit-sort-plugin.c:
	* plugins/time/gedit-time-plugin.c:
	* gedit/gedit-local-document-saver.c:
	* gedit/gedit-module.c:
	* gedit/gedit-utils.c:
	* gedit/gedit-app.c:
	* gedit/gedit-mmap-document-loader.c:
	* gedit/gedit-help.c:
	* gedit/gedit-commands-file.c:
	* gedit/gedit-plugins-engine.c:
	* gedit/gedit-document-saver.c:
	* bindings/python/gedit.override:
	Fix "format not a string literal" compiler warning.


svn path=/trunk/; revision=6498
parent 1f5f70a4
2008-09-07 Paolo Borelli <pborelli@katamail.com>
* plugins/docinfo/gedit-docinfo-plugin.c:
* plugins/changecase/gedit-changecase-plugin.c:
* plugins/filebrowser/gedit-file-browser-plugin.c:
* plugins/sort/gedit-sort-plugin.c:
* plugins/time/gedit-time-plugin.c:
* gedit/gedit-local-document-saver.c:
* gedit/gedit-module.c:
* gedit/gedit-utils.c:
* gedit/gedit-app.c:
* gedit/gedit-mmap-document-loader.c:
* gedit/gedit-help.c:
* gedit/gedit-commands-file.c:
* gedit/gedit-plugins-engine.c:
* gedit/gedit-document-saver.c:
* bindings/python/gedit.override:
Fix "format not a string literal" compiler warning.
2008-09-06 Jesse van den Kieboom <jesse@icecrew.nl>
* plugins/filebrowser/gedit-file-browser-store.c: fixed crasher when
......
......@@ -426,7 +426,7 @@ _wrap_gedit_debug(PyObject *self, PyObject *args, PyObject *kwargs)
PyString_AsString (filename),
PyInt_AsLong (lineno),
PyString_AsString (funcname),
message);
"%s", message);
}
Py_DECREF (traceback);
Py_DECREF (traceback_module);
......
......@@ -209,7 +209,7 @@ load_page_setup (GeditApp *app)
if (error->domain != G_FILE_ERROR ||
error->code != G_FILE_ERROR_NOENT)
{
g_warning (error->message);
g_warning ("%s", error->message);
}
g_error_free (error);
......@@ -238,7 +238,7 @@ save_page_setup (GeditApp *app)
&error);
if (error)
{
g_warning (error->message);
g_warning ("%s", error->message);
g_error_free (error);
}
......@@ -281,7 +281,7 @@ load_print_settings (GeditApp *app)
if (error->domain != G_FILE_ERROR ||
error->code != G_FILE_ERROR_NOENT)
{
g_warning (error->message);
g_warning ("%s", error->message);
}
g_error_free (error);
......@@ -310,7 +310,7 @@ save_print_settings (GeditApp *app)
&error);
if (error)
{
g_warning (error->message);
g_warning ("%s", error->message);
g_error_free (error);
}
......
......@@ -625,7 +625,6 @@ replace_read_only_file (GtkWindow *parent, GFile *file)
gint ret;
gchar *parse_name;
gchar *name_for_display;
gchar *message;
gedit_debug (DEBUG_COMMANDS);
......@@ -638,20 +637,17 @@ replace_read_only_file (GtkWindow *parent, GFile *file)
name_for_display = gedit_utils_str_middle_truncate (parse_name, 50);
g_free (parse_name);
message = g_strdup_printf (_("The file \"%s\" is read-only."),
name_for_display);
g_free (name_for_display);
dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
message);
_("The file \"%s\" is read-only."),
name_for_display);
g_free (name_for_display);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("Do you want to try to replace it "
"with the one you are saving?"));
g_free (message);
gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL,
......@@ -1228,10 +1224,10 @@ revert_dialog (GeditWindow *window,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
primary_msg);
"%s", primary_msg);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
secondary_msg);
"%s", secondary_msg);
g_free (primary_msg);
g_free (secondary_msg);
......
......@@ -388,7 +388,7 @@ gedit_document_saver_write_document_contents (GeditDocumentSaver *saver,
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
}
return res;
......
......@@ -82,8 +82,8 @@ gedit_help_display (GtkWindow *parent,
_("There was an error displaying help."));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
error->message);
"%s", error->message);
g_signal_connect (G_OBJECT (dialog),
"response",
G_CALLBACK (gtk_widget_destroy),
......
......@@ -199,7 +199,7 @@ copy_file_data (gint sfd,
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
ret = FALSE;
......@@ -220,7 +220,7 @@ copy_file_data (gint sfd,
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
ret = FALSE;
......@@ -299,7 +299,7 @@ save_existing_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
goto out;
}
......@@ -470,7 +470,7 @@ save_existing_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
close (tmpfd);
unlink (tmp_filename);
......@@ -487,7 +487,7 @@ save_existing_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
/* try to restore... no error checking */
rename (backup_filename, lsaver->priv->local_path);
......@@ -507,7 +507,7 @@ save_existing_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
close (tmpfd);
goto out;
......@@ -693,7 +693,7 @@ save_existing_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
goto out;
}
......@@ -739,7 +739,7 @@ save_new_local_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
goto out;
}
......@@ -812,7 +812,7 @@ save_file (GeditLocalDocumentSaver *lsaver)
g_set_error (&lsaver->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
next_phase = (GSourceFunc) open_local_failed;
......
......@@ -158,7 +158,7 @@ load_file_real (GeditMmapDocumentLoader *mloader)
g_set_error (&mloader->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
goto done;
}
......@@ -217,7 +217,7 @@ load_file_real (GeditMmapDocumentLoader *mloader)
g_set_error (&mloader->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
goto done;
}
......@@ -243,9 +243,11 @@ load_file_real (GeditMmapDocumentLoader *mloader)
ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
if (ret != 0)
{
g_warning ("File '%s' has not been correctly unmapped: %s",
GEDIT_DOCUMENT_LOADER (mloader)->uri,
g_strerror (errno));
}
goto done;
}
......@@ -260,9 +262,11 @@ load_file_real (GeditMmapDocumentLoader *mloader)
{
ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
if (ret != 0)
{
g_warning ("File '%s' has not been correctly unmapped: %s",
GEDIT_DOCUMENT_LOADER (mloader)->uri,
g_strerror (errno));
}
goto done;
}
......@@ -282,20 +286,22 @@ load_file_real (GeditMmapDocumentLoader *mloader)
}
ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
if (ret != 0)
{
g_warning ("File '%s' has not been correctly unmapped: %s",
GEDIT_DOCUMENT_LOADER (mloader)->uri,
g_strerror (errno));
}
}
done:
ret = close (mloader->priv->fd);
if (ret != 0)
{
g_warning ("File '%s' has not been correctly closed: %s",
GEDIT_DOCUMENT_LOADER (mloader)->uri,
g_strerror (errno));
}
mloader->priv->fd = -1;
......@@ -333,7 +339,7 @@ load_file (GeditMmapDocumentLoader *mloader,
g_set_error (&mloader->priv->error,
G_IO_ERROR,
g_io_error_from_errno (errno),
g_strerror (errno));
"%s", g_strerror (errno));
g_timeout_add_full (G_PRIORITY_HIGH,
0,
......
......@@ -70,7 +70,7 @@ gedit_module_load (GTypeModule *gmodule)
if (module->library == NULL)
{
g_warning (g_module_error());
g_warning ("%s: %s", module->module_name, g_module_error());
return FALSE;
}
......@@ -79,7 +79,7 @@ gedit_module_load (GTypeModule *gmodule)
if (!g_module_symbol (module->library, "register_gedit_plugin",
(void *) &register_func))
{
g_warning (g_module_error());
g_warning ("%s: %s", module->module_name, g_module_error());
g_module_close (module->library);
return FALSE;
......
......@@ -101,7 +101,7 @@ gedit_plugins_engine_load_dir (GeditPluginsEngine *engine,
d = g_dir_open (dir, 0, &error);
if (!d)
{
g_warning (error->message);
g_warning ("%s", error->message);
g_error_free (error);
return;
}
......
......@@ -549,10 +549,10 @@ gedit_warning (GtkWindow *parent, const gchar *format, ...)
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
str);
"%s", str);
g_free (str);
if (wg != NULL)
gtk_window_group_add_window (wg, GTK_WINDOW (dialog));
......
......@@ -326,7 +326,7 @@ impl_activate (GeditPlugin *plugin,
&error);
if (data->ui_id == 0)
{
g_warning (error->message);
g_warning ("%s", error->message);
return;
}
......
......@@ -116,8 +116,10 @@ get_docinfo_dialog (GeditWindow *window,
if (!ret)
{
gedit_warning (GTK_WINDOW (window),
gtk_label_get_label (GTK_LABEL (error_widget)));
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
gedit_warning (GTK_WINDOW (window), "%s", err_message);
g_free (dialog);
gtk_widget_destroy (error_widget);
......
......@@ -901,9 +901,9 @@ on_error_cb (GeditFileBrowserWidget * tree_widget,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
title);
"%s", title);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg),
message);
"%s", message);
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
......
......@@ -141,8 +141,10 @@ get_sort_dialog (GtkWindow *parent)
if (!ret)
{
gedit_warning (parent,
gtk_label_get_label (GTK_LABEL (error_widget)));
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
gedit_warning (parent, "%s", err_message);
g_free (dialog);
gtk_widget_destroy (error_widget);
......
......@@ -936,8 +936,10 @@ get_choose_format_dialog (GtkWindow *parent,
if (!ret)
{
gedit_warning (parent,
gtk_label_get_label (GTK_LABEL (error_widget)));
const gchar *err_message;
err_message = gtk_label_get_label (GTK_LABEL (error_widget));
gedit_warning (parent, "%s", err_message);
g_free (dialog);
gtk_widget_destroy (error_widget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment