[gimp/gimp-2-10] plug-ins: fix signedness warning with different expectation Win/Linux.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] plug-ins: fix signedness warning with different expectation Win/Linux.
- Date: Sun, 19 Apr 2020 10:56:20 +0000 (UTC)
commit b78fcb5dc98675b74e8664ab35851300ce7fe46a
Author: Jehan <jehan girinstud io>
Date: Fri Apr 17 14:13:26 2020 +0200
plug-ins: fix signedness warning with different expectation Win/Linux.
On Windows, accept() wants an int for addrlen but on Linux, it wants a
socklen_t which is an unsigned int. So we can't just switch to gint as
proposed in !232 (if we do so, the signedness warning now happens on the
Linux build instead of the Windows one).
Fortunately it looks like socklen_t is actually typedef-ed to int in
Windows headers. So let's just use this type, which is much more proper
anyway as this variable is only used in functions which want this type
on Linux.
Fixes:
> warning: pointer targets in passing argument 3 of 'accept' differ in signedness
(cherry picked from commit e854de73ee12d0dbcffe95da6322ea84fe6a51a7)
plug-ins/script-fu/script-fu-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plug-ins/script-fu/script-fu-server.c b/plug-ins/script-fu/script-fu-server.c
index 8c203d1584..c369b91395 100644
--- a/plug-ins/script-fu/script-fu-server.c
+++ b/plug-ins/script-fu/script-fu-server.c
@@ -355,7 +355,7 @@ script_fu_server_listen (gint timeout)
gchar clientname[NI_MAXHOST];
/* Connection request on original socket. */
- guint size = sizeof (client);
+ socklen_t size = sizeof (client);
gint new;
guint portno;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]