From 5444b7e74d3574a0ef800318a50148532bffea48 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Sun, 8 Nov 2020 22:37:53 +0100 Subject: Fixing signedness warning in glib/tests/mainloop.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glib/tests/mainloop.c: In function ‘write_bytes’: glib/gmacros.h:809:26: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘long unsigned int’ 809 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) | ^ glib/tests/mainloop.c:1146:11: note: in expansion of macro ‘MIN’ 1146 | limit = MIN (*to_write, sizeof zeros); | ^~~ --- glib/tests/mainloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c index efc896ccf..5cdb2a467 100644 --- a/glib/tests/mainloop.c +++ b/glib/tests/mainloop.c @@ -1143,7 +1143,7 @@ write_bytes (gint fd, /* Detect if we run before we should */ g_assert_cmpint (*to_write, >=, 0); - limit = MIN (*to_write, sizeof zeros); + limit = MIN ((gsize) *to_write, sizeof zeros); *to_write -= write (fd, zeros, limit); return TRUE; -- cgit v1.2.1