]> Savannah Git Hosting - gnulib.git/commitdiff
argmatch: Fix compilation errors.
authorBruno Haible <bruno@clisp.org>
Sun, 30 Jun 2019 19:12:42 +0000 (21:12 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 30 Jun 2019 19:13:31 +0000 (21:13 +0200)
* lib/argmatch.h: Include <limits.h>, for INT_MAX.
* tests/test-argmatch.c (main): Update after last-minute function names
change.

ChangeLog
lib/argmatch.h
tests/test-argmatch.c

index a183dd42d4c8f5cdb21d421d782026aa74a2d622..8e94611dba46e745f9cacc1303850c9dc59384c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-06-30  Bruno Haible  <bruno@clisp.org>
+
+       argmatch: Fix compilation errors.
+       * lib/argmatch.h: Include <limits.h>, for INT_MAX.
+       * tests/test-argmatch.c (main): Update after last-minute function names
+       change.
+
 2019-06-30  Bruno Haible  <bruno@clisp.org>
 
        Include <stdlib.h> when needed.
index 46a452cdaa1db633c1dbe64e825498a7dd298070..d185499423c58b9239df16ced7be76591873e324 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef ARGMATCH_H_
 # define ARGMATCH_H_ 1
 
+# include <limits.h>
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdio.h>
index 0d19e979563781338738d538a767fc2856efc039..11b5819eaf5b64c66a10f268f4d8caecd0b59e3e 100644 (file)
@@ -104,13 +104,13 @@ main (int argc, char *argv[])
 #define CHECK(Input, Output)                                            \
   do {                                                                  \
     ASSERT (ARGMATCH (Input, backup_args, backup_vals) == Output);      \
-    ASSERT (argmatch_backup_value (Input) == Output);                   \
+    ASSERT (argmatch_backup_choice (Input) == Output);                  \
     if (0 <= Output)                                                    \
       {                                                                 \
         enum backup_type val = argmatch_backup_args[Output].val;        \
-        ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
-        ASSERT (*argmatch_backup_xvalue ("test",                        \
-                                         argmatch_backup_argument (&val)) \
+        ASSERT (*argmatch_backup_value ("test", Input) == val);         \
+        ASSERT (*argmatch_backup_value ("test",                         \
+                                        argmatch_backup_argument (&val)) \
                 == val);                                                \
       }                                                                 \
   } while (0)