- wrap label GET_COUNT in #if ENABLE_FEATURE_FANCY_applet to avoid warning

about unused label.
This commit is contained in:
Bernhard Reutner-Fischer 2005-12-13 10:48:45 +00:00
parent ec351c32e3
commit 5816ccb190
2 changed files with 11 additions and 7 deletions

View File

@ -33,7 +33,7 @@
static const char head_opts[] = static const char head_opts[] =
"n:" "n:"
#ifdef CONFIG_FEATURE_FANCY_HEAD #if ENABLE_FEATURE_FANCY_HEAD
"c:qv" "c:qv"
#endif #endif
; ;
@ -44,7 +44,7 @@ int head_main(int argc, char **argv)
{ {
unsigned long count = 10; unsigned long count = 10;
unsigned long i; unsigned long i;
#ifdef CONFIG_FEATURE_FANCY_HEAD #if ENABLE_FEATURE_FANCY_HEAD
int count_bytes = 0; int count_bytes = 0;
int header_threshhold = 1; int header_threshhold = 1;
#endif #endif
@ -56,7 +56,7 @@ int head_main(int argc, char **argv)
int c; int c;
int retval = EXIT_SUCCESS; int retval = EXIT_SUCCESS;
#if defined CONFIG_FEATURE_SUSv2 || defined CONFIG_FEATURE_FANCY_HEAD #if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
/* Allow legacy syntax of an initial numeric option without -n. */ /* Allow legacy syntax of an initial numeric option without -n. */
if ((argc > 1) && (argv[1][0] == '-') if ((argc > 1) && (argv[1][0] == '-')
/* && (isdigit)(argv[1][1]) */ /* && (isdigit)(argv[1][1]) */
@ -72,7 +72,7 @@ int head_main(int argc, char **argv)
/* No size benefit in converting this to bb_getopt_ulflags */ /* No size benefit in converting this to bb_getopt_ulflags */
while ((opt = getopt(argc, argv, head_opts)) > 0) { while ((opt = getopt(argc, argv, head_opts)) > 0) {
switch(opt) { switch(opt) {
#ifdef CONFIG_FEATURE_FANCY_HEAD #if ENABLE_FEATURE_FANCY_HEAD
case 'q': case 'q':
header_threshhold = INT_MAX; header_threshhold = INT_MAX;
break; break;
@ -85,7 +85,9 @@ int head_main(int argc, char **argv)
#endif #endif
case 'n': case 'n':
p = optarg; p = optarg;
#if ENABLE_FEATURE_FANCY_HEAD
GET_COUNT: GET_COUNT:
#endif
count = bb_xgetularg10(p); count = bb_xgetularg10(p);
break; break;
default: default:
@ -99,7 +101,7 @@ int head_main(int argc, char **argv)
} }
fmt = header_fmt_str + 1; fmt = header_fmt_str + 1;
#ifdef CONFIG_FEATURE_FANCY_HEAD #if ENABLE_FEATURE_FANCY_HEAD
if (argc - optind <= header_threshhold) { if (argc - optind <= header_threshhold) {
header_threshhold = 0; header_threshhold = 0;
} }

View File

@ -96,7 +96,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
static const char tail_opts[] = static const char tail_opts[] =
"fn:c:" "fn:c:"
#ifdef CONFIG_FEATURE_FANCY_TAIL #if ENABLE_FEATURE_FANCY_TAIL
"qs:v" "qs:v"
#endif #endif
; ;
@ -142,7 +142,9 @@ int tail_main(int argc, char **argv)
count_bytes = 1; count_bytes = 1;
/* FALLS THROUGH */ /* FALLS THROUGH */
case 'n': case 'n':
#if ENABLE_FEATURE_FANCY_TAIL
GET_COUNT: GET_COUNT:
#endif
count = bb_xgetlarg10_sfx(optarg, tail_suffixes); count = bb_xgetlarg10_sfx(optarg, tail_suffixes);
/* Note: Leading whitespace is an error trapped above. */ /* Note: Leading whitespace is an error trapped above. */
if (*optarg == '+') { if (*optarg == '+') {
@ -154,7 +156,7 @@ int tail_main(int argc, char **argv)
count = -count; count = -count;
} }
break; break;
#ifdef CONFIG_FEATURE_FANCY_TAIL #if ENABLE_FEATURE_FANCY_TAIL
case 'q': case 'q':
header_threshhold = INT_MAX; header_threshhold = INT_MAX;
break; break;