1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

compile.h, utils.h: rename popcount

Rename `popcountl` to `popcntul` to avoid name conflicts with NetBSD
system headers.

Remove the unused `popcount` function.

Closes #502

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-10-07 19:35:55 +01:00
parent fb3760bbe3
commit d00c1c7a1d
No known key found for this signature in database
GPG key ID: 37C999F617EA1A47
3 changed files with 6 additions and 10 deletions

View file

@ -111,6 +111,6 @@
typedef unsigned long ulong;
typedef unsigned int uint;
static inline int popcount(uint x) {
return __builtin_popcount(x);
static inline int attr_const popcntul(unsigned long a) {
return __builtin_popcountl(a);
}

View file

@ -136,10 +136,6 @@ static inline int attr_const normalize_i_range(int i, int min, int max) {
/// clamp `val` into interval [min, max]
#define clamp(val, min, max) max2(min2(val, max), min)
static inline int attr_const popcountl(unsigned long a) {
return __builtin_popcountl(a);
}
/**
* Normalize a double value to a specific range.
*

View file

@ -632,10 +632,10 @@ struct xvisual_info x_get_visual_info(xcb_connection_t *c, xcb_visualid_t visual
return (struct xvisual_info){-1, -1, -1, -1, -1, 0};
}
int red_size = popcountl(pictfmt->direct.red_mask),
blue_size = popcountl(pictfmt->direct.blue_mask),
green_size = popcountl(pictfmt->direct.green_mask),
alpha_size = popcountl(pictfmt->direct.alpha_mask);
int red_size = popcntul(pictfmt->direct.red_mask),
blue_size = popcntul(pictfmt->direct.blue_mask),
green_size = popcntul(pictfmt->direct.green_mask),
alpha_size = popcntul(pictfmt->direct.alpha_mask);
return (struct xvisual_info){
.red_size = red_size,