[glib: 6/7] Fix signedness warnings in gio/gsocket.c




commit 26ec52b9a27c04cddcf086fce39688b8c65e07d0
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Tue Nov 17 00:18:59 2020 +0100

    Fix signedness warnings in gio/gsocket.c
    
    gio/gsocket.c: In function ‘g_socket_send_message_with_timeout’:
    gio/gsocket.c:4528:23: error: comparison of integer expressions of different signedness: ‘gint’ {aka 
‘int’} and ‘guint’ {aka ‘const unsigned int’}
     4528 |         for (i = 0; i < _message->num_vectors; i++) \
          |                       ^
    
    gio/gsocket.c: In function ‘g_socket_send_message_with_timeout’:
    gio/gsocket.c:4543:19: error: comparison of integer expressions of different signedness: ‘gint’ {aka 
‘int’} and ‘guint’ {aka ‘const unsigned int’}
     4543 |     for (i = 0; i < _message->num_control_messages; i++) \
          |                   ^
    
    gio/gsocket.c: In function ‘g_socket_send_messages_with_timeout’:
    gio/gsocket.c:5133:19: error: comparison of integer expressions of different signedness: ‘gint’ {aka 
‘int’} and ‘guint’ {aka ‘unsigned int’}
     5133 |     for (i = 0; i < num_messages; ++i)
          |                   ^
    gio/gsocket.c:5152:33: error: comparison of integer expressions of different signedness: ‘gint’ {aka 
‘int’} and ‘guint’ {aka ‘unsigned int’}
     5152 |     for (num_sent = 0; num_sent < num_messages;)
          |                                 ^

 gio/gsocket.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index fc191646b..2063998c7 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -4536,7 +4536,7 @@ G_STMT_START { \
     else \
       /* ABI is incompatible */ \
       { \
-        gint i; \
+        guint i; \
  \
         _msg->msg_iov = g_newa (struct iovec, _message->num_vectors); \
         for (i = 0; i < _message->num_vectors; i++) \
@@ -4551,7 +4551,7 @@ G_STMT_START { \
   /* control */ \
   { \
     struct cmsghdr *cmsg; \
-    gint i; \
+    guint i; \
  \
     _msg->msg_controllen = 0; \
     for (i = 0; i < _message->num_control_messages; i++) \
@@ -5134,7 +5134,7 @@ g_socket_send_messages_with_timeout (GSocket        *socket,
 #if !defined (G_OS_WIN32) && defined (HAVE_SENDMMSG)
   {
     struct mmsghdr *msgvec;
-    gint i, num_sent;
+    guint i, num_sent;
 
     /* Clamp the number of vectors if more given than we can write in one go.
      * The caller has to handle short writes anyway.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]