summaryrefslogtreecommitdiffstats
path: root/tools/gen_northbound_callbacks.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-07-30 00:28:59 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-07-30 00:28:59 +0200
commit13080468b07ac68d101a4bbac8eb2afb17d7c893 (patch)
treea92c739039c5d3a4f0f1d0972c49c6b168a24817 /tools/gen_northbound_callbacks.c
parenttools: allow YANG model path specification (diff)
downloadfrr-13080468b07ac68d101a4bbac8eb2afb17d7c893.tar.xz
frr-13080468b07ac68d101a4bbac8eb2afb17d7c893.zip
tools: generate northbound code without warnings
Use the alternate struct instantiation that does not generates warning on old compilers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'tools/gen_northbound_callbacks.c')
-rw-r--r--tools/gen_northbound_callbacks.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/gen_northbound_callbacks.c b/tools/gen_northbound_callbacks.c
index e9a4e39bb..ade5b3e22 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;
}