mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2026-05-07 11:58:04 +02:00
added xcb_sumof() with restriction to uint8_t
This commit is contained in:
parent
3f79628bec
commit
8c2707773b
2 changed files with 11 additions and 0 deletions
|
|
@ -59,6 +59,16 @@ int xcb_popcount(uint32_t mask)
|
|||
return ((y + (y >> 3)) & 030707070707) % 077;
|
||||
}
|
||||
|
||||
int xcb_sumof(uint8_t *list, int len)
|
||||
{
|
||||
int i, s = 0;
|
||||
for(i=0; i<len; i++) {
|
||||
s += *list;
|
||||
list++;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static int _xcb_parse_display(const char *name, char **host, char **protocol,
|
||||
int *displayp, int *screenp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply,
|
|||
/* xcb_util.c */
|
||||
|
||||
int xcb_popcount(uint32_t mask);
|
||||
int xcb_sumof(uint8_t *list, int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue