summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorBalaji.G <balajig81@gmail.com>2012-09-26 14:09:10 +0530
committerDavid Lamparter <equinox@opensourcerouting.org>2012-10-25 10:15:59 -0700
commit837d16ccbe0fca413f8927da6a34b1e97ccada8a (patch)
tree7aed5a517b619c03d11bf567f6a14cda6f8f5efe /ospfd
parent655071f44aab42e89bcece3a93da456fdd0d913a (diff)
*: 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 <sfeldma@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_api.c4
-rw-r--r--ospfd/ospf_main.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index fc3b51dd..74a49e3b 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -155,7 +155,7 @@ ospf_api_typename (int msgtype)
{ MSG_NSM_CHANGE, "NSM change", },
};
- int i, n = sizeof (NameTab) / sizeof (NameTab[0]);
+ int i, n = array_size(NameTab);
const char *name = NULL;
for (i = 0; i < n; i++)
@@ -187,7 +187,7 @@ ospf_api_errname (int errcode)
{ OSPF_API_UNDEF, "Undefined", },
};
- int i, n = sizeof (NameTab) / sizeof (NameTab[0]);
+ int i, n = array_size(NameTab);
const char *name = NULL;
for (i = 0; i < n; i++)
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index bad674b6..1448c7d8 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -68,7 +68,7 @@ struct zebra_privs_t ospfd_privs =
.vty_group = VTY_GROUP,
#endif
.caps_p = _caps_p,
- .cap_num_p = sizeof(_caps_p)/sizeof(_caps_p[0]),
+ .cap_num_p = array_size(_caps_p),
.cap_num_i = 0
};
@@ -285,7 +285,7 @@ main (int argc, char **argv)
/* Library inits. */
zprivs_init (&ospfd_privs);
- signal_init (master, Q_SIGC(ospf_signals), ospf_signals);
+ signal_init (master, array_size(ospf_signals), ospf_signals);
cmd_init (1);
debug_init ();
vty_init (master);