Change in libosmocore[master]: vty reference: fix deprecation bit evaluation

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Sep 24 06:40:05 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11070 )

Change subject: vty reference: fix deprecation bit evaluation
......................................................................

vty reference: fix deprecation bit evaluation

In vty_dump_nodes(), make sure the bitwise & is evaluated first.

For the deprecation flag (0x1), the practical effect is most likely identical,
assuming that the boolean ! operator flips the first bit, so I expect no
visible functional difference. It still was confusing and wrong to look at.

Related: OS#3584
Change-Id: I1f18e0e41da4772d092d71261b9e489dc1598923
---
M src/vty/command.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/vty/command.c b/src/vty/command.c
index 43f974c..900680f 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -679,7 +679,7 @@
 			elem = vector_slot(cnode->cmd_vector, j);
 			if (!vty_command_is_common(elem))
 				continue;
-			if (!elem->attr & CMD_ATTR_DEPRECATED)
+			if (!(elem->attr & CMD_ATTR_DEPRECATED))
 				vty_dump_element(elem, vty);
 		}
 	}
@@ -717,7 +717,7 @@
 			elem = vector_slot(cnode->cmd_vector, j);
 			if (vty_command_is_common(elem))
 				continue;
-			if (!elem->attr & CMD_ATTR_DEPRECATED)
+			if (!(elem->attr & CMD_ATTR_DEPRECATED))
 				vty_dump_element(elem, vty);
 		}
 

-- 
To view, visit https://gerrit.osmocom.org/11070
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f18e0e41da4772d092d71261b9e489dc1598923
Gerrit-Change-Number: 11070
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180924/8d9d0a2c/attachment.htm>


More information about the gerrit-log mailing list