From: Martin Mares Date: Wed, 12 Apr 2000 13:21:23 +0000 (+0000) Subject: Introduced `ARRAY_SIZE' macro to replace all the sizeof(a)/sizeof(*a) constructs. X-Git-Tag: v1.3.2~1382 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=775063494694d247b340bb1145e509e31af27802;p=thirdparty%2Fbird.git Introduced `ARRAY_SIZE' macro to replace all the sizeof(a)/sizeof(*a) constructs. --- diff --git a/client/commands.c b/client/commands.c index aa00be08d..5c60df8c8 100644 --- a/client/commands.c +++ b/client/commands.c @@ -41,7 +41,7 @@ cmd_build_tree(void) cmd_root.plastson = &cmd_root.son; - for(i=0; i(b))?(a):(b)) +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a))) #ifndef NULL #define NULL ((void *) 0) diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 5c1e70db6..350123a4f 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -185,8 +185,7 @@ bgp_get_bucket(struct bgp_proto *p, ea_list *old, ea_list *tmp) } /* Ensure that there are all mandatory attributes */ - /* FIXME: Introduce array size macro */ - for(i=0; ip.name, bgp_attr_table[bgp_mandatory_attrs[i]].name);