[BusyBox-cvs] busybox/archival gzip.c,1.60,1.61

Erik Andersen andersen at busybox.net
Fri Nov 14 02:44:32 UTC 2003


Update of /var/cvs/busybox/archival
In directory winder:/tmp/cvs-serv31637/archival

Modified Files:
	gzip.c 
Log Message:
Vladimir N. Oleynik (vodz) writes:

Hi Glenn.

I analysed BSS size gzip applet and found may be mistake:
updcrc() checking  if (crc_table_empty) but not resetted this var.
This do make slow gzip applet ;-)


--w
vodz



Index: gzip.c
===================================================================
RCS file: /var/cvs/busybox/archival/gzip.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- gzip.c	14 Jul 2003 21:20:40 -0000	1.60
+++ gzip.c	14 Nov 2003 02:44:28 -0000	1.61
@@ -305,8 +305,6 @@
 DECLARE(uch, window, 2L * WSIZE);
 DECLARE(ush, tab_prefix, 1L << BITS);
 
-static int crc_table_empty = 1;
-
 static int foreground;	/* set if program run in foreground */
 static int method = DEFLATED;	/* compression method */
 static int exit_code = OK;	/* program exit code */
@@ -387,14 +385,13 @@
 	register ulg c;		/* temporary variable */
 	static unsigned long crc_32_tab[256];
 
-	if (crc_table_empty) {
+	if (crc_32_tab[1] == 0x00000000L) {
 		unsigned long csr;	/* crc shift register */
 		const unsigned long e = 0xedb88320L;	/* polynomial exclusive-or pattern */
 		int i;			/* counter for all possible eight bit values */
 		int k;			/* byte being shifted into crc apparatus */
 
 		/* Compute table of CRC's. */
-		crc_32_tab[0] = 0x00000000L;
 		for (i = 1; i < 256; i++) {
 			csr = i;
 			/* The idea to initialize the register with the byte instead of




More information about the busybox-cvs mailing list