Fix gcc warnings
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 10 Oct 2008 04:54:51 +0000 (04:54 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 10 Oct 2008 04:54:51 +0000 (04:54 +0000)
svn path=/trunk/; revision=7585

ChangeLog
gio/ChangeLog
gio/glocalfileinfo.c
gio/gsimpleasyncresult.c
gio/tests/live-g-file.c
glib/gmarkup.c
glib/gregex.c
glib/grel.c
glib/gshell.c

index 23f4973bb3313deb9c62d26e39333443b15ae421..7d97074b51954f152dcc0c9334d45c1bdeb82dad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-10  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 554557 – Patch to fix gcc warnings about missing format 
+       specifiers
+
+       * glib/gmarkup.c:
+       * glib/gshell.c:
+       * glib/grel.c: Fix gcc warnings. Patch by Kjartan Maraas
+
 2008-10-10  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 552861 – glib-2.0.m4 calls system(3) without storing its result
index 213cc923cf94423a459555c3eaef221009a0e295..a3e07e4cc6a2beccddfc4e0f14fae860eed9dbc2 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * gio/glocalfileinfo.c:
+       * gio/tests/live-g-file.c:
+       * gio/gsimpleasyncresult.c: Fix gcc warnings.
+
 2008-10-09  Alexander Larsson  <alexl@redhat.com>
 
        * gunixinputstream.c (g_unix_input_stream_read):
index 2bb684b48e7c095ce9e642e11291cc17e002fb69..85cb2f10f3f28495d8c50d25670dfa98854a1a2e 100644 (file)
@@ -1792,8 +1792,8 @@ get_string (const GFileAttributeValue  *value,
 {
   if (value->type != G_FILE_ATTRIBUTE_TYPE_STRING)
     {
-      g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                  _("Invalid attribute type (byte string expected)"));
+      g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                           _("Invalid attribute type (byte string expected)"));
       return FALSE;
     }
 
@@ -2059,8 +2059,8 @@ set_selinux_context (char                       *filename,
 
   if (val == NULL)
   {
-    g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-               _("SELinux context must be non-NULL"));
+    g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                         _("SELinux context must be non-NULL"));
     return FALSE;
   }
 
@@ -2082,8 +2082,8 @@ set_selinux_context (char                       *filename,
         }
         g_free (val_s);
   } else {
-    g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-               _("SELinux is not enabled on this system"));
+    g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                         _("SELinux is not enabled on this system"));
     return FALSE;
   }
 #endif 
index 5ec3a270b13b71584e7f813aa1f0c1706851d8c4..d4cc05e3dede74d0b329f2cef857abf337aa6e41 100644 (file)
@@ -609,6 +609,7 @@ run_in_thread (GIOSchedulerJob *job,
     g_simple_async_result_set_error (simple,
                                      G_IO_ERROR,
                                      G_IO_ERROR_CANCELLED,
+                                     "%s",
                                      _("Operation was cancelled"));
   else
     data->func (simple,
index 08e4d12443e38ac52a8e1ec8dcb5d5ea038e2547..d0d4e8ac5e03efe10dde0a30eaae99eb8c97d593 100644 (file)
@@ -1136,7 +1136,7 @@ main (int argc, char *argv[])
   if (! target_path) 
     {
       g_print ("error: target path was not specified\n");
-      g_print (g_option_context_get_help (context, TRUE, NULL));
+      g_print ("%s", g_option_context_get_help (context, TRUE, NULL));
       return g_test_run ();
     }
 
index 43f5b262d1f75b149c93a30dc65b74e7bc5d946c..4c1ed39f2b7d19d0190738fb6f899554af495b89 100644 (file)
@@ -1050,6 +1050,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
               set_error (context,
                          error,
                          G_MARKUP_ERROR_BAD_UTF8,
+                         "%s",
                          _("Invalid UTF-8 encoded text - overlong sequence"));
             }
           
@@ -1078,6 +1079,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
       set_error (context,
                  error,
                  G_MARKUP_ERROR_BAD_UTF8,
+                 "%s",
                  _("Invalid UTF-8 encoded text - not a start char"));
       goto finished;
     }
@@ -1155,6 +1157,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
                   set_error (context,
                              error,
                              G_MARKUP_ERROR_PARSE,
+                             "%s",
                              _("Document must begin with an element (e.g. <book>)"));
                 }
             }
