1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

hooks: fix datatype for bitmask

This commit is contained in:
Markus Mirz 2019-02-18 15:44:01 +01:00
parent 25fb713213
commit 7144190fea

View file

@ -31,7 +31,7 @@
#include <villas/sample.h>
struct average {
int mask;
uint64_t mask;
int offset;
};
@ -42,7 +42,7 @@ static int average_parse(struct hook *h, json_t *cfg)
int ret;
json_error_t err;
ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s: i }",
ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s: I }",
"offset", &p->offset,
"mask", &p->mask
);
@ -62,7 +62,7 @@ static int average_process(struct hook *h, struct sample *smps[], unsigned *cnt)
int n = 0;
for (int k = 0; k < smp->length; k++) {
if (!(p->mask & (1 << k)))
if (!(p->mask & (1LL << k)))
continue;
switch (sample_format(smps[i], k)) {