From 4c51a54c36eb1a9d728acb14a700271adc7e0ee4 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 24 Apr 2022 11:06:51 +0100 Subject: tests: Make iterator signedness agree with limit g_variant_n_children() returns a size_t (or gsize, which is equivalent) so in principle it could overflow an int, although in practice we are not going to have that many extended attributes. This silences a warning from gcc -Wsign-compare. Signed-off-by: Simon McVittie --- tests/test-libglnx-xattrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-libglnx-xattrs.c b/tests/test-libglnx-xattrs.c index b72b0d0..ad52b76 100644 --- a/tests/test-libglnx-xattrs.c +++ b/tests/test-libglnx-xattrs.c @@ -122,7 +122,7 @@ do_write_run (GLnxDirFdIterator *dfd_iter, GError **error) if (!glnx_fd_get_all_xattrs (fd, ¤t_xattrs, NULL, error)) return FALSE; - for (int i = 0; i < g_variant_n_children (current_xattrs); i++) + for (size_t i = 0; i < g_variant_n_children (current_xattrs); i++) { const char *name, *value; g_variant_get_child (current_xattrs, i, "(^&ay^&ay)", &name, &value); -- cgit v1.2.1