diff --git a/lib/hooks/shift_ts.c b/lib/hooks/shift_ts.c index 6504f2782..4585669d2 100644 --- a/lib/hooks/shift_ts.c +++ b/lib/hooks/shift_ts.c @@ -55,7 +55,7 @@ static int shift_ts_parse(struct hook *h, json_t *cfg) int ret; json_error_t err; - ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: f }", + ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: F }", "mode", &mode, "offset", &offset ); diff --git a/lib/nodes/cbuilder.c b/lib/nodes/cbuilder.c index 0b6e64977..409e75f5b 100644 --- a/lib/nodes/cbuilder.c +++ b/lib/nodes/cbuilder.c @@ -24,7 +24,7 @@ int cbuilder_parse(struct node *n, json_t *cfg) size_t index; json_error_t err; - ret = json_unpack_ex(cfg, &err, 0, "{ s: f, s: s, s: b }", + ret = json_unpack_ex(cfg, &err, 0, "{ s: F, s: s, s: b }", "timestep", &cb->timestep, "model", &model, "parameters", &cfg_params @@ -62,7 +62,7 @@ int cbuilder_start(struct node *n) /* Initialize mutex and cv */ pthread_mutex_init(&cb->mtx, NULL); - + cb->eventfd = eventfd(0, 0); if (cb->eventfd < 0) return -1; @@ -84,7 +84,7 @@ int cbuilder_stop(struct node *n) { int ret; struct cbuilder *cb = n->_vd; - + ret = close(cb->eventfd); if (ret) return ret; @@ -98,14 +98,14 @@ int cbuilder_read(struct node *n, struct sample *smps[], unsigned cnt) { struct cbuilder *cb = n->_vd; struct sample *smp = smps[0]; - + uint64_t cntr; - + read(cb->eventfd, &cntr, sizeof(cntr)); /* Wait for completion of step */ pthread_mutex_lock(&cb->mtx); - + float data[smp->capacity]; smp->length = cb->model->read(data, smp->capacity); @@ -113,7 +113,7 @@ int cbuilder_read(struct node *n, struct sample *smps[], unsigned cnt) /* Cast float -> double */ for (int i = 0; i < smp->length; i++) smp->data[i].f = data[i]; - + smp->sequence = cb->step; cb->read = cb->step; @@ -129,14 +129,14 @@ int cbuilder_write(struct node *n, struct sample *smps[], unsigned cnt) struct sample *smp = smps[0]; pthread_mutex_lock(&cb->mtx); - + float flt = smp->data[0].f; cb->model->write(&flt, smp->length); cb->model->code(); cb->step++; - + uint64_t incr = 1; write(cb->eventfd, &incr, sizeof(incr)); @@ -148,7 +148,7 @@ int cbuilder_write(struct node *n, struct sample *smps[], unsigned cnt) int cbuilder_fd(struct node *n) { struct cbuilder *cb = n->_vd; - + return cb->eventfd; } diff --git a/lib/nodes/file.c b/lib/nodes/file.c index 2f02efc0c..cc0a44f25 100644 --- a/lib/nodes/file.c +++ b/lib/nodes/file.c @@ -90,7 +90,7 @@ int file_parse(struct node *n, json_t *cfg) f->epoch_mode = FILE_EPOCH_DIRECT; f->flush = 0; - ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s?: b, s?: s, s?: f, s?: s, s?: f, s?: s }", + ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s?: b, s?: s, s?: F, s?: s, s?: F, s?: s }", "uri", &uri_tmpl, "flush", &f->flush, "eof", &eof, diff --git a/lib/nodes/ngsi.c b/lib/nodes/ngsi.c index 84a14b732..e77c5bdd6 100644 --- a/lib/nodes/ngsi.c +++ b/lib/nodes/ngsi.c @@ -418,7 +418,7 @@ int ngsi_parse(struct node *n, json_t *cfg) i->timeout = 1; /* default value */ i->rate = 5; /* default value */ - ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: s, s: s, s: s, s?: b, s?: f, s?: f }", + ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: s, s: s, s: s, s?: b, s?: F, s?: F }", "access_token", &i->access_token, "endpoint", &i->endpoint, "entity_id", &i->entity_id, @@ -576,7 +576,7 @@ int ngsi_write(struct node *n, struct sample *smps[], unsigned cnt) int ngsi_fd(struct node *n) { struct ngsi *i = n->_vd; - + return task_fd(&i->task); } diff --git a/lib/nodes/signal.c b/lib/nodes/signal.c index 43f50b98c..1c9cfe6a3 100644 --- a/lib/nodes/signal.c +++ b/lib/nodes/signal.c @@ -67,7 +67,7 @@ int signal_parse(struct node *n, json_t *cfg) s->stddev = 0.2; s->offset = 0; - ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: b, s?: i, s?: i, s?: f, s?: f, s?: f, s?: f, s?: f }", + ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: b, s?: i, s?: i, s?: F, s?: F, s?: F, s?: F, s?: F }", "signal", &type, "realtime", &s->rt, "limit", &s->limit, diff --git a/lib/nodes/stats.c b/lib/nodes/stats.c index 0ad71d180..6f7a160c2 100644 --- a/lib/nodes/stats.c +++ b/lib/nodes/stats.c @@ -88,7 +88,7 @@ int stats_node_parse(struct node *n, json_t *cfg) const char *node; - ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: f }", + ret = json_unpack_ex(cfg, &err, 0, "{ s: s, s: F }", "node", &node, "rate", &s->rate ); diff --git a/lib/nodes/test_rtt.c b/lib/nodes/test_rtt.c index 4a896cac7..a2104fac8 100644 --- a/lib/nodes/test_rtt.c +++ b/lib/nodes/test_rtt.c @@ -75,7 +75,7 @@ int test_rtt_parse(struct node *n, json_t *cfg) t->cooldown = 1.0; - ret = json_unpack_ex(cfg, &err, 0, "{ s?: i, s?: s, s?: s, s: f, s: o, s: o }", + ret = json_unpack_ex(cfg, &err, 0, "{ s?: i, s?: s, s?: s, s: F, s: o, s: o }", "limit", &limit, "output", &output, "format", &format,