svn commit: trunk/busybox: archival coreutils libbb modutils

vda at busybox.net vda at busybox.net
Thu Jun 21 12:43:45 UTC 2007


Author: vda
Date: 2007-06-21 05:43:45 -0700 (Thu, 21 Jun 2007)
New Revision: 18880

Log:
random shrinkage of statics, -60 bytes saved



Modified:
   trunk/busybox/Makefile.custom
   trunk/busybox/Makefile.flags
   trunk/busybox/archival/tar.c
   trunk/busybox/coreutils/fold.c
   trunk/busybox/libbb/dump.c
   trunk/busybox/modutils/insmod.c


Changeset:
Modified: trunk/busybox/Makefile.custom
===================================================================
--- trunk/busybox/Makefile.custom	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/Makefile.custom	2007-06-21 12:43:45 UTC (rev 18880)
@@ -67,6 +67,7 @@
 .PHONY: bloatcheck
 bloatcheck: busybox_old busybox_unstripped
 	@$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
+	@$(CROSS_COMPILE)size busybox_old busybox_unstripped
 
 .PHONY: baseline
 baseline: busybox_unstripped

Modified: trunk/busybox/Makefile.flags
===================================================================
--- trunk/busybox/Makefile.flags	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/Makefile.flags	2007-06-21 12:43:45 UTC (rev 18880)
@@ -79,6 +79,6 @@
 endif
 
 # Busybox is a stack-fatty so make sure we increase default size
-# TODO: use "make stksizes" to find & fix big stack users; should
-#       just steal scripts/checkstack.pl from the kernel ...
+# TODO: use "make stksizes" to find & fix big stack users
+# (we stole scripts/checkstack.pl from the kernel... thanks guys!)
 FLTFLAGS += -s 20000

Modified: trunk/busybox/archival/tar.c
===================================================================
--- trunk/busybox/archival/tar.c	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/archival/tar.c	2007-06-21 12:43:45 UTC (rev 18880)
@@ -417,11 +417,11 @@
 
 	header_name = fileName;
 	while (header_name[0] == '/') {
-		static int alreadyWarned = FALSE;
+		static smallint warned;
 
-		if (alreadyWarned == FALSE) {
+		if (!warned) {
 			bb_error_msg("removing leading '/' from member names");
-			alreadyWarned = TRUE;
+			warned = 1;
 		}
 		header_name++;
 	}

Modified: trunk/busybox/coreutils/fold.c
===================================================================
--- trunk/busybox/coreutils/fold.c	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/coreutils/fold.c	2007-06-21 12:43:45 UTC (rev 18880)
@@ -41,6 +41,8 @@
 int fold_main(int argc, char **argv);
 int fold_main(int argc, char **argv)
 {
+	char *line_out = NULL;
+	int allocated_out = 0;
 	char *w_opt;
 	int width = 80;
 	int i;
@@ -75,8 +77,6 @@
 		int c;
 		int column = 0;		/* Screen column where next char will go. */
 		int offset_out = 0;	/* Index in `line_out' for next char. */
-		static char *line_out = NULL;
-		static int allocated_out = 0;
 
 		if (istream == NULL) {
 			errs |= EXIT_FAILURE;
@@ -95,8 +95,7 @@
 				column = offset_out = 0;
 				continue;
 			}
-
-rescan:
+ rescan:
 			column = adjust_column(column, c);
 
 			if (column > width) {

Modified: trunk/busybox/libbb/dump.c
===================================================================
--- trunk/busybox/libbb/dump.c	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/libbb/dump.c	2007-06-21 12:43:45 UTC (rev 18880)
@@ -317,7 +317,8 @@
 
 static int next(char **argv)
 {
-	static int done;
+	static smallint done;
+
 	int statok;
 
 	if (argv) {
@@ -332,10 +333,11 @@
 				++_argv;
 				continue;
 			}
-			statok = done = 1;
+			done = statok = 1;
 		} else {
-			if (done++)
+			if (done)
 				return 0;
+			done = 1;
 			statok = 0;
 		}
 		if (bb_dump_skip)
@@ -350,8 +352,9 @@
 
 static unsigned char *get(void)
 {
-	static int ateof = 1;
-	static unsigned char *curp=NULL, *savp; /*DBU:[dave at cray.com]initialize curp */
+	static smallint ateof = 1;
+	static unsigned char *curp = NULL, *savp; /*DBU:[dave at cray.com]initialize curp */
+
 	int n;
 	int need, nread;
 	unsigned char *tmpp;
@@ -399,7 +402,8 @@
 		if (bb_dump_length != -1) {
 			bb_dump_length -= n;
 		}
-		if (!(need -= n)) {
+		need -= n;
+		if (!need) {
 			if (bb_dump_vflag == ALL || bb_dump_vflag == FIRST
 				|| memcmp(curp, savp, bb_dump_blocksize)) {
 				if (bb_dump_vflag == DUP || bb_dump_vflag == FIRST) {

Modified: trunk/busybox/modutils/insmod.c
===================================================================
--- trunk/busybox/modutils/insmod.c	2007-06-21 12:41:59 UTC (rev 18879)
+++ trunk/busybox/modutils/insmod.c	2007-06-21 12:43:45 UTC (rev 18880)
@@ -3656,16 +3656,18 @@
 static void set_tainted(struct obj_file *f, int fd, char *m_name,
 		int kernel_has_tainted, int taint, const char *text1, const char *text2)
 {
+	static smallint printed_info;
+
 	char buf[80];
 	int oldval;
-	static int first = 1;
+
 	if (fd < 0 && !kernel_has_tainted)
 		return;		/* New modutils on old kernel */
 	printf("Warning: loading %s will taint the kernel: %s%s\n",
 			m_name, text1, text2);
-	if (first) {
+	if (!printed_info) {
 		printf("  See %s for information about tainted modules\n", TAINT_URL);
-		first = 0;
+		printed_info = 1;
 	}
 	if (fd >= 0) {
 		read(fd, buf, sizeof(buf)-1);




More information about the busybox-cvs mailing list