]> Savannah Git Hosting - gnulib.git/commitdiff
readutmp tests: Fix gcc warning (regression from yesterday).
authorBruno Haible <bruno@clisp.org>
Fri, 4 Aug 2023 11:28:27 +0000 (13:28 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 4 Aug 2023 11:28:27 +0000 (13:28 +0200)
* tests/test-readutmp.c: Include idx.h.
(main): Use idx_t instead of size_t.

ChangeLog
tests/test-readutmp.c

index 8730fd9bc8a617e3b0f090ca746117be903f1deb..dc30f193f0ffa3d1e2736d3893fe6b797cf5787a 100644 (file)
--- 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
index b03c5f9e47c095eddb5e4ec1a28990dc197eb624..7afba18b87bd89b3a0e4ca40659d0bca3addde22 100644 (file)
@@ -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];