mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 10:08:56 +01:00 
			
		
		
		
	Fix signedness warning in gio/gsocket.c
gio/gsocket.c: In function 'g_socket_get_available_bytes':
gio/gsocket.c:3141:17: warning: comparison of integer expressions of different signedness: 'u_long' {aka 'long unsigned int'} and 'int'
       if (avail == -1)
                 ^~
gio/gsocket.c: In function 'g_socket_send_messages_with_timeout':
gio/gsocket.c:5283:19: warning: comparison of integer expressions of different signedness: 'gint' {aka 'int'} and 'guint' {aka 'unsigned int'}
     for (i = 0; i < num_messages; ++i)
                   ^
gio/gsocket.c:5308:76: warning: operand of ?: changes signedness from 'int' to 'gsize' {aka 'long long unsigned int'} due to unsignedness of other operand
         result = pollable_result == G_POLLABLE_RETURN_OK ? bytes_written : -1;
                                                                            ^~
			
			
This commit is contained in:
		@@ -3138,7 +3138,7 @@ g_socket_get_available_bytes (GSocket *socket)
 | 
				
			|||||||
       * systems add internal header size to the reported size, making it
 | 
					       * systems add internal header size to the reported size, making it
 | 
				
			||||||
       * unusable for this function. */
 | 
					       * unusable for this function. */
 | 
				
			||||||
      avail = recv (socket->priv->fd, buf, bufsize, MSG_PEEK);
 | 
					      avail = recv (socket->priv->fd, buf, bufsize, MSG_PEEK);
 | 
				
			||||||
      if (avail == -1)
 | 
					      if ((gint) avail == -1)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          int errsv = get_socket_errno ();
 | 
					          int errsv = get_socket_errno ();
 | 
				
			||||||
#ifdef G_OS_WIN32
 | 
					#ifdef G_OS_WIN32
 | 
				
			||||||
@@ -5275,7 +5275,7 @@ g_socket_send_messages_with_timeout (GSocket        *socket,
 | 
				
			|||||||
#else
 | 
					#else
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    gssize result;
 | 
					    gssize result;
 | 
				
			||||||
    gint i;
 | 
					    guint i;
 | 
				
			||||||
    gint64 wait_timeout;
 | 
					    gint64 wait_timeout;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wait_timeout = timeout_us;
 | 
					    wait_timeout = timeout_us;
 | 
				
			||||||
@@ -5305,7 +5305,11 @@ g_socket_send_messages_with_timeout (GSocket        *socket,
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        result = pollable_result == G_POLLABLE_RETURN_OK ? bytes_written : -1;
 | 
					        if (G_MAXSSIZE > bytes_written &&
 | 
				
			||||||
 | 
					            pollable_result == G_POLLABLE_RETURN_OK)
 | 
				
			||||||
 | 
					          result = (gssize) bytes_written;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					          result = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* check if we've timed out or how much time to wait at most */
 | 
					        /* check if we've timed out or how much time to wait at most */
 | 
				
			||||||
        if (timeout_us > 0)
 | 
					        if (timeout_us > 0)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user