glib r7585 - in trunk: . gio gio/tests glib



Author: matthiasc
Date: Fri Oct 10 04:54:51 2008
New Revision: 7585
URL: http://svn.gnome.org/viewvc/glib?rev=7585&view=rev

Log:
Fix gcc warnings


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

Modified: trunk/gio/glocalfileinfo.c
==============================================================================
--- trunk/gio/glocalfileinfo.c	(original)
+++ trunk/gio/glocalfileinfo.c	Fri Oct 10 04:54:51 2008
@@ -1792,8 +1792,8 @@
 {
   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 @@
 
   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 @@
         }
         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 

Modified: trunk/gio/gsimpleasyncresult.c
==============================================================================
--- trunk/gio/gsimpleasyncresult.c	(original)
+++ trunk/gio/gsimpleasyncresult.c	Fri Oct 10 04:54:51 2008
@@ -609,6 +609,7 @@
     g_simple_async_result_set_error (simple,
                                      G_IO_ERROR,
                                      G_IO_ERROR_CANCELLED,
+                                     "%s",
                                      _("Operation was cancelled"));
   else
     data->func (simple,

Modified: trunk/gio/tests/live-g-file.c
==============================================================================
--- trunk/gio/tests/live-g-file.c	(original)
+++ trunk/gio/tests/live-g-file.c	Fri Oct 10 04:54:51 2008
@@ -1136,7 +1136,7 @@
   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 ();
     }
 

Modified: trunk/glib/gmarkup.c
==============================================================================
--- trunk/glib/gmarkup.c	(original)
+++ trunk/glib/gmarkup.c	Fri Oct 10 04:54:51 2008
@@ -1050,6 +1050,7 @@
               set_error (context,
                          error,
                          G_MARKUP_ERROR_BAD_UTF8,
+                         "%s",
                          _("Invalid UTF-8 encoded text - overlong sequence"));
             }
           
@@ -1078,6 +1079,7 @@
       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 @@
                   set_error (context,
                              error,
                              G_MARKUP_ERROR_PARSE,
+                             "%s",
                              _("Document must begin with an element (e.g. <book>)"));
                 }
             }
@@ -1844,7 +1847,7 @@
 
   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 @@
       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 @@
       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 @@
       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;

Modified: trunk/glib/gregex.c
==============================================================================
--- trunk/glib/gregex.c	(original)
+++ trunk/glib/gregex.c	Fri Oct 10 04:54:51 2008
@@ -365,7 +365,7 @@
     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 @@
       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 @@
       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;
 	}

Modified: trunk/glib/grel.c
==============================================================================
--- trunk/glib/grel.c	(original)
+++ trunk/glib/grel.c	Fri Oct 10 04:54:51 2008
@@ -436,7 +436,7 @@
     }
   
   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);
 }
 

Modified: trunk/glib/gshell.c
==============================================================================
--- trunk/glib/gshell.c	(original)
+++ trunk/glib/gshell.c	Fri Oct 10 04:54:51 2008
@@ -65,9 +65,9 @@
   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 @@
   *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;
 }



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