diff options
author | Balaji.G <balajig81@gmail.com> | 2012-09-26 14:09:10 +0530 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2012-10-25 10:15:59 -0700 |
commit | 837d16ccbe0fca413f8927da6a34b1e97ccada8a (patch) | |
tree | 7aed5a517b619c03d11bf567f6a14cda6f8f5efe /zebra | |
parent | 655071f44aab42e89bcece3a93da456fdd0d913a (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 'zebra')
-rw-r--r-- | zebra/main.c | 4 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 2 | ||||
-rw-r--r-- | zebra/test_main.c | 2 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/zebra/main.c b/zebra/main.c index 5b5265f2..50ac224e 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -104,7 +104,7 @@ struct zebra_privs_t zserv_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 }; @@ -313,7 +313,7 @@ main (int argc, char **argv) zprivs_init (&zserv_privs); /* Vty related initialize. */ - signal_init (zebrad.master, Q_SIGC(zebra_signals), zebra_signals); + signal_init (zebrad.master, array_size(zebra_signals), zebra_signals); cmd_init (1); vty_init (zebrad.master); memory_init (); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 15475e20..ab28ad27 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1985,7 +1985,7 @@ static void netlink_install_filter (int sock, __u32 pid) }; struct sock_fprog prog = { - .len = sizeof(filter) / sizeof(filter[0]), + .len = array_size(filter), .filter = filter, }; diff --git a/zebra/test_main.c b/zebra/test_main.c index 70a1a3a6..a9518637 100644 --- a/zebra/test_main.c +++ b/zebra/test_main.c @@ -280,7 +280,7 @@ main (int argc, char **argv) zebrad.master = thread_master_create (); /* Vty related initialize. */ - signal_init (zebrad.master, Q_SIGC(zebra_signals), zebra_signals); + signal_init (zebrad.master, array_size(zebra_signals), zebra_signals); cmd_init (1); vty_init (zebrad.master); memory_init (); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index b8a47031..0e29e616 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1546,7 +1546,7 @@ rib_add_ipv4 (int type, int flags, struct prefix_ipv4 *p, /* Set default distance by route type. */ if (distance == 0) { - if ((unsigned)type >= sizeof(route_info) / sizeof(route_info[0])) + if ((unsigned)type >= array_size(route_info)) distance = 150; else distance = route_info[type].distance; |