From: Bruno Haible <bruno@clisp.org>
Date: Fri, 4 Aug 2023 11:28:27 +0000 (+0200)
Subject: readutmp tests: Fix gcc warning (regression from yesterday).
X-Git-Tag: v1.0~965
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=49b4e91f228885cd8e7012d80150d197008d69e6;p=gnulib.git

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/ChangeLog b/ChangeLog
index 8730fd9bc8..dc30f193f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-08-04  Bruno Haible  <bruno@clisp.org>
+
+	readutmp tests: Fix gcc warning (regression from yesterday).
+	* tests/test-readutmp.c: Include idx.h.
+	(main): Use idx_t instead of size_t.
+
 2023-08-03  Paul Eggert  <eggert@cs.ucla.edu>
 
 	readutmp: systemd supports only UTMP_FILE
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];