[glib] Use g_set_error_literal
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [glib] Use g_set_error_literal
- Date: Wed, 20 May 2009 07:47:20 -0400 (EDT)
commit 80cfd099f3c9fa23b2a21c77e3698f1c4ac94b06
Author: Christian Persch <chpe gnome org>
Date: Tue May 19 15:03:14 2009 +0200
Use g_set_error_literal
Bug #583206.
---
gio/gsocket.c | 20 ++++++++++----------
gio/gsocketclient.c | 8 ++++----
gio/gunixconnection.c | 4 ++--
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 03944d6..b1d2728 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -274,8 +274,8 @@ check_socket (GSocket *socket,
{
if (!socket->priv->inited)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED,
- _("Invalid socket, not initialized"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED,
+ _("Invalid socket, not initialized"));
return FALSE;
}
@@ -742,8 +742,8 @@ g_socket_initable_init (GInitable *initable,
if (cancellable != NULL)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- _("Cancellable initialization not supported"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Cancellable initialization not supported"));
return FALSE;
}
@@ -1442,8 +1442,8 @@ g_socket_connect (GSocket *socket,
g_prefix_error (error, _("Error connecting: "));
}
else
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_PENDING,
- _("Connection in progress"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PENDING,
+ _("Connection in progress"));
}
else
g_set_error (error, G_IO_ERROR,
@@ -1493,8 +1493,8 @@ g_socket_check_connect_result (GSocket *socket,
if (value != 0)
{
- g_set_error (error, G_IO_ERROR, socket_io_error_from_errno (value),
- "%s", socket_strerror (value));
+ g_set_error_literal (error, G_IO_ERROR, socket_io_error_from_errno (value),
+ socket_strerror (value));
return FALSE;
}
return TRUE;
@@ -2618,8 +2618,8 @@ g_socket_send_message (GSocket *socket,
seem very useful */
if (num_messages != 0)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- _("GSocketControlMessage not supported on windows"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("GSocketControlMessage not supported on windows"));
return -1;
}
diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
index bdb918d..8f3cbc5 100644
--- a/gio/gsocketclient.c
+++ b/gio/gsocketclient.c
@@ -509,8 +509,8 @@ g_socket_client_connect (GSocketClient *client,
g_propagate_error (error, tmp_error);
}
else
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Unknown error on connect"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unknown error on connect"));
break;
}
@@ -755,8 +755,8 @@ g_socket_client_enumerator_callback (GObject *object,
if (tmp_error)
set_last_error (data, tmp_error);
else if (data->last_error == NULL)
- g_set_error (&data->last_error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Unknown error on connect"));
+ g_set_error_literal (&data->last_error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unknown error on connect"));
g_socket_client_async_connect_complete (data);
return;
diff --git a/gio/gunixconnection.c b/gio/gunixconnection.c
index 47d1723..3458aa1 100644
--- a/gio/gunixconnection.c
+++ b/gio/gunixconnection.c
@@ -196,8 +196,8 @@ g_unix_connection_receive_fd (GUnixConnection *connection,
if (fd < 0)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Received invalid fd"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Received invalid fd"));
fd = -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]