diff --git a/include/villas/sample.h b/include/villas/sample.h index ce345a19c..89f0181ad 100644 --- a/include/villas/sample.h +++ b/include/villas/sample.h @@ -86,11 +86,11 @@ struct sample { /** The values. */ union { - double f; /**< Floating point values. */ - int64_t i; /**< Integer values. */ - bool b; /**< Boolean values. */ - float complex z; /**< Complex values. */ - } data[]; /**< Data is in host endianess! */ + double f; /**< Floating point values. */ + int64_t i; /**< Integer values. */ + bool b; /**< Boolean values. */ + float complex z; /**< Complex values. */ + } data[]; /**< Data is in host endianess! */ }; #define SAMPLE_NON_POOL PTRDIFF_MIN @@ -122,7 +122,6 @@ int sample_put(struct sample *s); int sample_copy(struct sample *dst, struct sample *src); - /** Compare two samples */ int sample_cmp(struct sample *a, struct sample *b, double epsilon, int flags); diff --git a/lib/mapping.c b/lib/mapping.c index 7dea5786e..0b368e872 100644 --- a/lib/mapping.c +++ b/lib/mapping.c @@ -223,22 +223,21 @@ int mapping_parse_list(struct list *l, json_t *cfg, struct list *nodes) off = 0; json_array_foreach(json_mapping, i, json_entry) { - struct mapping_entry *e = (struct mapping_entry *) alloc(sizeof(struct mapping_entry)); + struct mapping_entry *me = (struct mapping_entry *) alloc(sizeof(struct mapping_entry)); - ret = mapping_parse(e, json_entry, nodes); + ret = mapping_parse(me, json_entry, nodes); if (ret) goto out; - e->offset = off; - off += e->length; + me->offset = off; + off += me->length; - list_push(l, e); + list_push(l, me); } ret = 0; -out: - json_decref(json_mapping); +out: json_decref(json_mapping); return ret; } diff --git a/lib/path.c b/lib/path.c index d55945b62..5ccdb85d3 100644 --- a/lib/path.c +++ b/lib/path.c @@ -524,7 +524,6 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes) for (size_t i = 0; i < list_length(&sources); i++) { struct mapping_entry *me = (struct mapping_entry *) list_at(&sources, i); - struct path_source *ps = NULL; /* Check if there is already a path_source for this source */ @@ -537,6 +536,7 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes) } } + /* Create new path_source of not existing */ if (!ps) { ps = alloc(sizeof(struct path_source)); @@ -626,7 +626,7 @@ int path_parse(struct path *p, json_t *cfg, struct list *nodes) && node_fd(ps->node) != 1; } - ret = list_destroy(&sources, NULL, false); +out: ret = list_destroy(&sources, NULL, false); if (ret) return ret;