gsocket: use socklen_t in more places to fix build under cygwin

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 4353813058
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.
This commit is contained in:
Christoph Reiter 2022-12-02 20:40:44 +01:00
parent 108f129096
commit e31c6accc5

View File

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