[glib: 10/11] Fix signedness warning in gio/gdatainputstream.c:read_data()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 10/11] Fix signedness warning in gio/gdatainputstream.c:read_data()
- Date: Sat, 30 Jan 2021 22:34:42 +0000 (UTC)
commit 0c49122949a3772b5a13585140bc2685c3f6f073
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Tue Nov 17 19:03:17 2020 +0100
Fix signedness warning in gio/gdatainputstream.c:read_data()
gio/gdatainputstream.c: In function ‘read_data’:
gio/gdatainputstream.c:313:35: error: comparison of integer expressions of different signedness: ‘gssize’
{aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’}
313 | g_warn_if_fail (res == size);
| ^~
gio/gdatainputstream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
index 4440eb41f..676c6ae22 100644
--- a/gio/gdatainputstream.c
+++ b/gio/gdatainputstream.c
@@ -310,7 +310,7 @@ read_data (GDataInputStream *stream,
res = g_input_stream_read (G_INPUT_STREAM (stream),
buffer, size,
NULL, NULL);
- g_warn_if_fail (res == size);
+ g_warn_if_fail (res >= 0 && (gsize) res == size);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]