Obsolete golang-120
[oi-userland.git] / components / sysutils / e2fsprogs / patches / patch-lib_ext2fs_bitops.c.patch
blob048988ec07f012d5de0c15689c1ba32c057d31ee
1 $NetBSD: patch-lib_ext2fs_bitops.c,v 1.3 2017/12/08 08:12:58 adam Exp $
3 Avoid conflict with popcountXX().
5 --- e2fsprogs-1.46.4/lib/ext2fs/bitops.c.orig 2016-09-02 13:17:32.000000000 +0900
6 +++ e2fsprogs-1.46.4/lib/ext2fs/bitops.c 2017-02-03 21:44:49.000000000 +0900
7 @@ -116,14 +116,14 @@ int ext2fs_test_bit64(__u64 nr, const vo
8 return (mask & *ADDR);
11 -static unsigned int popcount8(unsigned int w)
12 +static unsigned int ext2fs_popcount8(unsigned int w)
14 unsigned int res = w - ((w >> 1) & 0x55);
15 res = (res & 0x33) + ((res >> 2) & 0x33);
16 return (res + (res >> 4)) & 0x0F;
19 -static unsigned int popcount32(unsigned int w)
20 +static unsigned int ext2fs_popcount32(unsigned int w)
22 unsigned int res = w - ((w >> 1) & 0x55555555);
23 res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
24 @@ -139,19 +139,19 @@ unsigned int ext2fs_bitcount(const void
25 unsigned int res = 0;
27 while (((((uintptr_t) cp) & 3) != 0) && (nbytes > 0)) {
28 - res += popcount8(*cp++);
29 + res += ext2fs_popcount8(*cp++);
30 nbytes--;
32 p = (const __u32 *) cp;
34 while (nbytes > 4) {
35 - res += popcount32(*p++);
36 + res += ext2fs_popcount32(*p++);
37 nbytes -= 4;
39 cp = (const unsigned char *) p;
41 while (nbytes > 0) {
42 - res += popcount8(*cp++);
43 + res += ext2fs_popcount8(*cp++);
44 nbytes--;
46 return res;