From db452508bf3d808a33b3fc04c946d8cc2939bbb7 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 2 Nov 2018 22:07:07 -0200 Subject: lib, tools: use CHECK_FLAG/SET_FLAG more often in the northbound code Cosmetic change to improve code readability a bit. No binary changes. Signed-off-by: Renato Westphal --- lib/northbound_cli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/northbound_cli.c') diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index 8ae44e72d..c7378d244 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -359,7 +359,7 @@ static int nb_cli_show_config_libyang(struct vty *vty, LYD_FORMAT format, { struct lyd_node *dnode; char *strp; - int options; + int options = 0; dnode = yang_dnode_dup(config->dnode); if (translator @@ -371,11 +371,11 @@ static int nb_cli_show_config_libyang(struct vty *vty, LYD_FORMAT format, return CMD_WARNING; } - options = LYP_FORMAT | LYP_WITHSIBLINGS; + SET_FLAG(options, LYP_FORMAT | LYP_WITHSIBLINGS); if (with_defaults) - options |= LYP_WD_ALL; + SET_FLAG(options, LYP_WD_ALL); else - options |= LYP_WD_TRIM; + SET_FLAG(options, LYP_WD_TRIM); if (lyd_print_mem(&strp, dnode, format, options) == 0 && strp) { vty_out(vty, "%s", strp); -- cgit v1.2.3