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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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