[gimp] plug-ins: fix signedness warning with different expectation Win/Linux.



commit e854de73ee12d0dbcffe95da6322ea84fe6a51a7
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

 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 1a3b5e715d..e9ad1ae084 100644
--- a/plug-ins/script-fu/script-fu-server.c
+++ b/plug-ins/script-fu/script-fu-server.c
@@ -350,7 +350,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]