[glib] all: Remove trailing newlines from g_message()/g_warning()/g_error()s



commit 9b4c50f63d9ef7c2033777a95a743009f0a145a1
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Apr 27 16:45:36 2018 +0100

    all: Remove trailing newlines from g_message()/g_warning()/g_error()s
    
    All those logging functions already add a newline to any message they
    print, so there’s no need to add a trailing newline in the message
    passed to them.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    Reviewed-by: nobody

 gio/gcontenttype.c                |  4 ++--
 gio/gdbusprivate.c                |  2 +-
 gio/gfileattribute.c              |  2 +-
 gio/gmenuexporter.c               |  2 +-
 gio/gsettings-mapping.c           |  4 ++--
 gio/gsettings.c                   |  2 +-
 gio/gtestdbus.c                   |  2 +-
 gio/gunixmounts.c                 |  6 +++---
 gio/gzlibcompressor.c             |  6 +++---
 gio/gzlibdecompressor.c           |  6 +++---
 gio/tests/gdbus-connection-slow.c |  2 +-
 gio/tests/send-data.c             |  6 +++---
 gio/tests/socket-client.c         |  2 +-
 glib/deprecated/gcompletion.c     |  4 ++--
 glib/gbookmarkfile.c              |  2 +-
 glib/gdate.c                      |  8 ++++----
 glib/giochannel.c                 | 28 ++++++++++++++--------------
 glib/giounix.c                    |  8 ++++----
 glib/giowin32.c                   |  2 +-
 glib/glib-unix.c                  |  2 +-
 glib/gmain.c                      |  8 ++++----
 glib/gpoll.c                      |  2 +-
 glib/gtestutils.c                 |  2 +-
 glib/gwakeup.c                    |  4 ++--
 glib/tests/fileutils.c            | 24 ++++++++++++------------
 glib/tests/mainloop.c             |  2 +-
 glib/tests/thread.c               |  4 ++--
 gobject/gsourceclosure.c          |  2 +-
 gobject/gtypemodule.c             |  6 +++---
 tests/child-test.c                |  4 ++--
 tests/mainloop-test.c             |  2 +-
 tests/testglib.c                  | 36 ++++++++++++++++++------------------
 32 files changed, 98 insertions(+), 98 deletions(-)
---
diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c
index 820e54258..af8ef44c6 100644
--- a/gio/gcontenttype.c
+++ b/gio/gcontenttype.c
@@ -1052,7 +1052,7 @@ read_tree_magic_from_directory (const gchar *prefix)
                 }
               else
                 {
-                  g_warning ("%s: header corrupt; skipping\n", filename);
+                  g_warning ("%s: header corrupt; skipping", filename);
                   break;
                 }
             }
@@ -1060,7 +1060,7 @@ read_tree_magic_from_directory (const gchar *prefix)
           g_strfreev (lines);
         }
       else
-        g_warning ("%s: header not found, skipping\n", filename);
+        g_warning ("%s: header not found, skipping", filename);
 
       g_free (text);
     }
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index 648220f7a..b5f8b6509 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -752,7 +752,7 @@ _g_dbus_worker_do_read_cb (GInputStream  *input_stream,
               g_warning ("Error decoding D-Bus message of %" G_GSIZE_FORMAT " bytes\n"
                          "The error is: %s\n"
                          "The payload is as follows:\n"
-                         "%s\n",
+                         "%s",
                          worker->read_buffer_cur_size,
                          error->message,
                          s);
diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c
index 9b16a765f..c3a8ebf4b 100644
--- a/gio/gfileattribute.c
+++ b/gio/gfileattribute.c
@@ -612,7 +612,7 @@ _g_file_attribute_value_set_from_pointer (GFileAttributeValue *value,
       break;
 
     default:
-      g_warning ("Unknown type specified in g_file_info_set_attribute\n");
+      g_warning ("Unknown type specified in g_file_info_set_attribute");
       break;
     }
 }
diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c
index e12a0f78e..f319b886b 100644
--- a/gio/gmenuexporter.c
+++ b/gio/gmenuexporter.c
@@ -72,7 +72,7 @@ org_gtk_Menus_get_interface (void)
                                            "  </interface>"
                                            "</node>", &error);
       if (info == NULL)
-        g_error ("%s\n", error->message);
+        g_error ("%s", error->message);
       interface_info = g_dbus_node_info_lookup_interface (info, "org.gtk.Menus");
       g_assert (interface_info != NULL);
       g_dbus_interface_info_ref (interface_info);
diff --git a/gio/gsettings-mapping.c b/gio/gsettings-mapping.c
index 94d5cc705..bba8a8f7c 100644
--- a/gio/gsettings-mapping.c
+++ b/gio/gsettings-mapping.c
@@ -498,7 +498,7 @@ g_settings_get_mapping (GValue   *value,
              return TRUE;
             }
 
-          g_warning ("Unable to lookup enum nick '%s' via GType\n", nick);
+          g_warning ("Unable to lookup enum nick '%s' via GType", nick);
           return FALSE;
         }
     }
