1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
From 1352bf59879e6f39a508631342a3fee8dc360aa9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Mon, 26 Dec 2022 00:36:08 +0000
Subject: [PATCH] gio: gsocket: fix compiler warnings on armv7 Android
gsocket.c:497:37: error: passing 'guint *' (aka 'unsigned int *')
to parameter of type 'socklen_t *' (aka 'int *') converts between
pointers to integer types with different sign [-Werror,-Wpointer-sign]
---
gio/gsocket.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gio/gsocket.c b/gio/gsocket.c
index bd5549f..e00ba2c 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;
@@ -503,7 +503,7 @@ g_socket_details_from_fd (GSocket *socket)
if (addrlen > 0)
{
g_assert (G_STRUCT_OFFSET (struct sockaddr, sa_family) +
- sizeof address.storage.ss_family <= addrlen);
+ sizeof address.storage.ss_family <= (gsize) addrlen);
family = address.storage.ss_family;
}
else
@@ -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);
--
2.30.2
|