aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-21 12:43:45 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-21 12:43:45 +0000
commit931de892cc1c07ba3ce728cce3e4a64fe59c8444 (patch)
treed9a2eb0a78971f0556ea28538e1705b203e107ad
parenta80b4a0fa74e7a19881790943d4f58de0411fa58 (diff)
downloadbusybox-w32-931de892cc1c07ba3ce728cce3e4a64fe59c8444.tar.gz
busybox-w32-931de892cc1c07ba3ce728cce3e4a64fe59c8444.tar.bz2
busybox-w32-931de892cc1c07ba3ce728cce3e4a64fe59c8444.zip
random shrinkage of statics, -60 bytes saved
-rw-r--r--Makefile.custom1
-rw-r--r--Makefile.flags4
-rw-r--r--archival/tar.c6
-rw-r--r--coreutils/fold.c7
-rw-r--r--libbb/dump.c16
-rw-r--r--modutils/insmod.c8
6 files changed, 24 insertions, 18 deletions
diff --git a/Makefile.custom b/Makefile.custom
index bb5977697..a011d53fd 100644
--- a/Makefile.custom
+++ b/Makefile.custom
@@ -67,6 +67,7 @@ sizes: busybox_unstripped
67.PHONY: bloatcheck 67.PHONY: bloatcheck
68bloatcheck: busybox_old busybox_unstripped 68bloatcheck: busybox_old busybox_unstripped
69 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped 69 @$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
70 @$(CROSS_COMPILE)size busybox_old busybox_unstripped
70 71
71.PHONY: baseline 72.PHONY: baseline
72baseline: busybox_unstripped 73baseline: busybox_unstripped
diff --git a/Makefile.flags b/Makefile.flags
index e73cf9d31..b54679047 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -79,6 +79,6 @@ SKIP_STRIP = y
79endif 79endif
80 80
81# Busybox is a stack-fatty so make sure we increase default size 81# Busybox is a stack-fatty so make sure we increase default size
82# TODO: use "make stksizes" to find & fix big stack users; should 82# TODO: use "make stksizes" to find & fix big stack users
83# just steal scripts/checkstack.pl from the kernel ... 83# (we stole scripts/checkstack.pl from the kernel... thanks guys!)
84FLTFLAGS += -s 20000 84FLTFLAGS += -s 20000
diff --git a/archival/tar.c b/archival/tar.c
index adcedf615..bcbb7a994 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -417,11 +417,11 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
417 417
418 header_name = fileName; 418 header_name = fileName;
419 while (header_name[0] == '/') { 419 while (header_name[0] == '/') {
420 static int alreadyWarned = FALSE; 420 static smallint warned;
421 421
422 if (alreadyWarned == FALSE) { 422 if (!warned) {
423 bb_error_msg("removing leading '/' from member names"); 423 bb_error_msg("removing leading '/' from member names");
424 alreadyWarned = TRUE; 424 warned = 1;
425 } 425 }
426 header_name++; 426 header_name++;
427 } 427 }
diff --git a/coreutils/fold.c b/coreutils/fold.c
index d5e3a4d72..11b880969 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -41,6 +41,8 @@ static int adjust_column(int column, char c)
41int fold_main(int argc, char **argv); 41int fold_main(int argc, char **argv);
42int fold_main(int argc, char **argv) 42int fold_main(int argc, char **argv)
43{ 43{
44 char *line_out = NULL;
45 int allocated_out = 0;
44 char *w_opt; 46 char *w_opt;
45 int width = 80; 47 int width = 80;
46 int i; 48 int i;
@@ -75,8 +77,6 @@ int fold_main(int argc, char **argv)
75 int c; 77 int c;
76 int column = 0; /* Screen column where next char will go. */ 78 int column = 0; /* Screen column where next char will go. */
77 int offset_out = 0; /* Index in `line_out' for next char. */ 79 int offset_out = 0; /* Index in `line_out' for next char. */
78 static char *line_out = NULL;
79 static int allocated_out = 0;
80 80
81 if (istream == NULL) { 81 if (istream == NULL) {
82 errs |= EXIT_FAILURE; 82 errs |= EXIT_FAILURE;
@@ -95,8 +95,7 @@ int fold_main(int argc, char **argv)
95 column = offset_out = 0; 95 column = offset_out = 0;
96 continue; 96 continue;
97 } 97 }
98 98 rescan:
99rescan:
100 column = adjust_column(column, c); 99 column = adjust_column(column, c);
101 100
102 if (column > width) { 101 if (column > width) {
diff --git a/libbb/dump.c b/libbb/dump.c
index f078afc1c..6dbbd9f84 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -317,7 +317,8 @@ static void do_skip(const char *fname, int statok)
317 317
318static int next(char **argv) 318static int next(char **argv)
319{ 319{
320 static int done; 320 static smallint done;
321
321 int statok; 322 int statok;
322 323
323 if (argv) { 324 if (argv) {
@@ -332,10 +333,11 @@ static int next(char **argv)
332 ++_argv; 333 ++_argv;
333 continue; 334 continue;
334 } 335 }
335 statok = done = 1; 336 done = statok = 1;
336 } else { 337 } else {
337 if (done++) 338 if (done)
338 return 0; 339 return 0;
340 done = 1;
339 statok = 0; 341 statok = 0;
340 } 342 }
341 if (bb_dump_skip) 343 if (bb_dump_skip)
@@ -350,8 +352,9 @@ static int next(char **argv)
350 352
351static unsigned char *get(void) 353static unsigned char *get(void)
352{ 354{
353 static int ateof = 1; 355 static smallint ateof = 1;
354 static unsigned char *curp=NULL, *savp; /*DBU:[dave@cray.com]initialize curp */ 356 static unsigned char *curp = NULL, *savp; /*DBU:[dave@cray.com]initialize curp */
357
355 int n; 358 int n;
356 int need, nread; 359 int need, nread;
357 unsigned char *tmpp; 360 unsigned char *tmpp;
@@ -399,7 +402,8 @@ static unsigned char *get(void)
399 if (bb_dump_length != -1) { 402 if (bb_dump_length != -1) {
400 bb_dump_length -= n; 403 bb_dump_length -= n;
401 } 404 }
402 if (!(need -= n)) { 405 need -= n;
406 if (!need) {
403 if (bb_dump_vflag == ALL || bb_dump_vflag == FIRST 407 if (bb_dump_vflag == ALL || bb_dump_vflag == FIRST
404 || memcmp(curp, savp, bb_dump_blocksize)) { 408 || memcmp(curp, savp, bb_dump_blocksize)) {
405 if (bb_dump_vflag == DUP || bb_dump_vflag == FIRST) { 409 if (bb_dump_vflag == DUP || bb_dump_vflag == FIRST) {
diff --git a/modutils/insmod.c b/modutils/insmod.c
index b9d8a0243..cba8dc4a0 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -3656,16 +3656,18 @@ static int obj_gpl_license(struct obj_file *f, const char **license)
3656static void set_tainted(struct obj_file *f, int fd, char *m_name, 3656static void set_tainted(struct obj_file *f, int fd, char *m_name,
3657 int kernel_has_tainted, int taint, const char *text1, const char *text2) 3657 int kernel_has_tainted, int taint, const char *text1, const char *text2)
3658{ 3658{
3659 static smallint printed_info;
3660
3659 char buf[80]; 3661 char buf[80];
3660 int oldval; 3662 int oldval;
3661 static int first = 1; 3663
3662 if (fd < 0 && !kernel_has_tainted) 3664 if (fd < 0 && !kernel_has_tainted)
3663 return; /* New modutils on old kernel */ 3665 return; /* New modutils on old kernel */
3664 printf("Warning: loading %s will taint the kernel: %s%s\n", 3666 printf("Warning: loading %s will taint the kernel: %s%s\n",
3665 m_name, text1, text2); 3667 m_name, text1, text2);
3666 if (first) { 3668 if (!printed_info) {
3667 printf(" See %s for information about tainted modules\n", TAINT_URL); 3669 printf(" See %s for information about tainted modules\n", TAINT_URL);
3668 first = 0; 3670 printed_info = 1;
3669 } 3671 }
3670 if (fd >= 0) { 3672 if (fd >= 0) {
3671 read(fd, buf, sizeof(buf)-1); 3673 read(fd, buf, sizeof(buf)-1);