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

refactoring

This commit is contained in:
Steffen Vogel 2018-08-02 10:50:23 +02:00
parent e37d665755
commit b0017f859f
3 changed files with 13 additions and 15 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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;