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
This commit is contained in:
Philip Withnall
2018-04-27 16:45:36 +01:00
parent 16e58dc901
commit 9b4c50f63d
32 changed files with 98 additions and 98 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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);