]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: adjust to recent verify_true removal
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 May 2019 16:32:04 +0000 (09:32 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 May 2019 20:55:54 +0000 (13:55 -0700)
* src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
Use verify_expr instead of verify_true, which has been removed.
(DECIMAL_DIGIT_ACCUMULATE): Remove unnecessary size check.

src/system.h

index e4790f7cc6da5921b35f07e87ee423a84c77d0e5..65cd742fcdcc82c40918687361482bb743292320 100644 (file)
@@ -245,15 +245,15 @@ uid_t getuid (void);
    the third argument to x2nrealloc would be 'sizeof *(P)'.
    Ensure that sizeof *(P) is *not* 1.  In that case, it'd be
    better to use X2REALLOC, although not strictly necessary.  */
-#define X2NREALLOC(P, PN) ((void) verify_true (sizeof *(P) != 1), \
-                           x2nrealloc (P, PN, sizeof *(P)))
+#define X2NREALLOC(P, PN) verify_expr (sizeof *(P) != 1, \
+                                       x2nrealloc (P, PN, sizeof *(P)))
 
 /* Using x2realloc (when appropriate) usually makes your code more
    readable than using x2nrealloc, but it also makes it so your
    code will malfunction if sizeof *(P) ever becomes 2 or greater.
    So use this macro instead of using x2realloc directly.  */
-#define X2REALLOC(P, PN) ((void) verify_true (sizeof *(P) == 1), \
-                          x2realloc (P, PN))
+#define X2REALLOC(P, PN) verify_expr (sizeof *(P) == 1, \
+                                      x2realloc (P, PN))
 
 #include "unlocked-io.h"
 #include "same-inode.h"
@@ -567,11 +567,11 @@ is_nul (void const *buf, size_t length)
 #define DECIMAL_DIGIT_ACCUMULATE(Accum, Digit_val, Type)               \
   (                                                                    \
    (void) (&(Accum) == (Type *) NULL),  /* The type matches.  */       \
-   (void) verify_true (! TYPE_SIGNED (Type)), /* The type is unsigned.  */ \
-   (void) verify_true (sizeof (Accum) == sizeof (Type)), /* Added check.  */ \
-   (((Type) -1 / 10 < (Accum)                                          \
-     || (Type) ((Accum) * 10 + (Digit_val)) < (Accum))                 \
-    ? false : (((Accum) = (Accum) * 10 + (Digit_val)), true))          \
+   verify_expr (! TYPE_SIGNED (Type), /* The type is unsigned.  */      \
+                (((Type) -1 / 10 < (Accum)                              \
+                  || (Type) ((Accum) * 10 + (Digit_val)) < (Accum))     \
+                 ? false                                                \
+                 : (((Accum) = (Accum) * 10 + (Digit_val)), true)))     \
   )
 
 static inline void