]> Savannah Git Hosting - gnulib.git/commitdiff
stdc_count_ones: Fix compilation error with g++ < 4.4.
authorBruno Haible <bruno@clisp.org>
Mon, 16 Sep 2024 23:44:51 +0000 (01:44 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 17 Sep 2024 11:59:42 +0000 (13:59 +0200)
* lib/stdbit.in.h (__gl_stdbit_popcount_wide): Suffix 64-bit integer
constant with LL.

ChangeLog
lib/stdbit.in.h

index a61fba9088fcc46d7bee76b3637e129db6d854f1..b8d5b9a96637ae50ae2599fd1c6f6781028c91a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-16  Bruno Haible  <bruno@clisp.org>
+
+       stdc_count_ones: Fix compilation error with g++ < 4.4.
+       * lib/stdbit.in.h (__gl_stdbit_popcount_wide): Suffix 64-bit integer
+       constant with LL.
+
 2024-09-16  Bruno Haible  <bruno@clisp.org>
 
        faccessat: Correct errno value on AIX.
index 9f9e60a5d38f2cd339f6d0caaa95a3c640b8c528..20b9f4f46621b687df2872d418316e6d269595c1 100644 (file)
@@ -308,7 +308,7 @@ __gl_stdbit_popcount_wide (unsigned long long int n)
         x333333 = max / (1 << 2 | 1),  /* 0x333333... */
         x0f0f0f = max / (1 << 4 | 1),  /* 0x0f0f0f... */
         x010101 = max / ((1 << 8) - 1),        /* 0x010101... */
-        x000_7f = max / 0xffffffffffffffff * 0x7f; /* 0x000000000000007f... */
+        x000_7f = max / 0xffffffffffffffffLL * 0x7f; /* 0x000000000000007f... */
       n -= (n >> 1) & x555555;
       n = (n & x333333) + ((n >> 2) & x333333);
       n = (n + (n >> 4)) & x0f0f0f;