diff options
author | Denis Vlasenko | 2007-07-24 15:54:42 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-07-24 15:54:42 +0000 |
commit | 990d0f63eeb502c8762076e5c5499196e09cba55 (patch) | |
tree | 30a2091a8159b1694d65f9952e2aba2667d7dc11 /networking/libiproute/rtm_map.c | |
parent | bcb66ec22e82f6b1ab93f3aec917269393a5b464 (diff) | |
download | busybox-990d0f63eeb502c8762076e5c5499196e09cba55.zip busybox-990d0f63eeb502c8762076e5c5499196e09cba55.tar.gz |
Replace index_in_[sub]str_array with index_in_[sub]strings,
which scans thru "abc\0def\0123\0\0" type strings. Saves 250 bytes.
text data bss dec hex filename
781266 1328 11844 794438 c1f46 busybox_old
781010 1328 11844 794182 c1e46 busybox_unstripped
Diffstat (limited to 'networking/libiproute/rtm_map.c')
-rw-r--r-- | networking/libiproute/rtm_map.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/libiproute/rtm_map.c b/networking/libiproute/rtm_map.c index 593017b..96b2d17 100644 --- a/networking/libiproute/rtm_map.c +++ b/networking/libiproute/rtm_map.c @@ -51,16 +51,16 @@ const char *rtnl_rtntype_n2a(int id, char *buf, int len) int rtnl_rtntype_a2n(int *id, char *arg) { - static const char * const keywords[] = { - "local", "nat", "broadcast", "brd", "anycast", - "multicast", "prohibit", "unreachable", "blackhole", - "xresolve", "unicast", "throw", NULL - }; - enum { ARG_local = 1, ARG_nat, ARG_broadcast, ARG_brd, ARG_anycast, + static const char keywords[] = + "local\0""nat\0""broadcast\0""brd\0""anycast\0" + "multicast\0""prohibit\0""unreachable\0""blackhole\0" + "xresolve\0""unicast\0""throw\0"; + enum { + ARG_local = 1, ARG_nat, ARG_broadcast, ARG_brd, ARG_anycast, ARG_multicast, ARG_prohibit, ARG_unreachable, ARG_blackhole, ARG_xresolve, ARG_unicast, ARG_throw }; - const smalluint key = index_in_substr_array(keywords, arg) + 1; + const smalluint key = index_in_substrings(keywords, arg) + 1; char *end; unsigned long res; |