[glib: 2/6] Fix several signedness problems in glib/tests/checksum.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/6] Fix several signedness problems in glib/tests/checksum.c
- Date: Wed, 14 Oct 2020 14:10:07 +0000 (UTC)
commit fd7f2e6c8a151460074d9f8bda65ce16db8efb8f
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Fri Sep 11 17:58:06 2020 +0200
Fix several signedness problems in glib/tests/checksum.c
glib/tests/checksum.c:1079:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1079 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1103:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1103 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1187:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1187 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1192:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1192 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1197:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1197 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1202:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1202 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c:1207:27: error: comparison of integer expressions of different signedness: ‘int’
and ‘size_t’ {aka ‘long unsigned int’}
1207 | for (length = 0; length <= FIXED_LEN; length++)
| ^~
glib/tests/checksum.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/glib/tests/checksum.c b/glib/tests/checksum.c
index 5f32f858e..cc78d1170 100644
--- a/glib/tests/checksum.c
+++ b/glib/tests/checksum.c
@@ -1014,9 +1014,8 @@ hexval (const gchar c)
static guint8 *
sum_to_digest (const gchar *sum, gsize *len)
{
- gsize l;
+ gsize i, l;
guint8 *digest;
- gint i;
g_assert (strlen (sum) % 2 == 0);
l = strlen (sum) / 2;
@@ -1074,7 +1073,7 @@ static void
test_checksum_string (gconstpointer d)
{
const ChecksumComputeTest *test = d;
- int length;
+ gsize length;
gchar *checksum;
for (length = 0; length <= FIXED_LEN; length++)
@@ -1098,7 +1097,7 @@ test_checksum_bytes (gconstpointer d)
{
const ChecksumComputeTest *test = d;
GBytes *input;
- int length;
+ gsize length;
gchar *checksum;
for (length = 0; length <= FIXED_LEN; length++)
@@ -1179,7 +1178,7 @@ test_unsupported (void)
int
main (int argc, char *argv[])
{
- int length;
+ gsize length;
g_test_init (&argc, &argv, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]