From: Rafael Zalamena Date: Mon, 29 Jul 2019 22:28:59 +0000 (-0300) Subject: tools: generate northbound code without warnings X-Git-Tag: base_7.2~102^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=13080468b07ac68d101a4bbac8eb2afb17d7c893;p=mirror%2Ffrr.git tools: generate northbound code without warnings Use the alternate struct instantiation that does not generates warning on old compilers. Signed-off-by: Rafael Zalamena --- diff --git a/tools/gen_northbound_callbacks.c b/tools/gen_northbound_callbacks.c index e9a4e39bbe..ade5b3e227 100644 --- a/tools/gen_northbound_callbacks.c +++ b/tools/gen_northbound_callbacks.c @@ -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; }