From 7125a86e0488320449767fcacbad5c7ca2c9c719 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 14 Jan 2020 10:17:48 +0100 Subject: [PATCH] test-qcdm-serial-port: fix warnings with -Wsign-compare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-qcdm-serial-port.c: In function ‘print_buf’: test-qcdm-serial-port.c:79:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare] 79 | for (i = 0; i < len; i++) { | ^ test-qcdm-serial-port.c: In function ‘server_wait_request’: test-qcdm-serial-port.c:163:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] 163 | } while (total < sizeof (readbuf)); | ^ --- src/tests/test-qcdm-serial-port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/test-qcdm-serial-port.c b/src/tests/test-qcdm-serial-port.c index e6899051..c5233f9c 100644 --- a/src/tests/test-qcdm-serial-port.c +++ b/src/tests/test-qcdm-serial-port.c @@ -72,7 +72,7 @@ wait_for_child (TestData *d, guint32 timeout) static void print_buf (const char *detail, const char *buf, gsize len) { - int i = 0; + guint i = 0; gboolean newline = FALSE; g_print ("%s (%zu) ", detail, len); @@ -116,7 +116,7 @@ server_wait_request (int fd, char *buf, gsize len) struct timeval timeout = { 1, 0 }; char readbuf[1024]; ssize_t bytes_read; - int total = 0, retries = 0; + guint total = 0, retries = 0; gsize decap_len = 0; FD_ZERO (&in);