[glib: 5/7] Fix signedness warning in tests/dirname-test.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 5/7] Fix signedness warning in tests/dirname-test.c
- Date: Tue, 4 May 2021 09:43:33 +0000 (UTC)
commit dcd3af70235896f536a5da8a403f2a13fa0ac025
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Fri Nov 20 21:58:23 2020 +0100
Fix signedness warning in tests/dirname-test.c
tests/dirname-test.c: In function ‘main’:
tests/dirname-test.c:105:17: error: comparison of integer expressions of different signedness: ‘gint’
{aka ‘int’} and ‘guint’ {aka ‘unsigned int’}
105 | for (i = 0; i < n_dirname_checks; i++)
| ^
tests/dirname-test.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/tests/dirname-test.c b/tests/dirname-test.c
index 52a4678f1..81c55d56d 100644
--- a/tests/dirname-test.c
+++ b/tests/dirname-test.c
@@ -53,7 +53,7 @@ int
main (int argc,
char *argv[])
{
- gint i;
+ gsize i;
struct {
gchar *filename;
gchar *dirname;
@@ -100,9 +100,8 @@ main (int argc,
{ "a:\\/", "a:\\" },
#endif
};
- guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
- for (i = 0; i < n_dirname_checks; i++)
+ for (i = 0; i < G_N_ELEMENTS (dirname_checks); i++)
{
gchar *dirname;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]