From 837d16ccbe0fca413f8927da6a34b1e97ccada8a Mon Sep 17 00:00:00 2001 From: "Balaji.G" Date: Wed, 26 Sep 2012 14:09:10 +0530 Subject: *: use array_size() helper macro Use the array_size() helper macro. Replaces several instances of local macros with the same definition. Reviewed-by: Scott Feldman Signed-off-by: David Lamparter --- bgpd/bgp_attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bgpd/bgp_attr.c') diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 2d82acc2..cdc99ab3 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -62,7 +62,7 @@ static const struct message attr_str [] = { BGP_ATTR_AS4_AGGREGATOR, "AS4_AGGREGATOR" }, { BGP_ATTR_AS_PATHLIMIT, "AS_PATHLIMIT" }, }; -static const int attr_str_max = sizeof(attr_str)/sizeof(attr_str[0]); +static const int attr_str_max = array_size(attr_str); static const struct message attr_flag_str[] = { @@ -72,8 +72,7 @@ static const struct message attr_flag_str[] = /* bgp_attr_flags_diagnose() relies on this bit being last in this list */ { BGP_ATTR_FLAG_EXTLEN, "Extended Length" }, }; -static const size_t attr_flag_str_max = - sizeof (attr_flag_str) / sizeof (attr_flag_str[0]); +static const size_t attr_flag_str_max = array_size(attr_flag_str); static struct hash *cluster_hash; -- cgit v1.2.1