From 21b888cdf2bc0ea1e05e521d171480e574182379 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 14 May 2011 01:56:26 +0300 Subject: [PATCH 01/18] Use guint16 for port numbers and G_MAXUINT16 instead of 0xffff --- src/idle-server-connection.c | 6 +++--- src/idle-ssl-server-connection.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c index 21c9a0e..0d48188 100644 --- a/src/idle-server-connection.c +++ b/src/idle-server-connection.c @@ -89,7 +89,7 @@ static void async_connect_data_destroy(struct _AsyncConnectData *data) { struct _IdleServerConnectionPrivate { gchar *host; - guint port; + guint16 port; GIOChannel *io_chan; IdleServerConnectionState state; @@ -198,7 +198,7 @@ static void idle_server_connection_set_property(GObject *obj, break; case PROP_PORT: - priv->port = g_value_get_uint(value); + priv->port = (guint16) g_value_get_uint(value); break; default: @@ -232,7 +232,7 @@ static void idle_server_connection_class_init(IdleServerConnectionClass *klass) pspec = g_param_spec_uint("port", "Remote port", "Port number of the remote service to connect to.", - 0, 0xffff, 0, + 0, G_MAXUINT16, 0, G_PARAM_READABLE| G_PARAM_WRITABLE| G_PARAM_STATIC_NICK| diff --git a/src/idle-ssl-server-connection.c b/src/idle-ssl-server-connection.c index e8af32c..66737cf 100644 --- a/src/idle-ssl-server-connection.c +++ b/src/idle-ssl-server-connection.c @@ -105,7 +105,7 @@ static void async_connect_data_destroy(AsyncConnectData *data) { struct _IdleSSLServerConnectionPrivate { gchar *host; - guint port; + guint16 port; GIOChannel *io_chan; SSL *ssl; @@ -224,7 +224,7 @@ static void idle_ssl_server_connection_set_property(GObject *obj, guint prop_id, break; case PROP_PORT: - priv->port = g_value_get_uint(value); + priv->port = (guint16) g_value_get_uint(value); break; default: @@ -258,7 +258,7 @@ static void idle_ssl_server_connection_class_init(IdleSSLServerConnectionClass * pspec = g_param_spec_uint("port", "Remote port", "Port number of the remote service to connect to.", - 0, 0xffff, 0, + 0, G_MAXUINT16, 0, G_PARAM_READABLE| G_PARAM_WRITABLE| G_PARAM_STATIC_NICK| -- 1.7.6.2