From: Ben Pfaff Date: Tue, 24 Jul 2007 02:13:14 +0000 (+0000) Subject: * lib/popcount.h: Use verify_true instead of if...abort. X-Git-Tag: cvs-readonly~98 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=bec5215d857f766afeeaee128a2f334b85310bdf;hp=5882c5eb16e75999105ad54f7785311ec02a570c;p=gnulib.git * lib/popcount.h: Use verify_true instead of if...abort. * modules/popcount: Depend on verify module. Suggested by Jim Meyering. --- diff --git a/ChangeLog b/ChangeLog index f08030f7d..c8c539dc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-23 Ben Pfaff + + * lib/popcount.h: Use verify_true instead of if...abort. + * modules/popcount: Depend on verify module. + Suggested by Jim Meyering. + 2007-07-23 Bruno Haible * gnulib-tool (func_import): Create a .cvsignore file also when the diff --git a/lib/popcount.h b/lib/popcount.h index b7084cbe3..6c19de2d6 100644 --- a/lib/popcount.h +++ b/lib/popcount.h @@ -22,17 +22,17 @@ #include #include +#include "verify.h" #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR >= 4) #define POPCOUNT_CALCULATION(NAME, TYPE) \ return __builtin_##NAME (x); #else -#define POPCOUNT_CALCULATION(NAME, TYPE) \ - int pop = popcount32 (x); \ - if (CHAR_BIT * sizeof (TYPE) > 32) \ - pop += popcount32 (x >> 31 >> 1); \ - if (CHAR_BIT * sizeof (TYPE) > 64) \ - abort (); \ +#define POPCOUNT_CALCULATION(NAME, TYPE) \ + int pop = popcount32 (x); \ + if (CHAR_BIT * sizeof (TYPE) > 32) \ + pop += popcount32 (x >> 31 >> 1); \ + (void) verify_true (CHAR_BIT * sizeof (TYPE) <= 64); \ return pop; /* Compute and return the population count of the low 32 bits of diff --git a/modules/popcount b/modules/popcount index 885894d39..45fd56b70 100644 --- a/modules/popcount +++ b/modules/popcount @@ -7,6 +7,7 @@ m4/popcount.m4 Depends-on: inline +verify configure.ac: gl_POPCOUNT