mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactor: print node and path names uniformly
This commit is contained in:
parent
ff9296086b
commit
9bbb1874ca
3 changed files with 9 additions and 9 deletions
12
lib/node.c
12
lib/node.c
|
@ -109,7 +109,7 @@ static int node_direction_parse(struct node_direction *nd, struct node *n, json_
|
|||
"enabled", &nd->enabled
|
||||
);
|
||||
if (ret)
|
||||
jerror(&err, "Failed to parse node '%s'", node_name(n));
|
||||
jerror(&err, "Failed to parse node %s", node_name(n));
|
||||
|
||||
#ifdef WITH_HOOKS
|
||||
if (json_hooks) {
|
||||
|
@ -131,10 +131,10 @@ static int node_direction_parse(struct node_direction *nd, struct node *n, json_
|
|||
static int node_direction_check(struct node_direction *nd, struct node *n)
|
||||
{
|
||||
if (nd->vectorize <= 0)
|
||||
error("Invalid `vectorize` value %d for node %s. Must be natural number!", nd->vectorize, node_name(n));
|
||||
error("Invalid setting 'vectorize' with value %d for node %s. Must be natural number!", nd->vectorize, node_name(n));
|
||||
|
||||
if (node_type(n)->vectorize && node_type(n)->vectorize < nd->vectorize)
|
||||
error("Invalid value for `vectorize`. Node type requires a number smaller than %d!",
|
||||
error("Invalid value for setting 'vectorize'. Node type requires a number smaller than %d!",
|
||||
node_type(n)->vectorize);
|
||||
|
||||
return 0;
|
||||
|
@ -257,12 +257,12 @@ int node_parse(struct node *n, json_t *json, const char *name)
|
|||
|
||||
ret = node_direction_parse(dirs[j].dir, n, json_dir);
|
||||
if (ret)
|
||||
error("Failed to parse %s direction of node '%s'", dirs[j].str, node_name(n));
|
||||
error("Failed to parse %s direction of node %s", dirs[j].str, node_name(n));
|
||||
}
|
||||
|
||||
ret = node_type(n)->parse ? node_type(n)->parse(n, json) : 0;
|
||||
if (ret)
|
||||
error("Failed to parse node '%s'", node_name(n));
|
||||
error("Failed to parse node %s", node_name(n));
|
||||
|
||||
n->cfg = json;
|
||||
n->state = STATE_PARSED;
|
||||
|
@ -588,7 +588,7 @@ invalid2:
|
|||
strcatf(&allstr, " %s", node_name_short(n));
|
||||
}
|
||||
|
||||
error("Unknown node '%s'. Choose of one of: %s", str, allstr);
|
||||
error("Unknown node %s. Choose of one of: %s", str, allstr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -657,14 +657,14 @@ int path_check(struct path *p)
|
|||
struct path_source *ps = (struct path_source *) list_at(&p->sources, i);
|
||||
|
||||
if (!ps->node->_vt->read)
|
||||
error("Source node '%s' is not supported as a source for path '%s'", node_name(ps->node), path_name(p));
|
||||
error("Source node %s is not supported as a source for path %s", node_name(ps->node), path_name(p));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < list_length(&p->destinations); i++) {
|
||||
struct path_destination *pd = (struct path_destination *) list_at(&p->destinations, i);
|
||||
|
||||
if (!pd->node->_vt->write)
|
||||
error("Destiation node '%s' is not supported as a sink for path '%s'", node_name(pd->node), path_name(p));
|
||||
error("Destiation node %s is not supported as a sink for path %s", node_name(pd->node), path_name(p));
|
||||
}
|
||||
|
||||
if (!IS_POW2(p->queuelen)) {
|
||||
|
|
|
@ -353,7 +353,7 @@ check: if (optarg == endptr)
|
|||
|
||||
node = (struct node *) list_lookup(&sn.nodes, nodestr);
|
||||
if (!node)
|
||||
error("Node '%s' does not exist!", nodestr);
|
||||
error("Node %s does not exist!", nodestr);
|
||||
|
||||
#ifdef LIBWEBSOCKETS_FOUND
|
||||
/* Only start web subsystem if villas-pipe is used with a websocket node */
|
||||
|
|
Loading…
Add table
Reference in a new issue