diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /applets | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) | |
download | busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2 busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip |
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'applets')
-rw-r--r-- | applets/applets.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/applets/applets.c b/applets/applets.c index cff792fb7..57c972f79 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -47,7 +47,6 @@ static const char usage_messages[] = "" | |||
47 | /* Define struct bb_applet applets[] */ | 47 | /* Define struct bb_applet applets[] */ |
48 | #include "applets.h" | 48 | #include "applets.h" |
49 | /* The -1 arises because of the {0,NULL,0,-1} entry. */ | 49 | /* The -1 arises because of the {0,NULL,0,-1} entry. */ |
50 | const unsigned short NUM_APPLETS = sizeof(applets) / sizeof(applets[0]) - 1; | ||
51 | 50 | ||
52 | const struct bb_applet *current_applet; | 51 | const struct bb_applet *current_applet; |
53 | const char *applet_name ATTRIBUTE_EXTERNALLY_VISIBLE; | 52 | const char *applet_name ATTRIBUTE_EXTERNALLY_VISIBLE; |
@@ -488,7 +487,7 @@ static int applet_name_compare(const void *name, const void *vapplet) | |||
488 | const struct bb_applet *find_applet_by_name(const char *name) | 487 | const struct bb_applet *find_applet_by_name(const char *name) |
489 | { | 488 | { |
490 | /* Do a binary search to find the applet entry given the name. */ | 489 | /* Do a binary search to find the applet entry given the name. */ |
491 | return bsearch(name, applets, NUM_APPLETS, sizeof(applets[0]), | 490 | return bsearch(name, applets, ARRAY_SIZE(applets)-1, sizeof(applets[0]), |
492 | applet_name_compare); | 491 | applet_name_compare); |
493 | } | 492 | } |
494 | 493 | ||