mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
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:
parent
108f129096
commit
e31c6accc5
@ -461,7 +461,7 @@ g_socket_details_from_fd (GSocket *socket)
|
|||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
} address;
|
} address;
|
||||||
gint fd;
|
gint fd;
|
||||||
guint addrlen;
|
socklen_t addrlen;
|
||||||
int value, family;
|
int value, family;
|
||||||
int errsv;
|
int errsv;
|
||||||
|
|
||||||
@ -1990,7 +1990,7 @@ g_socket_get_local_address (GSocket *socket,
|
|||||||
struct sockaddr_storage storage;
|
struct sockaddr_storage storage;
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
} buffer;
|
} buffer;
|
||||||
guint len = sizeof (buffer);
|
socklen_t len = sizeof (buffer);
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_SOCKET (socket), NULL);
|
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_storage storage;
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
} buffer;
|
} buffer;
|
||||||
guint len = sizeof (buffer);
|
socklen_t len = sizeof (buffer);
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_SOCKET (socket), NULL);
|
g_return_val_if_fail (G_IS_SOCKET (socket), NULL);
|
||||||
|
|
||||||
@ -6220,7 +6220,7 @@ g_socket_get_option (GSocket *socket,
|
|||||||
gint *value,
|
gint *value,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
guint size;
|
socklen_t size;
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_SOCKET (socket), FALSE);
|
g_return_val_if_fail (G_IS_SOCKET (socket), FALSE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user