diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 16:07:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-08 16:07:02 +0000 |
commit | 240a1cfbbe6cf42e8013ce06cb567b3f28c8727f (patch) | |
tree | 8e69bb572dbb2636689a15b21d7a646e942b5091 /coreutils | |
parent | 5694d5f8d22be2f5be53b2d0ce2e0283ef57d93f (diff) | |
download | busybox-w32-240a1cfbbe6cf42e8013ce06cb567b3f28c8727f.tar.gz busybox-w32-240a1cfbbe6cf42e8013ce06cb567b3f28c8727f.tar.bz2 busybox-w32-240a1cfbbe6cf42e8013ce06cb567b3f28c8727f.zip |
add some missed statics on constant objects.
fix few #ifndef ENABLE_xxx
# size busybox_old busybox_unstripped
text data bss dec hex filename
677152 2920 18208 698280 aa7a8 busybox_old
676420 2920 18208 697548 aa4cc busybox_unstripped
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/date.c | 16 | ||||
-rw-r--r-- | coreutils/dd.c | 2 | ||||
-rw-r--r-- | coreutils/expr.c | 2 | ||||
-rw-r--r-- | coreutils/stat.c | 14 | ||||
-rw-r--r-- | coreutils/stty.c | 18 | ||||
-rw-r--r-- | coreutils/tr.c | 2 |
6 files changed, 27 insertions, 27 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index dfc8b2f40..d2d77f413 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -69,15 +69,15 @@ int date_main(int argc, char **argv) | |||
69 | if (!isofmt_arg) { | 69 | if (!isofmt_arg) { |
70 | ifmt = 0; /* default is date */ | 70 | ifmt = 0; /* default is date */ |
71 | } else { | 71 | } else { |
72 | const char * const isoformats[] = | 72 | static const char * const isoformats[] = |
73 | {"date", "hours", "minutes", "seconds"}; | 73 | { "date", "hours", "minutes", "seconds" }; |
74 | 74 | ||
75 | for (ifmt = 0; ifmt < 4; ifmt++) | 75 | for (ifmt = 0; ifmt < 4; ifmt++) |
76 | if (!strcmp(isofmt_arg, isoformats[ifmt])) { | 76 | if (!strcmp(isofmt_arg, isoformats[ifmt])) |
77 | break; | 77 | goto found; |
78 | } | 78 | /* parse error */ |
79 | if (ifmt == 4) /* parse error */ | 79 | bb_show_usage(); |
80 | bb_show_usage(); | 80 | found: ; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
@@ -207,7 +207,7 @@ int date_main(int argc, char **argv) | |||
207 | date_fmt[i++] = '%'; | 207 | date_fmt[i++] = '%'; |
208 | date_fmt[i++] = 'S'; | 208 | date_fmt[i++] = 'S'; |
209 | } | 209 | } |
210 | format_utc: | 210 | format_utc: |
211 | date_fmt[i++] = '%'; | 211 | date_fmt[i++] = '%'; |
212 | date_fmt[i] = (opt & DATE_OPT_UTC) ? 'Z' : 'z'; | 212 | date_fmt[i] = (opt & DATE_OPT_UTC) ? 'Z' : 'z'; |
213 | } | 213 | } |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 518c5fed2..4507b5e0c 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -75,7 +75,7 @@ int dd_main(int argc, char **argv) | |||
75 | trunc_flag = 1 << 2, | 75 | trunc_flag = 1 << 2, |
76 | twobufs_flag = 1 << 3, | 76 | twobufs_flag = 1 << 3, |
77 | }; | 77 | }; |
78 | const char * const keywords[] = { | 78 | static const char * const keywords[] = { |
79 | "bs=", "count=", "seek=", "skip=", "if=", "of=", | 79 | "bs=", "count=", "seek=", "skip=", "if=", "of=", |
80 | #if ENABLE_FEATURE_DD_IBS_OBS | 80 | #if ENABLE_FEATURE_DD_IBS_OBS |
81 | "ibs=", "obs=", "conv=", "notrunc", "sync", "noerror", | 81 | "ibs=", "obs=", "conv=", "notrunc", "sync", "noerror", |
diff --git a/coreutils/expr.c b/coreutils/expr.c index f75f6e0de..b6bd383f6 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -278,7 +278,7 @@ static VALUE *eval7(void) | |||
278 | static VALUE *eval6(void) | 278 | static VALUE *eval6(void) |
279 | { | 279 | { |
280 | VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; | 280 | VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; |
281 | const char * const keywords[] = { | 281 | static const char * const keywords[] = { |
282 | "quote", "length", "match", "index", "substr", NULL | 282 | "quote", "length", "match", "index", "substr", NULL |
283 | }; | 283 | }; |
284 | 284 | ||
diff --git a/coreutils/stat.c b/coreutils/stat.c index 397e395d8..7c5631764 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
@@ -68,7 +68,7 @@ static char const *human_time(time_t t) | |||
68 | static char const *human_fstype(long f_type) | 68 | static char const *human_fstype(long f_type) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | const struct types { | 71 | static const struct types { |
72 | long type; | 72 | long type; |
73 | const char * const fs; | 73 | const char * const fs; |
74 | } humantypes[] = { | 74 | } humantypes[] = { |
@@ -109,13 +109,13 @@ static char const *human_fstype(long f_type) | |||
109 | { 0x62656572, "sysfs" }, | 109 | { 0x62656572, "sysfs" }, |
110 | { 0, "UNKNOWN" } | 110 | { 0, "UNKNOWN" } |
111 | }; | 111 | }; |
112 | for (i=0; humantypes[i].type; ++i) | 112 | for (i = 0; humantypes[i].type; ++i) |
113 | if (humantypes[i].type == f_type) | 113 | if (humantypes[i].type == f_type) |
114 | break; | 114 | break; |
115 | return humantypes[i].fs; | 115 | return humantypes[i].fs; |
116 | } | 116 | } |
117 | 117 | ||
118 | #ifdef CONFIG_FEATURE_STAT_FORMAT | 118 | #if ENABLE_FEATURE_STAT_FORMAT |
119 | /* print statfs info */ | 119 | /* print statfs info */ |
120 | static void print_statfs(char *pformat, const size_t buf_len, const char m, | 120 | static void print_statfs(char *pformat, const size_t buf_len, const char m, |
121 | const char * const filename, void const *data | 121 | const char * const filename, void const *data |
@@ -354,9 +354,9 @@ static bool do_statfs(char const *filename, char const *format) | |||
354 | return 0; | 354 | return 0; |
355 | } | 355 | } |
356 | 356 | ||
357 | #ifdef CONFIG_FEATURE_STAT_FORMAT | 357 | #if ENABLE_FEATURE_STAT_FORMAT |
358 | if (format == NULL) | 358 | if (format == NULL) |
359 | #ifndef ENABLE_SELINUX | 359 | #if !ENABLE_SELINUX |
360 | format = (option_mask32 & OPT_TERSE | 360 | format = (option_mask32 & OPT_TERSE |
361 | ? "%n %i %l %t %s %b %f %a %c %d\n" | 361 | ? "%n %i %l %t %s %b %f %a %c %d\n" |
362 | : " File: \"%n\"\n" | 362 | : " File: \"%n\"\n" |
@@ -460,9 +460,9 @@ static bool do_stat(char const *filename, char const *format) | |||
460 | return 0; | 460 | return 0; |
461 | } | 461 | } |
462 | 462 | ||
463 | #ifdef CONFIG_FEATURE_STAT_FORMAT | 463 | #if ENABLE_FEATURE_STAT_FORMAT |
464 | if (format == NULL) { | 464 | if (format == NULL) { |
465 | #ifndef ENABLE_SELINUX | 465 | #if !ENABLE_SELINUX |
466 | if (option_mask32 & OPT_TERSE) { | 466 | if (option_mask32 & OPT_TERSE) { |
467 | format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o"; | 467 | format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o"; |
468 | } else { | 468 | } else { |
diff --git a/coreutils/stty.c b/coreutils/stty.c index b13f1fb28..7493192e9 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -388,7 +388,7 @@ static const char *device_name = bb_msg_standard_input; | |||
388 | 388 | ||
389 | /* Return a string that is the printable representation of character CH */ | 389 | /* Return a string that is the printable representation of character CH */ |
390 | /* Adapted from 'cat' by Torbjorn Granlund */ | 390 | /* Adapted from 'cat' by Torbjorn Granlund */ |
391 | static const char *visible(unsigned int ch) | 391 | static const char *visible(unsigned ch) |
392 | { | 392 | { |
393 | char *bpout = G.buf; | 393 | char *bpout = G.buf; |
394 | 394 | ||
@@ -561,18 +561,18 @@ enum { | |||
561 | 561 | ||
562 | static int find_param(const char * const name) | 562 | static int find_param(const char * const name) |
563 | { | 563 | { |
564 | const char * const params[] = { | 564 | static const char * const params[] = { |
565 | "line", | 565 | "line", |
566 | "rows", | 566 | "rows", |
567 | "cols", | 567 | "cols", |
568 | "columns", | 568 | "columns", |
569 | "size", | 569 | "size", /* 4 */ |
570 | "speed", | 570 | "speed", /* 5 */ |
571 | "ispeed", | 571 | "ispeed", |
572 | "ospeed", | 572 | "ospeed", |
573 | NULL | 573 | NULL |
574 | }; | 574 | }; |
575 | smalluint i = index_in_str_array(params, name) + 1; | 575 | int i = index_in_str_array(params, name) + 1; |
576 | if (i == 0) | 576 | if (i == 0) |
577 | return 0; | 577 | return 0; |
578 | if (!(i == 4 || i == 5)) | 578 | if (!(i == 4 || i == 5)) |
@@ -584,7 +584,7 @@ static int find_param(const char * const name) | |||
584 | static int recover_mode(const char *arg, struct termios *mode) | 584 | static int recover_mode(const char *arg, struct termios *mode) |
585 | { | 585 | { |
586 | int i, n; | 586 | int i, n; |
587 | unsigned int chr; | 587 | unsigned chr; |
588 | unsigned long iflag, oflag, cflag, lflag; | 588 | unsigned long iflag, oflag, cflag, lflag; |
589 | 589 | ||
590 | /* Scan into temporaries since it is too much trouble to figure out | 590 | /* Scan into temporaries since it is too much trouble to figure out |
@@ -612,7 +612,7 @@ static int recover_mode(const char *arg, struct termios *mode) | |||
612 | } | 612 | } |
613 | 613 | ||
614 | static void display_recoverable(const struct termios *mode, | 614 | static void display_recoverable(const struct termios *mode, |
615 | const int ATTRIBUTE_UNUSED dummy) | 615 | int ATTRIBUTE_UNUSED dummy) |
616 | { | 616 | { |
617 | int i; | 617 | int i; |
618 | printf("%lx:%lx:%lx:%lx", | 618 | printf("%lx:%lx:%lx:%lx", |
@@ -975,7 +975,7 @@ int stty_main(int argc, char **argv) | |||
975 | goto invalid_argument; | 975 | goto invalid_argument; |
976 | } | 976 | } |
977 | } | 977 | } |
978 | end_option: | 978 | end_option: |
979 | continue; | 979 | continue; |
980 | } | 980 | } |
981 | 981 | ||
@@ -1031,7 +1031,7 @@ end_option: | |||
1031 | default: | 1031 | default: |
1032 | if (recover_mode(arg, &mode) == 1) break; | 1032 | if (recover_mode(arg, &mode) == 1) break; |
1033 | if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break; | 1033 | if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break; |
1034 | invalid_argument: | 1034 | invalid_argument: |
1035 | bb_error_msg_and_die("invalid argument '%s'", arg); | 1035 | bb_error_msg_and_die("invalid argument '%s'", arg); |
1036 | } | 1036 | } |
1037 | stty_state &= ~STTY_noargs; | 1037 | stty_state &= ~STTY_noargs; |
diff --git a/coreutils/tr.c b/coreutils/tr.c index f72d23c03..5d3dd4cd8 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -84,7 +84,7 @@ static unsigned int expand(const char *arg, char *buffer) | |||
84 | unsigned i; /* XXX: FIXME: use unsigned char? */ | 84 | unsigned i; /* XXX: FIXME: use unsigned char? */ |
85 | unsigned char ac; | 85 | unsigned char ac; |
86 | #define CLO ":]" | 86 | #define CLO ":]" |
87 | const char * const classes[] = { | 87 | static const char * const classes[] = { |
88 | "alpha"CLO, "alnum"CLO, "digit"CLO, "lower"CLO, "upper"CLO, "space"CLO, | 88 | "alpha"CLO, "alnum"CLO, "digit"CLO, "lower"CLO, "upper"CLO, "space"CLO, |
89 | "blank"CLO, "punct"CLO, "cntrl"CLO, NULL | 89 | "blank"CLO, "punct"CLO, "cntrl"CLO, NULL |
90 | }; | 90 | }; |