diff options
author | Denis Vlasenko | 2007-04-08 16:07:02 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-04-08 16:07:02 +0000 |
commit | 240a1cfbbe6cf42e8013ce06cb567b3f28c8727f (patch) | |
tree | 8e69bb572dbb2636689a15b21d7a646e942b5091 /coreutils | |
parent | 5694d5f8d22be2f5be53b2d0ce2e0283ef57d93f (diff) | |
download | busybox-240a1cfbbe6cf42e8013ce06cb567b3f28c8727f.zip busybox-240a1cfbbe6cf42e8013ce06cb567b3f28c8727f.tar.gz |
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 dfc8b2f..d2d77f4 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -69,15 +69,15 @@ int date_main(int argc, char **argv) if (!isofmt_arg) { ifmt = 0; /* default is date */ } else { - const char * const isoformats[] = - {"date", "hours", "minutes", "seconds"}; + static const char * const isoformats[] = + { "date", "hours", "minutes", "seconds" }; for (ifmt = 0; ifmt < 4; ifmt++) - if (!strcmp(isofmt_arg, isoformats[ifmt])) { - break; - } - if (ifmt == 4) /* parse error */ - bb_show_usage(); + if (!strcmp(isofmt_arg, isoformats[ifmt])) + goto found; + /* parse error */ + bb_show_usage(); + found: ; } } @@ -207,7 +207,7 @@ int date_main(int argc, char **argv) date_fmt[i++] = '%'; date_fmt[i++] = 'S'; } -format_utc: + format_utc: date_fmt[i++] = '%'; date_fmt[i] = (opt & DATE_OPT_UTC) ? 'Z' : 'z'; } diff --git a/coreutils/dd.c b/coreutils/dd.c index 518c5fe..4507b5e 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -75,7 +75,7 @@ int dd_main(int argc, char **argv) trunc_flag = 1 << 2, twobufs_flag = 1 << 3, }; - const char * const keywords[] = { + static const char * const keywords[] = { "bs=", "count=", "seek=", "skip=", "if=", "of=", #if ENABLE_FEATURE_DD_IBS_OBS "ibs=", "obs=", "conv=", "notrunc", "sync", "noerror", diff --git a/coreutils/expr.c b/coreutils/expr.c index f75f6e0..b6bd383 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -278,7 +278,7 @@ static VALUE *eval7(void) static VALUE *eval6(void) { VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; - const char * const keywords[] = { + static const char * const keywords[] = { "quote", "length", "match", "index", "substr", NULL }; diff --git a/coreutils/stat.c b/coreutils/stat.c index 397e395..7c56317 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -68,7 +68,7 @@ static char const *human_time(time_t t) static char const *human_fstype(long f_type) { int i; - const struct types { + static const struct types { long type; const char * const fs; } humantypes[] = { @@ -109,13 +109,13 @@ static char const *human_fstype(long f_type) { 0x62656572, "sysfs" }, { 0, "UNKNOWN" } }; - for (i=0; humantypes[i].type; ++i) + for (i = 0; humantypes[i].type; ++i) if (humantypes[i].type == f_type) break; return humantypes[i].fs; } -#ifdef CONFIG_FEATURE_STAT_FORMAT +#if ENABLE_FEATURE_STAT_FORMAT /* print statfs info */ static void print_statfs(char *pformat, const size_t buf_len, const char m, const char * const filename, void const *data @@ -354,9 +354,9 @@ static bool do_statfs(char const *filename, char const *format) return 0; } -#ifdef CONFIG_FEATURE_STAT_FORMAT +#if ENABLE_FEATURE_STAT_FORMAT if (format == NULL) -#ifndef ENABLE_SELINUX +#if !ENABLE_SELINUX format = (option_mask32 & OPT_TERSE ? "%n %i %l %t %s %b %f %a %c %d\n" : " File: \"%n\"\n" @@ -460,9 +460,9 @@ static bool do_stat(char const *filename, char const *format) return 0; } -#ifdef CONFIG_FEATURE_STAT_FORMAT +#if ENABLE_FEATURE_STAT_FORMAT if (format == NULL) { -#ifndef ENABLE_SELINUX +#if !ENABLE_SELINUX if (option_mask32 & OPT_TERSE) { format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o"; } else { diff --git a/coreutils/stty.c b/coreutils/stty.c index b13f1fb..7493192 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -388,7 +388,7 @@ static const char *device_name = bb_msg_standard_input; /* Return a string that is the printable representation of character CH */ /* Adapted from 'cat' by Torbjorn Granlund */ -static const char *visible(unsigned int ch) +static const char *visible(unsigned ch) { char *bpout = G.buf; @@ -561,18 +561,18 @@ enum { static int find_param(const char * const name) { - const char * const params[] = { + static const char * const params[] = { "line", "rows", "cols", "columns", - "size", - "speed", + "size", /* 4 */ + "speed", /* 5 */ "ispeed", "ospeed", NULL }; - smalluint i = index_in_str_array(params, name) + 1; + int i = index_in_str_array(params, name) + 1; if (i == 0) return 0; if (!(i == 4 || i == 5)) @@ -584,7 +584,7 @@ static int find_param(const char * const name) static int recover_mode(const char *arg, struct termios *mode) { int i, n; - unsigned int chr; + unsigned chr; unsigned long iflag, oflag, cflag, lflag; /* 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) } static void display_recoverable(const struct termios *mode, - const int ATTRIBUTE_UNUSED dummy) + int ATTRIBUTE_UNUSED dummy) { int i; printf("%lx:%lx:%lx:%lx", @@ -975,7 +975,7 @@ int stty_main(int argc, char **argv) goto invalid_argument; } } -end_option: + end_option: continue; } @@ -1031,7 +1031,7 @@ end_option: default: if (recover_mode(arg, &mode) == 1) break; if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break; -invalid_argument: + invalid_argument: bb_error_msg_and_die("invalid argument '%s'", arg); } stty_state &= ~STTY_noargs; diff --git a/coreutils/tr.c b/coreutils/tr.c index f72d23c..5d3dd4c 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -84,7 +84,7 @@ static unsigned int expand(const char *arg, char *buffer) unsigned i; /* XXX: FIXME: use unsigned char? */ unsigned char ac; #define CLO ":]" - const char * const classes[] = { + static const char * const classes[] = { "alpha"CLO, "alnum"CLO, "digit"CLO, "lower"CLO, "upper"CLO, "space"CLO, "blank"CLO, "punct"CLO, "cntrl"CLO, NULL }; |