@@ -530,7 +530,7 @@ g_settings_get_mapping (GValue   *value,
 
               else
                 {
-                  g_warning ("Unable to lookup flags nick '%s' via GType\n",
+                  g_warning ("Unable to lookup flags nick '%s' via GType",
                              nick);
                   return FALSE;
                 }
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 87b38bcbb..e5ed54a46 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -587,7 +587,7 @@ g_settings_set_property (GObject      *object,
             settings->priv->schema = g_settings_schema_source_lookup (default_source, schema_id, TRUE);
 
             if (settings->priv->schema == NULL)
-              g_error ("Settings schema '%s' is not installed\n", schema_id);
+              g_error ("Settings schema '%s' is not installed", schema_id);
           }
       }
       break;
diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c
index 227f5b2ea..685503c5e 100644
--- a/gio/gtestdbus.c
+++ b/gio/gtestdbus.c
@@ -96,7 +96,7 @@ _g_object_dispose_and_wait_weak_notify (gpointer object)
 
   if (data.timed_out)
     {
-      g_warning ("Weak notify timeout, object ref_count=%d\n",
+      g_warning ("Weak notify timeout, object ref_count=%d",
           G_OBJECT (object)->ref_count);
     }
   else
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 747029aeb..c74b0cfaf 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -738,7 +738,7 @@ _g_get_unix_mounts (void)
   
   if (mntctl (MCTL_QUERY, sizeof (vmount_size), &vmount_size) != 0)
     {
-      g_warning ("Unable to know the number of mounted volumes\n");
+      g_warning ("Unable to know the number of mounted volumes");
       
       return NULL;
     }
@@ -748,11 +748,11 @@ _g_get_unix_mounts (void)
   vmount_number = mntctl (MCTL_QUERY, vmount_size, vmount_info);
   
   if (vmount_info->vmt_revision != VMT_REVISION)
-    g_warning ("Bad vmount structure revision number, want %d, got %d\n", VMT_REVISION, 
vmount_info->vmt_revision);
+    g_warning ("Bad vmount structure revision number, want %d, got %d", VMT_REVISION, 
vmount_info->vmt_revision);
 
   if (vmount_number < 0)
     {
-      g_warning ("Unable to recover mounted volumes information\n");
+      g_warning ("Unable to recover mounted volumes information");
       
       g_free (vmount_info);
       return NULL;
diff --git a/gio/gzlibcompressor.c b/gio/gzlibcompressor.c
index 239d143cc..53f3e4745 100644
--- a/gio/gzlibcompressor.c
+++ b/gio/gzlibcompressor.c
@@ -90,7 +90,7 @@ g_zlib_compressor_set_gzheader (GZlibCompressor *compressor)
                                                 G_FILE_ATTRIBUTE_TIME_MODIFIED);
 
   if (deflateSetHeader (&compressor->zstream, &compressor->gzheader) != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", compressor->zstream.msg);
 #endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */
 }
 
@@ -211,7 +211,7 @@ g_zlib_compressor_constructed (GObject *object)
     g_error ("GZlibCompressor: Not enough memory for zlib use");
 
   if (res != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", compressor->zstream.msg);
 
   g_zlib_compressor_set_gzheader (compressor);
 }
@@ -351,7 +351,7 @@ g_zlib_compressor_reset (GConverter *converter)
 
   res = deflateReset (&compressor->zstream);
   if (res != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", compressor->zstream.msg);
 
   /* deflateReset reset the header too, so re-set it */
   g_zlib_compressor_set_gzheader (compressor);
diff --git a/gio/gzlibdecompressor.c b/gio/gzlibdecompressor.c
index d16d3f717..cf2542ef8 100644
--- a/gio/gzlibdecompressor.c
+++ b/gio/gzlibdecompressor.c
@@ -95,7 +95,7 @@ g_zlib_decompressor_set_gzheader (GZlibDecompressor *decompressor)
   decompressor->header_data->gzheader.name_max = 256;
 
   if (inflateGetHeader (&decompressor->zstream, &decompressor->header_data->gzheader) != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", decompressor->zstream.msg);
 #endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */
 }
 
@@ -205,7 +205,7 @@ g_zlib_decompressor_constructed (GObject *object)
     g_error ("GZlibDecompressor: Not enough memory for zlib use");
 
   if (res != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", decompressor->zstream.msg);
 
   g_zlib_decompressor_set_gzheader (decompressor);
 }
@@ -305,7 +305,7 @@ g_zlib_decompressor_reset (GConverter *converter)
 
   res = inflateReset (&decompressor->zstream);
   if (res != Z_OK)
-    g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg);
+    g_warning ("unexpected zlib error: %s", decompressor->zstream.msg);
 
   g_zlib_decompressor_set_gzheader (decompressor);
 }
diff --git a/gio/tests/gdbus-connection-slow.c b/gio/tests/gdbus-connection-slow.c
index 82e02587c..dd1ababd4 100644
--- a/gio/tests/gdbus-connection-slow.c
+++ b/gio/tests/gdbus-connection-slow.c
@@ -123,7 +123,7 @@ large_message_timeout_cb (gpointer data)
 {
   (void)data;
 
-  g_error ("Error: timeout waiting for dbus name to appear\n");
+  g_error ("Error: timeout waiting for dbus name to appear");
 
   return FALSE;
 }
diff --git a/gio/tests/send-data.c b/gio/tests/send-data.c
index a30bdca56..514442976 100644
--- a/gio/tests/send-data.c
+++ b/gio/tests/send-data.c
@@ -170,7 +170,7 @@ main (int argc, char *argv[])
       if (!g_output_stream_write_all (out, buffer, strlen (buffer),
                                      NULL, cancellable, &error))
        {
-         g_warning ("send error: %s\n",  error->message);
+         g_warning ("send error: %s",  error->message);
          g_error_free (error);
          error = NULL;
        }
@@ -187,7 +187,7 @@ main (int argc, char *argv[])
                                     res, &error))
        {
          g_object_unref (res);
-         g_warning ("close error: %s\n",  error->message);
+         g_warning ("close error: %s",  error->message);
          return 1;
        }
       g_object_unref (res);
