Paul Eggert wrote: > 0003-readutmp-fix-idx_t-FIXME-in-API.patch This causes a warning in the unit test:
../../gltests/test-readutmp.c:45:29: warning: pointer targets in passing argument 2 of ‘read_utmp’ differ in signedness [-Wpointer-sign] This patch fixes it. 2023-08-04 Bruno Haible <[email protected]> readutmp tests: Fix gcc warning (regression from yesterday). * tests/test-readutmp.c: Include idx.h. (main): Use idx_t instead of size_t. diff --git a/tests/test-readutmp.c b/tests/test-readutmp.c index b03c5f9e47..7afba18b87 100644 --- a/tests/test-readutmp.c +++ b/tests/test-readutmp.c @@ -26,6 +26,7 @@ #include <string.h> #include <time.h> +#include "idx.h" #include "xalloc.h" #define ELEMENT STRUCT_UTMP @@ -40,7 +41,7 @@ int main (int argc, char *argv[]) { STRUCT_UTMP *entries; - size_t num_entries; + idx_t num_entries; if (read_utmp (UTMP_FILE, &num_entries, &entries, 0) < 0) { @@ -100,7 +101,7 @@ main (int argc, char *argv[]) merge_sort_inplace (entries, num_entries, XNMALLOC (num_entries, STRUCT_UTMP)); - size_t i; + idx_t i; for (i = 0; i < num_entries; i++) { const STRUCT_UTMP *entry = &entries[i];
