diff options
author | Christoph Reimann <oss@arcor.de> | 2010-07-13 19:56:44 +0200 |
---|---|---|
committer | Christoph Reimann <oss@arcor.de> | 2010-07-13 19:56:44 +0200 |
commit | 8c2707773b3621fb8bbda9021d23944f5be34aab (patch) | |
tree | 21cb396996ac6ae55bfd7f42726c9950fe92a46e /src/xcb_util.c | |
parent | 3f79628becbd3b0eff1aef804902eb739fac4403 (diff) |
added xcb_sumof() with restriction to uint8_t
Diffstat (limited to 'src/xcb_util.c')
-rw-r--r-- | src/xcb_util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c index 8c2a031..58bd12d 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -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) { |