mirror of
https://github.com/fluencelabs/redis
synced 2025-05-20 06:01:20 +00:00
rename popcount to popcount_binary to avoid a conflict with NetBSD libc
NetBSD-current's libc has a function named popcount. hiding these extensions using feature macros is not possible because redis uses other extensions covered by the same feature macro. eg. inet_aton
This commit is contained in:
parent
9a7b09ed35
commit
f27896a17d
@ -58,7 +58,7 @@ static int getBitOffsetFromArgument(redisClient *c, robj *o, size_t *offset) {
|
|||||||
/* Count number of bits set in the binary array pointed by 's' and long
|
/* Count number of bits set in the binary array pointed by 's' and long
|
||||||
* 'count' bytes. The implementation of this function is required to
|
* 'count' bytes. The implementation of this function is required to
|
||||||
* work with a input string length up to 512 MB. */
|
* work with a input string length up to 512 MB. */
|
||||||
size_t popcount(void *s, long count) {
|
size_t popcount_binary(void *s, long count) {
|
||||||
size_t bits = 0;
|
size_t bits = 0;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
uint32_t *p4 = s;
|
uint32_t *p4 = s;
|
||||||
@ -407,6 +407,6 @@ void bitcountCommand(redisClient *c) {
|
|||||||
} else {
|
} else {
|
||||||
long bytes = end-start+1;
|
long bytes = end-start+1;
|
||||||
|
|
||||||
addReplyLongLong(c,popcount(p+start,bytes));
|
addReplyLongLong(c,popcount_binary(p+start,bytes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user