@@ -1844,7 +1847,7 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context,
 
   if (context->document_empty)
     {
-      set_error (context, error, G_MARKUP_ERROR_EMPTY,
+      set_error (context, error, G_MARKUP_ERROR_EMPTY, "%s",
                  _("Document was empty or contained only whitespace"));
       return FALSE;
     }
@@ -1858,7 +1861,7 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context,
       break;
 
     case STATE_AFTER_OPEN_ANGLE:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly just after an open angle bracket '<'"));
       break;
 
@@ -1880,31 +1883,31 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context,
       break;
 
     case STATE_INSIDE_OPEN_TAG_NAME:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly inside an element name"));
       break;
 
     case STATE_INSIDE_ATTRIBUTE_NAME:
     case STATE_AFTER_ATTRIBUTE_NAME:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly inside an attribute name"));
       break;
 
     case STATE_BETWEEN_ATTRIBUTES:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly inside an element-opening "
                    "tag."));
       break;
 
     case STATE_AFTER_ATTRIBUTE_EQUALS_SIGN:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly after the equals sign "
                    "following an attribute name; no attribute value"));
       break;
 
     case STATE_INSIDE_ATTRIBUTE_VALUE_SQ:
     case STATE_INSIDE_ATTRIBUTE_VALUE_DQ:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly while inside an attribute "
                    "value"));
       break;
@@ -1926,7 +1929,7 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context,
       break;
 
     case STATE_INSIDE_PASSTHROUGH:
-      set_error (context, error, G_MARKUP_ERROR_PARSE,
+      set_error (context, error, G_MARKUP_ERROR_PARSE, "%s",
                  _("Document ended unexpectedly inside a comment or "
                    "processing instruction"));
       break;
index f4a1cbe345d5f3422d4ccbc935a5f9d6ad522df0..ef9ac05f2312cb163de9d6e4cbc593b9919247b1 100644 (file)
@@ -365,7 +365,7 @@ translate_compile_error (gint *errcode, const gchar **errmsg)
     case 45:
       /* These errors should not happen as we are using an UTF8-enabled PCRE
        * and we do not check if strings are valid */
-      g_warning (*errmsg);
+      g_warning ("%s", *errmsg);
       *errcode = G_REGEX_ERROR_COMPILE;
       break;
     default:
@@ -1096,7 +1096,7 @@ g_regex_new (const gchar         *pattern,
       if (!support)
        {
          msg = N_("PCRE library is compiled without UTF8 support");
-         g_critical (msg);
+         g_critical ("%s", msg);
          g_set_error_literal (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg));
          return NULL;
        }
@@ -1105,7 +1105,7 @@ g_regex_new (const gchar         *pattern,
       if (!support)
        {
          msg = N_("PCRE library is compiled without UTF8 properties support");
-         g_critical (msg);
+         g_critical ("%s", msg);
          g_set_error_literal (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, gettext (msg));
          return NULL;
        }
index 61c54e40b4386dab4afa2534e254769bb161037c..b6ee65110565bb86e32c9a84eefe1ad221002505 100644 (file)
@@ -436,7 +436,7 @@ g_relation_print_one (gpointer tuple_key,
     }
   
   g_string_append (gstring, "]");
-  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, gstring->str);
+  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "%s", gstring->str);
   g_string_free (gstring, TRUE);
 }
 
index 2ad21dbd7de0b147faf4df1cfb44ca433d968520..c68364fa2cd25d593774ed05ef6dcc8e96abc44b 100644 (file)
@@ -65,9 +65,9 @@ unquote_string_inplace (gchar* str, gchar** end, GError** err)
   if (!(*s == '"' || *s == '\''))
     {
       if (err)
-        *err = g_error_new(G_SHELL_ERROR,
-                           G_SHELL_ERROR_BAD_QUOTING,
-                           _("Quoted text doesn't begin with a quotation mark"));
+        *err = g_error_new_literal (G_SHELL_ERROR,
+                                    G_SHELL_ERROR_BAD_QUOTING,
+                                    _("Quoted text doesn't begin with a quotation mark"));
       *end = str;
       return FALSE;
     }
@@ -155,9 +155,9 @@ unquote_string_inplace (gchar* str, gchar** end, GError** err)
   *dest = '\0';
   
   if (err)
-    *err = g_error_new(G_SHELL_ERROR,
-                       G_SHELL_ERROR_BAD_QUOTING,
-                       _("Unmatched quotation mark in command line or other shell-quoted text"));
+    *err = g_error_new_literal (G_SHELL_ERROR,
+                                G_SHELL_ERROR_BAD_QUOTING,
+                                _("Unmatched quotation mark in command line or other shell-quoted text"));
   *end = s;
   return FALSE;
 }