mirror of
https://github.com/yshui/picom.git
synced 2024-11-18 13:55:36 -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:
parent
fb3760bbe3
commit
d00c1c7a1d
3 changed files with 6 additions and 10 deletions
|
@ -111,6 +111,6 @@
|
||||||
typedef unsigned long ulong;
|
typedef unsigned long ulong;
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
|
|
||||||
static inline int popcount(uint x) {
|
static inline int attr_const popcntul(unsigned long a) {
|
||||||
return __builtin_popcount(x);
|
return __builtin_popcountl(a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,10 +136,6 @@ static inline int attr_const normalize_i_range(int i, int min, int max) {
|
||||||
/// clamp `val` into interval [min, max]
|
/// clamp `val` into interval [min, max]
|
||||||
#define clamp(val, min, max) max2(min2(val, max), min)
|
#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.
|
* Normalize a double value to a specific range.
|
||||||
*
|
*
|
||||||
|
|
8
src/x.c
8
src/x.c
|
@ -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};
|
return (struct xvisual_info){-1, -1, -1, -1, -1, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
int red_size = popcountl(pictfmt->direct.red_mask),
|
int red_size = popcntul(pictfmt->direct.red_mask),
|
||||||
blue_size = popcountl(pictfmt->direct.blue_mask),
|
blue_size = popcntul(pictfmt->direct.blue_mask),
|
||||||
green_size = popcountl(pictfmt->direct.green_mask),
|
green_size = popcntul(pictfmt->direct.green_mask),
|
||||||
alpha_size = popcountl(pictfmt->direct.alpha_mask);
|
alpha_size = popcntul(pictfmt->direct.alpha_mask);
|
||||||
|
|
||||||
return (struct xvisual_info){
|
return (struct xvisual_info){
|
||||||
.red_size = red_size,
|
.red_size = red_size,
|
||||||
|
|
Loading…
Reference in a new issue