@@ -196,7 +196,7 @@ main (int argc, char *argv[])
     {
       if (!g_io_stream_close (G_IO_STREAM (connection), cancellable, &error))
        {
-         g_warning ("close error: %s\n",  error->message);
+         g_warning ("close error: %s",  error->message);
          return 1;
        }
     }
diff --git a/gio/tests/socket-client.c b/gio/tests/socket-client.c
index 62dda8991..803f4d6e9 100644
--- a/gio/tests/socket-client.c
+++ b/gio/tests/socket-client.c
@@ -173,7 +173,7 @@ make_connection (const char       *argument,
 
       if (g_socket_connect (*socket, *address, cancellable, &err))
         break;
-      g_message ("Connection to %s failed: %s, trying next\n", socket_address_to_string (*address), 
err->message);
+      g_message ("Connection to %s failed: %s, trying next", socket_address_to_string (*address), 
err->message);
       g_clear_error (&err);
 
       g_object_unref (*address);
diff --git a/glib/deprecated/gcompletion.c b/glib/deprecated/gcompletion.c
index a62aa8b40..74342c64f 100644
--- a/glib/deprecated/gcompletion.c
+++ b/glib/deprecated/gcompletion.c
@@ -461,14 +461,14 @@ main (int   argc,
   
   if (argc < 3)
     {
-      g_warning ("Usage: %s filename prefix1 [prefix2 ...]\n", argv[0]);
+      g_warning ("Usage: %s filename prefix1 [prefix2 ...]", argv[0]);
       return 1;
     }
   
   file = fopen (argv[1], "r");
   if (!file)
     {
-      g_warning ("Cannot open %s\n", argv[1]);
+      g_warning ("Cannot open %s", argv[1]);
       return 1;
     }
   
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c
index 4661b9daf..bbbc66e5d 100644
--- a/glib/gbookmarkfile.c
+++ b/glib/gbookmarkfile.c
@@ -547,7 +547,7 @@ bookmark_item_dump (BookmarkItem *item)
    */
   if (!item->metadata || !item->metadata->applications)
     {
-      g_warning ("Item for URI '%s' has no registered applications: skipping.\n", item->uri);
+      g_warning ("Item for URI '%s' has no registered applications: skipping.", item->uri);
       return NULL;
     }
   
diff --git a/glib/gdate.c b/glib/gdate.c
index fbfcadcfd..13a16aaeb 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
@@ -579,7 +579,7 @@ g_date_update_dmy (const GDate *const_d)
   
 #ifdef G_ENABLE_DEBUG
   if (!g_date_valid_dmy (day, m, y)) 
-    g_warning ("\nOOPS julian: %u  computed dmy: %u %u %u\n", 
+    g_warning ("OOPS julian: %u  computed dmy: %u %u %u",
               d->julian_days, day, m, y);
 #endif
   
@@ -2628,7 +2628,7 @@ g_date_strftime (gchar       *s,
 
   if (error)
     {
-      g_warning (G_STRLOC "Error converting format to locale encoding: %s\n", error->message);
+      g_warning (G_STRLOC "Error converting format to locale encoding: %s", error->message);
       g_error_free (error);
 
       s[0] = '\0';
@@ -2653,7 +2653,7 @@ g_date_strftime (gchar       *s,
 
           if (tmpbufsize > 65536)
             {
-              g_warning (G_STRLOC "Maximum buffer size for g_date_strftime exceeded: giving up\n");
+              g_warning (G_STRLOC "Maximum buffer size for g_date_strftime exceeded: giving up");
               g_free (locale_format);
 
               s[0] = '\0';
@@ -2670,7 +2670,7 @@ g_date_strftime (gchar       *s,
 
   if (error)
     {
-      g_warning (G_STRLOC "Error converting results of strftime to UTF-8: %s\n", error->message);
+      g_warning (G_STRLOC "Error converting results of strftime to UTF-8: %s", error->message);
       g_error_free (error);
 
       s[0] = '\0';
diff --git a/glib/giochannel.c b/glib/giochannel.c
index a9567c90d..d8c3b0b09 100644
--- a/glib/giochannel.c
+++ b/glib/giochannel.c
@@ -516,7 +516,7 @@ g_io_channel_shutdown (GIOChannel  *channel,
   if (channel->partial_write_buf[0] != '\0')
     {
       if (flush)
-        g_warning ("Partial character at end of write buffer not flushed.\n");
+        g_warning ("Partial character at end of write buffer not flushed.");
       channel->partial_write_buf[0] = '\0';
     }
 
@@ -581,7 +581,7 @@ g_io_channel_purge (GIOChannel *channel)
 
       if (channel->partial_write_buf[0] != '\0')
         {
-          g_warning ("Partial character at end of write buffer not flushed.\n");
+          g_warning ("Partial character at end of write buffer not flushed.");
           channel->partial_write_buf[0] = '\0';
         }
     }
@@ -757,13 +757,13 @@ g_io_channel_error_from_errno (gint en)
     {
 #ifdef EBADF
     case EBADF:
-      g_warning("Invalid file descriptor.\n");
+      g_warning ("Invalid file descriptor.");
       return G_IO_CHANNEL_ERROR_FAILED;
 #endif
 
 #ifdef EFAULT
     case EFAULT:
-      g_warning("Buffer outside valid address space.\n");
+      g_warning ("Buffer outside valid address space.");
       return G_IO_CHANNEL_ERROR_FAILED;
 #endif
 
@@ -1098,7 +1098,7 @@ g_io_channel_seek_position (GIOChannel  *channel,
                 && channel->encoded_read_buf->len > 0)
               {
                 g_warning ("Seek type G_SEEK_CUR not allowed for this"
-                  " channel's encoding.\n");
+                  " channel's encoding.");
                 return G_IO_STATUS_ERROR;
               }
           if (channel->read_buf)
@@ -1152,7 +1152,7 @@ g_io_channel_seek_position (GIOChannel  *channel,
 
       if (channel->partial_write_buf[0] != '\0')
         {
-          g_warning ("Partial character at end of write buffer not flushed.\n");
+          g_warning ("Partial character at end of write buffer not flushed.");
           channel->partial_write_buf[0] = '\0';
         }
     }
@@ -1236,7 +1236,7 @@ g_io_channel_set_buffered (GIOChannel *channel,
   if (channel->encoding != NULL)
     {
       g_warning ("Need to have NULL encoding to set the buffering state of the "
-                 "channel.\n");
+                 "channel.");
       return;
     }
 
@@ -1323,15 +1323,15 @@ g_io_channel_set_encoding (GIOChannel   *channel,
 
   if (!channel->use_buffer)
     {
-      g_warning ("Need to set the channel buffered before setting the encoding.\n");
-      g_warning ("Assuming this is what you meant and acting accordingly.\n");
+      g_warning ("Need to set the channel buffered before setting the encoding.");
+      g_warning ("Assuming this is what you meant and acting accordingly.");
 
       channel->use_buffer = TRUE;
     }
 
   if (channel->partial_write_buf[0] != '\0')
     {
-      g_warning ("Partial character at end of write buffer not flushed.\n");
+      g_warning ("Partial character at end of write buffer not flushed.");
       channel->partial_write_buf[0] = '\0';
     }
 
@@ -1463,7 +1463,7 @@ g_io_channel_fill_buffer (GIOChannel  *channel,
     }
   if (channel->is_seekable && channel->partial_write_buf[0] != '\0')
     {
-      g_warning ("Partial character at end of write buffer not flushed.\n");
+      g_warning ("Partial character at end of write buffer not flushed.");
       channel->partial_write_buf[0] = '\0';
     }
 
@@ -2221,7 +2221,7 @@ g_io_channel_write_chars (GIOChannel   *channel,
     {
       if (channel->do_encode && BUF_LEN (channel->encoded_read_buf) > 0)
         {
-          g_warning("Mixed reading and writing not allowed on encoded files");
+          g_warning ("Mixed reading and writing not allowed on encoded files");
           return G_IO_STATUS_ERROR;
         }
       status = g_io_channel_seek_position (channel, 0, G_SEEK_CUR, error);
@@ -2443,7 +2443,7 @@ reconvert:
                       _("Invalid byte sequence in conversion input"));
                     if (from_buf_old_len > 0 && from_buf_len == left_len)
                       g_warning ("Illegal sequence due to partial character "
-                                 "at the end of a previous write.\n");
+                                 "at the end of a previous write.");
                     else
                       wrote_bytes += from_buf_len - left_len - from_buf_old_len;
                     if (bytes_written)
@@ -2515,7 +2515,7 @@ g_io_channel_write_unichar (GIOChannel  *channel,
 
   if (channel->partial_write_buf[0] != '\0')
     {
-      g_warning ("Partial character written before writing unichar.\n");
+      g_warning ("Partial character written before writing unichar.");
       channel->partial_write_buf[0] = '\0';
     }
 
diff --git a/glib/giounix.c b/glib/giounix.c
index b368afff6..fe1c76170 100644
--- a/glib/giounix.c
+++ b/glib/giounix.c
@@ -157,7 +157,7 @@ g_io_unix_dispatch (GSource     *source,
 
   if (!func)
     {
-      g_warning ("IO watch dispatched without callback\n"
+      g_warning ("IO watch dispatched without callback. "
                 "You must call g_source_connect().");
       return FALSE;
     }
@@ -406,7 +406,7 @@ g_io_unix_get_flags (GIOChannel *channel)
   if (fcntl_flags == -1)
     {
       int err = errno;
-      g_warning (G_STRLOC "Error while getting flags for FD: %s (%d)\n",
+      g_warning (G_STRLOC "Error while getting flags for FD: %s (%d)",
                 g_strerror (err), err);
       return 0;
     }
@@ -476,7 +476,7 @@ g_io_channel_new_file (const gchar *filename,
         mode_num = MODE_A;
         break;
       default:
-        g_warning ("Invalid GIOFileMode %s.\n", mode);
+        g_warning ("Invalid GIOFileMode %s.", mode);
         return NULL;
     }
 
@@ -492,7 +492,7 @@ g_io_channel_new_file (const gchar *filename,
           }
         /* Fall through */
       default:
-        g_warning ("Invalid GIOFileMode %s.\n", mode);
+        g_warning ("Invalid GIOFileMode %s.", mode);
         return NULL;
     }
 
diff --git a/glib/giowin32.c b/glib/giowin32.c
index 68eeb6504..3e38e2a81 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -963,7 +963,7 @@ g_io_win32_dispatch (GSource     *source,
   
   if (!func)
     {
-      g_warning ("IO Watch dispatched without callback\n"
+      g_warning ("IO Watch dispatched without callback. "
                 "You must call g_source_connect().");
       return FALSE;
     }
diff --git a/glib/glib-unix.c b/glib/glib-unix.c
index 6a5faf02f..b616b8cbf 100644
--- a/glib/glib-unix.c
+++ b/glib/glib-unix.c
@@ -301,7 +301,7 @@ g_unix_fd_source_dispatch (GSource     *source,
 
   if (!callback)
     {
-      g_warning ("GUnixFDSource dispatched without callback\n"
+      g_warning ("GUnixFDSource dispatched without callback. "
                  "You must call g_source_set_callback().");
       return FALSE;
     }
diff --git a/glib/gmain.c b/glib/gmain.c
index ee2f29e1b..181483527 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -4642,7 +4642,7 @@ g_timeout_dispatch (GSource     *source,
 
   if (!callback)
     {
-      g_warning ("Timeout source dispatched without callback\n"
+      g_warning ("Timeout source dispatched without callback. "
                  "You must call g_source_set_callback().");
       return FALSE;
     }
@@ -5188,7 +5188,7 @@ g_unix_signal_watch_dispatch (GSource    *source,
 
   if (!callback)
     {
-      g_warning ("Unix signal source dispatched without callback\n"
+      g_warning ("Unix signal source dispatched without callback. "
                 "You must call g_source_set_callback().");
       return FALSE;
     }
@@ -5291,7 +5291,7 @@ g_child_watch_dispatch (GSource    *source,
 
   if (!callback)
     {
-      g_warning ("Child watch source dispatched without callback\n"
+      g_warning ("Child watch source dispatched without callback. "
                 "You must call g_source_set_callback().");
       return FALSE;
     }
@@ -5527,7 +5527,7 @@ g_idle_dispatch (GSource    *source,
 
   if (!callback)
     {
-      g_warning ("Idle source dispatched without callback\n"
+      g_warning ("Idle source dispatched without callback. "
                 "You must call g_source_set_callback().");
       return FALSE;
     }
diff --git a/glib/gpoll.c b/glib/gpoll.c
index 849a04ed3..01d19c048 100644
--- a/glib/gpoll.c
+++ b/glib/gpoll.c
@@ -271,7 +271,7 @@ g_poll (GPollFD *fds,
         {
           if (nhandles == MAXIMUM_WAIT_OBJECTS)
             {
-              g_warning ("Too many handles to wait for!\n");
+              g_warning ("Too many handles to wait for!");
               break;
             }
           else
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index 0447dcda5..c866fc8c6 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -3092,7 +3092,7 @@ g_test_trap_subprocess (const char           *test_path,
                                  &pid, NULL, &stdout_fd, &stderr_fd,
                                  &error))
     {
-      g_error ("g_test_trap_subprocess() failed: %s\n",
+      g_error ("g_test_trap_subprocess() failed: %s",
                error->message);
     }
   g_ptr_array_free (argv, TRUE);
diff --git a/glib/gwakeup.c b/glib/gwakeup.c
index 563efc7c8..f1062489c 100644
--- a/glib/gwakeup.c
+++ b/glib/gwakeup.c
@@ -158,11 +158,11 @@ g_wakeup_new (void)
 #endif
 
   if (!g_unix_open_pipe (wakeup->fds, FD_CLOEXEC, &error))
-    g_error ("Creating pipes for GWakeup: %s\n", error->message);
+    g_error ("Creating pipes for GWakeup: %s", error->message);
 
   if (!g_unix_set_fd_nonblocking (wakeup->fds[0], TRUE, &error) ||
       !g_unix_set_fd_nonblocking (wakeup->fds[1], TRUE, &error))
-    g_error ("Set pipes non-blocking for GWakeup: %s\n", error->message);
+    g_error ("Set pipes non-blocking for GWakeup: %s", error->message);
 
   return wakeup;
 }
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index 9bf7b6e0a..c08249650 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -435,47 +435,47 @@ test_mkdir_with_parents_1 (const gchar *base)
   g_remove (p0);
 
   if (g_file_test (p0, G_FILE_TEST_EXISTS))
-    g_error ("failed, %s exists, cannot test g_mkdir_with_parents\n", p0);
+    g_error ("failed, %s exists, cannot test g_mkdir_with_parents", p0);
 
   if (g_file_test (p1, G_FILE_TEST_EXISTS))
-    g_error ("failed, %s exists, cannot test g_mkdir_with_parents\n", p1);
+    g_error ("failed, %s exists, cannot test g_mkdir_with_parents", p1);
 
   if (g_file_test (p2, G_FILE_TEST_EXISTS))
-    g_error ("failed, %s exists, cannot test g_mkdir_with_parents\n", p2);
+    g_error ("failed, %s exists, cannot test g_mkdir_with_parents", p2);
 
   if (g_mkdir_with_parents (p2, 0777) == -1)
     {
       int errsv = errno;
-      g_error ("failed, g_mkdir_with_parents(%s) failed: %s\n", p2, g_strerror (errsv));
+      g_error ("failed, g_mkdir_with_parents(%s) failed: %s", p2, g_strerror (errsv));
     }
 
   if (!g_file_test (p2, G_FILE_TEST_IS_DIR))
-    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p2);
+    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory", p2, p2);
 
   if (!g_file_test (p1, G_FILE_TEST_IS_DIR))
-    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p1);
+    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory", p2, p1);
 
   if (!g_file_test (p0, G_FILE_TEST_IS_DIR))
-    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory\n", p2, p0);
+    g_error ("failed, g_mkdir_with_parents(%s) succeeded, but %s is not a directory", p2, p0);
 
   g_rmdir (p2);
   if (g_file_test (p2, G_FILE_TEST_EXISTS))
-    g_error ("failed, did g_rmdir(%s), but %s is still there\n", p2, p2);
+    g_error ("failed, did g_rmdir(%s), but %s is still there", p2, p2);
 
   g_rmdir (p1);
   if (g_file_test (p1, G_FILE_TEST_EXISTS))
-    g_error ("failed, did g_rmdir(%s), but %s is still there\n", p1, p1);
+    g_error ("failed, did g_rmdir(%s), but %s is still there", p1, p1);
 
   f = g_fopen (p1, "w");
   if (f == NULL)
-    g_error ("failed, couldn't create file %s\n", p1);
+    g_error ("failed, couldn't create file %s", p1);
   fclose (f);
 
   if (g_mkdir_with_parents (p1, 0666) == 0)
-    g_error ("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file\n", p1, p1);
+    g_error ("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file", p1, p1);
 
   if (g_mkdir_with_parents (p2, 0666) == 0)
-    g_error("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file\n", p2, p1);
+    g_error("failed, g_mkdir_with_parents(%s) succeeded, even if %s is a file", p2, p1);
 
   g_remove (p2);
   g_remove (p1);
diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c
index dd219cf6c..6b0074011 100644
--- a/glib/tests/mainloop.c
+++ b/glib/tests/mainloop.c
@@ -1250,7 +1250,7 @@ assert_main_context_state (gint n_to_poll,
           }
 
       if (j == n)
-        g_error ("Unable to find fd %d (index %d) with events 0x%x\n", expected_fd, i, (guint) 
expected_events);
+        g_error ("Unable to find fd %d (index %d) with events 0x%x", expected_fd, i, (guint) 
expected_events);
     }
   va_end (ap);
 
diff --git a/glib/tests/thread.c b/glib/tests/thread.c
index a79b9513f..b80019009 100644
--- a/glib/tests/thread.c
+++ b/glib/tests/thread.c
@@ -147,7 +147,7 @@ test_thread4 (void)
   nl.rlim_cur = 1;
 
   if ((ret = prlimit (getpid(), RLIMIT_NPROC, &nl, &ol)) != 0)
-    g_error ("prlimit failed: %s\n", g_strerror (ret));
+    g_error ("prlimit failed: %s", g_strerror (ret));
 
   error = NULL;
   thread = g_thread_try_new ("a", thread1_func, NULL, &error);
@@ -156,7 +156,7 @@ test_thread4 (void)
   g_error_free (error);
 
   if ((ret = prlimit (getpid (), RLIMIT_NPROC, &ol, NULL)) != 0)
-    g_error ("resetting RLIMIT_NPROC failed: %s\n", g_strerror (ret));
+    g_error ("resetting RLIMIT_NPROC failed: %s", g_strerror (ret));
 #endif
 }
 
diff --git a/gobject/gsourceclosure.c b/gobject/gsourceclosure.c
index 3a1a1238a..0d0d2e87c 100644
--- a/gobject/gsourceclosure.c
+++ b/gobject/gsourceclosure.c
@@ -258,7 +258,7 @@ g_source_set_closure (GSource  *source,
       source->source_funcs != &g_timeout_funcs &&
       source->source_funcs != &g_idle_funcs)
     {
-      g_critical (G_STRLOC ": closure cannot be set on GSource without GSourceFuncs::closure_callback\n");
+      g_critical (G_STRLOC ": closure cannot be set on GSource without GSourceFuncs::closure_callback");
       return;
     }
 
diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
index c67f789b1..4ecaf8c88 100644
--- a/gobject/gtypemodule.c
+++ b/gobject/gtypemodule.c
@@ -253,7 +253,7 @@ g_type_module_use (GTypeModule *module)
          ModuleTypeInfo *type_info = tmp_list->data;
          if (!type_info->loaded)
            {
-             g_warning ("plugin '%s' failed to register type '%s'\n",
+             g_warning ("plugin '%s' failed to register type '%s'",
                         module->name ? module->name : "(unknown)",
                         g_type_name (type_info->type));
              module->use_count--;
@@ -309,7 +309,7 @@ g_type_module_use_plugin (GTypePlugin *plugin)
 
   if (!g_type_module_use (module))
     {
-      g_warning ("Fatal error - Could not reload previously loaded plugin '%s'\n",
+      g_warning ("Fatal error - Could not reload previously loaded plugin '%s'",
                 module->name ? module->name : "(unknown)");
       exit (1);
     }
@@ -413,7 +413,7 @@ g_type_module_register_type (GTypeModule     *module,
        {
          const gchar *parent_type_name = g_type_name (parent_type);
          
-         g_warning ("Type '%s' recreated with different parent type.\n"
+         g_warning ("Type '%s' recreated with different parent type."
                     "(was '%s', now '%s')", type_name,
                     g_type_name (module_type_info->parent_type),
                     parent_type_name ? parent_type_name : "(unknown)");
diff --git a/tests/child-test.c b/tests/child-test.c
index 62f7efd37..24a0bf2dd 100644
--- a/tests/child-test.c
+++ b/tests/child-test.c
@@ -65,7 +65,7 @@ get_a_child (gint ttl)
   cmdline = g_strdup_printf( "child-test -c%d", ttl);
 
   if (!CreateProcess (argv0, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
-    g_error ("CreateProcess failed: %s\n", g_win32_error_message (GetLastError ()));
+    g_error ("CreateProcess failed: %s", g_win32_error_message (GetLastError ()));
 
   g_free(cmdline);
 
@@ -190,7 +190,7 @@ main (int argc, char *argv[])
 
   if (alive > 0)
     {
-      g_warning ("%d children still alive\n", alive);
+      g_warning ("%d children still alive", alive);
       return 1;
     }
     
diff --git a/tests/mainloop-test.c b/tests/mainloop-test.c
index 9b8386a65..f35f59bc6 100644
--- a/tests/mainloop-test.c
+++ b/tests/mainloop-test.c
@@ -203,7 +203,7 @@ io_pipe (GIOChannel **channels)
   if (pipe(fds) < 0)
     {
       int errsv = errno;
-      g_warning ("Cannot create pipe %s\n", g_strerror (errsv));
+      g_warning ("Cannot create pipe %s", g_strerror (errsv));
       exit (1);
     }
 
diff --git a/tests/testglib.c b/tests/testglib.c
index b5a833178..041e336e7 100644
--- a/tests/testglib.c
+++ b/tests/testglib.c
@@ -93,7 +93,7 @@ glist_test (void)
 
   for (i = 0; i < 10; i++)
     if (g_list_position (list, g_list_nth (list, i)) != i)
-      g_error ("g_list_position does not seem to be the inverse of g_list_nth\n");
+      g_error ("g_list_position does not seem to be the inverse of g_list_nth");
 
   g_list_free (list);
   list = NULL;
@@ -469,7 +469,7 @@ my_hash_callback_remove_test (gpointer key,
   int *d = value;
 
   if ((*d) % 2)
-    g_error ("hash table entry %d should have been removed already\n", *d);
+    g_error ("hash table entry %d should have been removed already", *d);
 }
 
 static void
@@ -867,7 +867,7 @@ test_paths (void)
       gchar *dirname = g_path_get_dirname (dirname_checks[i].filename);
       if (strcmp (dirname, dirname_checks[i].dirname) != 0)
        {
-         g_error ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",
+         g_error ("failed for \"%s\"==\"%s\" (returned: \"%s\")",
                   dirname_checks[i].filename,
                   dirname_checks[i].dirname,
                   dirname);
@@ -887,7 +887,7 @@ test_paths (void)
          ((skipped && skip_root_checks[i].without_root) &&
           strcmp (skipped, skip_root_checks[i].without_root)))
        {
-         g_error ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",
+         g_error ("failed for \"%s\"==\"%s\" (returned: \"%s\")",
                   skip_root_checks[i].filename,
                   (skip_root_checks[i].without_root ?
                    skip_root_checks[i].without_root : "<NULL>"),
@@ -918,25 +918,25 @@ test_file_functions (void)
   strcpy (template, "fooXXXXXX");
   fd = g_mkstemp (template);
   if (fd == -1)
-    g_error ("g_mkstemp didn't work for template %s\n", template);
+    g_error ("g_mkstemp didn't work for template %s", template);
   n = write (fd, hello, hellolen);
   errsv = errno;
   if (n == -1)
-    g_error ("write() failed: %s\n", g_strerror (errsv));
+    g_error ("write() failed: %s", g_strerror (errsv));
   else if (n != hellolen)
-    g_error ("write() should have written %d bytes, wrote %d\n", hellolen, n);
+    g_error ("write() should have written %d bytes, wrote %d", hellolen, n);
 
   lseek (fd, 0, 0);
   n = read (fd, chars, sizeof (chars));
   errsv = errno;
   if (n == -1)
-    g_error ("read() failed: %s\n", g_strerror (errsv));
+    g_error ("read() failed: %s", g_strerror (errsv));
   else if (n != hellolen)
-    g_error ("read() should have read %d bytes, got %d\n", hellolen, n);
+    g_error ("read() should have read %d bytes, got %d", hellolen, n);
 
   chars[n] = 0;
   if (strcmp (chars, hello) != 0)
-    g_error ("wrote '%s', but got '%s'\n", hello, chars);
+    g_error ("wrote '%s', but got '%s'", hello, chars);
   if (fd != -1)
     close (fd);
   remove (template);
@@ -978,7 +978,7 @@ test_file_functions (void)
   name_used = NULL;
   fd = g_file_open_tmp (template, &name_used, &error);
   if (fd == -1)
-    g_error ("g_file_open_tmp didn't work for template '%s': %s\n", template, error->message);
+    g_error ("g_file_open_tmp didn't work for template '%s': %s", template, error->message);
   else if (g_test_verbose())
     g_printerr ("g_file_open_tmp for template '%s' used name '%s'\n", template, name_used);
   if (fd != -1)
@@ -990,7 +990,7 @@ test_file_functions (void)
   name_used = NULL;
   fd = g_file_open_tmp (NULL, &name_used, &error);
   if (fd == -1)
-    g_error ("g_file_open_tmp didn't work for a NULL template: %s\n", error->message);
+    g_error ("g_file_open_tmp didn't work for a NULL template: %s", error->message);
   else
     close (fd);
   g_clear_error (&error);
@@ -1011,7 +1011,7 @@ test_arrays (void)
     g_ptr_array_add (gparray, GINT_TO_POINTER (i));
   for (i = 0; i < 10000; i++)
     if (g_ptr_array_index (gparray, i) != GINT_TO_POINTER (i))
-      g_error ("array fails: %p ( %p )\n", g_ptr_array_index (gparray, i), GINT_TO_POINTER (i));
+      g_error ("array fails: %p ( %p )", g_ptr_array_index (gparray, i), GINT_TO_POINTER (i));
   g_ptr_array_free (gparray, TRUE);
 
   gbarray = g_byte_array_new ();
@@ -1031,7 +1031,7 @@ test_arrays (void)
     g_array_append_val (garray, i);
   for (i = 0; i < 10000; i++)
     if (g_array_index (garray, gint, i) != i)
-      g_error ("failure: %d ( %d )\n", g_array_index (garray, gint, i), i);
+      g_error ("failure: %d ( %d )", g_array_index (garray, gint, i), i);
   g_array_free (garray, TRUE);
 
   garray = g_array_new (FALSE, FALSE, sizeof (gint));
@@ -1039,7 +1039,7 @@ test_arrays (void)
     g_array_prepend_val (garray, i);
   for (i = 0; i < 100; i++)
     if (g_array_index (garray, gint, i) != (100 - i - 1))
-      g_error ("failure: %d ( %d )\n", g_array_index (garray, gint, i), 100 - i - 1);
+      g_error ("failure: %d ( %d )", g_array_index (garray, gint, i), 100 - i - 1);
   g_array_free (garray, TRUE);
 }
 
@@ -1064,7 +1064,7 @@ hash_table_tests (void)
   g_hash_table_foreach (hash_table, my_hash_callback, NULL);
   for (i = 0; i < 10000; i++)
     if (array[i] == 0)
-      g_error ("hashtable-test: wrong value: %d\n", i);
+      g_error ("hashtable-test: wrong value: %d", i);
   for (i = 0; i < 10000; i++)
     g_hash_table_remove (hash_table, &array[i]);
   for (i = 0; i < 10000; i++)
@@ -1074,7 +1074,7 @@ hash_table_tests (void)
     }
   if (g_hash_table_foreach_remove (hash_table, my_hash_callback_remove, NULL) != 5000 ||
       g_hash_table_size (hash_table) != 5000)
-    g_error ("hashtable removal failed\n");
+    g_error ("hashtable removal failed");
   g_hash_table_foreach (hash_table, my_hash_callback_remove_test, NULL);
   g_hash_table_destroy (hash_table);
 }
@@ -1308,7 +1308,7 @@ various_string_tests (void)
     {
       tmp_string = g_string_chunk_insert (string_chunk, "hi pete");
       if (strcmp ("hi pete", tmp_string) != 0)
-       g_error ("string chunks are broken.\n");
+       g_error ("string chunks are broken.");
     }
   tmp_string_2 = g_string_chunk_insert_const (string_chunk, tmp_string);
   g_assert (tmp_string_2 != tmp_string && strcmp (tmp_string_2, tmp_string) == 0);


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