From e31c6accc589276ee6c315ed1161a99bf8aa1b00 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 2 Dec 2022 20:40:44 +0100 Subject: [PATCH] gsocket: use socklen_t in more places to fix build under cygwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cygwin defines socklen_t as int, unlike everywhere else where it is uint32_t (afaics), so signed vs unsigned. The recently added -Werror=pointer-sign in 4353813058c6f47acbefac82 makes the build fail under cygwin now with something like: error: pointer targets in passing argument 5 of ‘getsockopt’ differ in signedness [-Werror=pointer-sign] This changes guint to socklen_t where needed for getsockname, getpeername and getsockopt. --- gio/gsocket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gio/gsocket.c b/gio/gsocket.c index bd5549f3a..abb481096 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -461,7 +461,7 @@ g_socket_details_from_fd (GSocket *socket) struct sockaddr sa; } address; gint fd; - guint addrlen; + socklen_t addrlen; int value, family; int errsv; @@ -1990,7 +1990,7 @@ g_socket_get_local_address (GSocket *socket, struct sockaddr_storage storage; struct sockaddr sa; } buffer; - guint len = sizeof (buffer); + socklen_t len = sizeof (buffer); g_return_val_if_fail (G_IS_SOCKET (socket), NULL); @@ -2026,7 +2026,7 @@ g_socket_get_remote_address (GSocket *socket, struct sockaddr_storage storage; struct sockaddr sa; } buffer; - guint len = sizeof (buffer); + socklen_t len = sizeof (buffer); g_return_val_if_fail (G_IS_SOCKET (socket), NULL); @@ -6220,7 +6220,7 @@ g_socket_get_option (GSocket *socket, gint *value, GError **error) { - guint size; + socklen_t size; g_return_val_if_fail (G_IS_SOCKET (socket), FALSE);