diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2013-06-11 00:29:58 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-06-24 14:18:01 +0100 |
commit | 32747def4bb4cce7cfc4f0f8ba8560392ec9ad3d (patch) | |
tree | 3caf429cb269a3046af9512dbd7b9bee94381e6a /gio/gtcpconnection.c | |
parent | aba80eea6c2965ee253a675610bd31c3dc256419 (diff) | |
download | glib-32747def4bb4cce7cfc4f0f8ba8560392ec9ad3d.tar.gz |
gio: Use the new private instance data declaration
Use the newly added macros, and remove the explicit calls to
g_type_class_add_private().
https://bugzilla.gnome.org/show_bug.cgi?id=700035
Diffstat (limited to 'gio/gtcpconnection.c')
-rw-r--r-- | gio/gtcpconnection.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gio/gtcpconnection.c b/gio/gtcpconnection.c index 00fb059c8..fb324cc06 100644 --- a/gio/gtcpconnection.c +++ b/gio/gtcpconnection.c @@ -29,9 +29,14 @@ #include "giostream.h" #include "glibintl.h" +struct _GTcpConnectionPrivate +{ + guint graceful_disconnect : 1; +}; G_DEFINE_TYPE_WITH_CODE (GTcpConnection, g_tcp_connection, G_TYPE_SOCKET_CONNECTION, + G_ADD_PRIVATE (GTcpConnection) g_socket_connection_factory_register_type (g_define_type_id, G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_STREAM, @@ -59,11 +64,6 @@ static void g_tcp_connection_close_async (GIOStream *stream, GAsyncReadyCallback callback, gpointer user_data); -struct _GTcpConnectionPrivate -{ - guint graceful_disconnect : 1; -}; - enum { @@ -74,9 +74,7 @@ enum static void g_tcp_connection_init (GTcpConnection *connection) { - connection->priv = G_TYPE_INSTANCE_GET_PRIVATE (connection, - G_TYPE_TCP_CONNECTION, - GTcpConnectionPrivate); + connection->priv = g_tcp_connection_get_private (connection); connection->priv->graceful_disconnect = FALSE; } @@ -125,8 +123,6 @@ g_tcp_connection_class_init (GTcpConnectionClass *class) GObjectClass *gobject_class = G_OBJECT_CLASS (class); GIOStreamClass *stream_class = G_IO_STREAM_CLASS (class); - g_type_class_add_private (class, sizeof (GTcpConnectionPrivate)); - gobject_class->set_property = g_tcp_connection_set_property; gobject_class->get_property = g_tcp_connection_get_property; |