mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
Fix several signedness warnings in gio/tests/unix-streams.c
gio/tests/unix-streams.c: In function ‘test_write_async_wouldblock’: gio/tests/unix-streams.c:692:17: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} 692 | for (i = 0; i < 4 * pipe_capacity; i++) | ^ gio/tests/unix-streams.c: In function ‘test_writev_async_wouldblock’: gio/tests/unix-streams.c:780:17: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} 780 | for (i = 0; i < 4 * pipe_capacity; i++) | ^
This commit is contained in:
parent
4669f91e0b
commit
a965262004
@ -474,8 +474,9 @@ test_write_wouldblock (void)
|
||||
gint fd[2];
|
||||
GError *err = NULL;
|
||||
guint8 data_write[1024], data_read[1024];
|
||||
guint i;
|
||||
gint pipe_capacity;
|
||||
gsize i;
|
||||
int retval;
|
||||
gsize pipe_capacity;
|
||||
|
||||
for (i = 0; i < sizeof (data_write); i++)
|
||||
data_write[i] = i;
|
||||
@ -483,7 +484,9 @@ test_write_wouldblock (void)
|
||||
g_assert_cmpint (pipe (fd), ==, 0);
|
||||
|
||||
g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0);
|
||||
pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL);
|
||||
retval = fcntl (fd[0], F_GETPIPE_SZ);
|
||||
g_assert_cmpint (retval, >=, 0);
|
||||
pipe_capacity = (gsize) retval;
|
||||
g_assert_cmpint (pipe_capacity, >=, 4096);
|
||||
g_assert_cmpint (pipe_capacity % 1024, >=, 0);
|
||||
|
||||
@ -552,10 +555,11 @@ test_writev_wouldblock (void)
|
||||
gint fd[2];
|
||||
GError *err = NULL;
|
||||
guint8 data_write[1024], data_read[1024];
|
||||
guint i;
|
||||
gsize i;
|
||||
int retval;
|
||||
gsize pipe_capacity;
|
||||
GOutputVector vectors[4];
|
||||
GPollableReturn res;
|
||||
gint pipe_capacity;
|
||||
|
||||
for (i = 0; i < sizeof (data_write); i++)
|
||||
data_write[i] = i;
|
||||
@ -563,7 +567,9 @@ test_writev_wouldblock (void)
|
||||
g_assert_cmpint (pipe (fd), ==, 0);
|
||||
|
||||
g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0);
|
||||
pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL);
|
||||
retval = fcntl (fd[0], F_GETPIPE_SZ);
|
||||
g_assert_cmpint (retval, >=, 0);
|
||||
pipe_capacity = (gsize) retval;
|
||||
g_assert_cmpint (pipe_capacity, >=, 4096);
|
||||
g_assert_cmpint (pipe_capacity % 1024, >=, 0);
|
||||
|
||||
@ -667,8 +673,9 @@ test_write_async_wouldblock (void)
|
||||
GUnixOutputStream *os;
|
||||
gint fd[2];
|
||||
guint8 *data, *data_read;
|
||||
guint i;
|
||||
gint pipe_capacity;
|
||||
gsize i;
|
||||
int retval;
|
||||
gsize pipe_capacity;
|
||||
gsize bytes_written = 0, bytes_read = 0;
|
||||
|
||||
g_assert_cmpint (pipe (fd), ==, 0);
|
||||
@ -685,7 +692,9 @@ test_write_async_wouldblock (void)
|
||||
g_unix_set_fd_nonblocking (fd[1], TRUE, NULL);
|
||||
|
||||
g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0);
|
||||
pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL);
|
||||
retval = fcntl (fd[0], F_GETPIPE_SZ);
|
||||
g_assert_cmpint (retval, >=, 0);
|
||||
pipe_capacity = (gsize) retval;
|
||||
g_assert_cmpint (pipe_capacity, >=, 4096);
|
||||
|
||||
data = g_new (guint8, 4 * pipe_capacity);
|
||||
@ -754,8 +763,9 @@ test_writev_async_wouldblock (void)
|
||||
GUnixOutputStream *os;
|
||||
gint fd[2];
|
||||
guint8 *data, *data_read;
|
||||
guint i;
|
||||
gint pipe_capacity;
|
||||
gsize i;
|
||||
int retval;
|
||||
gsize pipe_capacity;
|
||||
gsize bytes_written = 0, bytes_read = 0;
|
||||
GOutputVector vectors[4];
|
||||
|
||||
@ -773,7 +783,9 @@ test_writev_async_wouldblock (void)
|
||||
g_unix_set_fd_nonblocking (fd[1], TRUE, NULL);
|
||||
|
||||
g_assert_cmpint (fcntl (fd[0], F_SETPIPE_SZ, 4096, NULL), !=, 0);
|
||||
pipe_capacity = fcntl (fd[0], F_GETPIPE_SZ, &pipe_capacity, NULL);
|
||||
retval = fcntl (fd[0], F_GETPIPE_SZ);
|
||||
g_assert_cmpint (retval, >=, 0);
|
||||
pipe_capacity = (gsize) retval;
|
||||
g_assert_cmpint (pipe_capacity, >=, 4096);
|
||||
|
||||
data = g_new (guint8, 4 * pipe_capacity);
|
||||
|
Loading…
Reference in New Issue
Block a user