Skip to content

Commit

Permalink
tools: generate northbound code without warnings
Browse files Browse the repository at this point in the history
Use the alternate struct instantiation that does not generates warning
on old compilers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
  • Loading branch information
rzalamena committed Jul 29, 2019
1 parent 88292d6 commit 1308046
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/gen_northbound_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,20 @@ static int generate_nb_nodes(const struct lys_node *snode, void *arg)
printf("\t\t{\n"
"\t\t\t.xpath = \"%s\",\n",
xpath);
printf("\t\t\t.cbs = {\n");
first = false;
}

generate_callback_name((struct lys_node *)snode, cb->operation,
cb_name, sizeof(cb_name));
printf("\t\t\t.cbs.%s = %s,\n",
nb_operation_name(cb->operation), cb_name);
printf("\t\t\t\t.%s = %s,\n", nb_operation_name(cb->operation),
cb_name);
}

if (!first)
if (!first) {
printf("\t\t\t}\n");
printf("\t\t},\n");
}

return YANG_ITER_CONTINUE;
}
Expand Down

0 comments on commit 1308046

Please sign in to comment.