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 --- ospf6d/ospf6_main.c | 2 +- ospf6d/ospf6_message.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'ospf6d') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index d3ef0a6a..1bdf52fb 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -308,7 +308,7 @@ main (int argc, char *argv[], char *envp[]) LOG_DAEMON); zprivs_init (&ospf6d_privs); /* initialize zebra libraries */ - signal_init (master, Q_SIGC(ospf6_signals), ospf6_signals); + signal_init (master, array_size(ospf6_signals), ospf6_signals); cmd_init (1); vty_init (master); memory_init (); diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 01d61263..5edb70ce 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -58,8 +58,7 @@ static const struct message ospf6_message_type_str [] = { OSPF6_MESSAGE_TYPE_LSUPDATE, "LSUpdate" }, { OSPF6_MESSAGE_TYPE_LSACK, "LSAck" }, }; -static const size_t ospf6_message_type_str_max = - sizeof (ospf6_message_type_str) / sizeof (ospf6_message_type_str[0]); +static const size_t ospf6_message_type_str_max = array_size(ospf6_message_type_str); /* Minimum (besides the standard OSPF packet header) lengths for OSPF packets of particular types, offset is the "type" field. */ -- cgit v1.2.1