]> Savannah Git Hosting - gnulib.git/commitdiff
count-trailing-zeros: Assume that the compiler supports 'long long'.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:33:17 +0000 (09:33 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:33:42 +0000 (09:33 +0100)
* lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define
unconditionally.
* m4/count-trailing-zeros.m4: Remove file.
* modules/count-trailing-zeros (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_TRAILING_ZEROS.
* tests/test-count-trailing-zeros.c (main): Test count_trailing_zeros_ll
unconditionally.

ChangeLog
lib/count-trailing-zeros.h
m4/count-trailing-zeros.m4 [deleted file]
modules/count-trailing-zeros
tests/test-count-trailing-zeros.c

index 3e772e4f125ef27f9b6a879747dd5bb3c284d495..e68cfa15df5a4acee144db9ddf471c2c061232a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2019-12-22  Bruno Haible  <bruno@clisp.org>
 
+       count-trailing-zeros: Assume that the compiler supports 'long long'.
+       * lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define
+       unconditionally.
+       * m4/count-trailing-zeros.m4: Remove file.
+       * modules/count-trailing-zeros (Files): Remove it.
+       (configure.ac): Don't invoke gl_COUNT_TRAILING_ZEROS.
+       * tests/test-count-trailing-zeros.c (main): Test count_trailing_zeros_ll
+       unconditionally.
+
        count-leading-zeros: Assume that the compiler supports 'long long'.
        * lib/count-leading-zeros.h (count_leading_zeros_ll): Define
        unconditionally.
index 7988e4bff445460f8b95dc1838190de27b60c077..d481acaebfe33a93c039ffe46dc9e53d5adc31e8 100644 (file)
@@ -92,7 +92,6 @@ count_trailing_zeros_l (unsigned long int x)
   COUNT_TRAILING_ZEROS (__builtin_ctzl, _BitScanForward, unsigned long int);
 }
 
-#if HAVE_UNSIGNED_LONG_LONG_INT
 /* Compute and return the number of trailing zeros in X. */
 COUNT_TRAILING_ZEROS_INLINE int
 count_trailing_zeros_ll (unsigned long long int x)
@@ -100,7 +99,6 @@ count_trailing_zeros_ll (unsigned long long int x)
   COUNT_TRAILING_ZEROS (__builtin_ctzll, _BitScanForward64,
                         unsigned long long int);
 }
-#endif
 
 _GL_INLINE_HEADER_END
 
diff --git a/m4/count-trailing-zeros.m4 b/m4/count-trailing-zeros.m4
deleted file mode 100644 (file)
index 94a8f7f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# count-trailing-zeros.m4
-dnl Copyright (C) 2013-2019 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_COUNT_TRAILING_ZEROS],
-[
-  dnl We don't need (and can't compile) count_trailing_zeros_ll
-  dnl unless the type 'unsigned long long int' exists.
-  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-])
index 841cfda5838d90270631fc0ca65eb43af50a2f6c..daf24a05a84d5004121096e5d8ef0734aaa980a7 100644 (file)
@@ -4,13 +4,11 @@ Counts the number of trailing 0-bits in a word.
 Files:
 lib/count-trailing-zeros.c
 lib/count-trailing-zeros.h
-m4/count-trailing-zeros.m4
 
 Depends-on:
 extern-inline
 
 configure.ac:
-gl_COUNT_TRAILING_ZEROS
 
 Makefile.am:
 lib_SOURCES += count-trailing-zeros.c
index 04d9ddca1213f1ab8c901ead58778f561e270e76..adb795adf75d244dde042f07c92c2258bea17573 100644 (file)
@@ -68,10 +68,8 @@ main (int argc, char *argv[])
                              UINT_BIT, UINT_MAX, 1U);
   TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_l, unsigned long int,
                              ULONG_BIT, ULONG_MAX, 1UL);
-#ifdef HAVE_UNSIGNED_LONG_LONG_INT
   TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_ll, unsigned long long int,
                              ULLONG_BIT, ULLONG_MAX, 1ULL);
-#endif
 
   return 0;
 }