mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
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
This commit is contained in:
parent
e0c83af4ce
commit
8211db5af0
@ -305,8 +305,6 @@ DECLARE(ush, d_buf, DIST_BUFSIZE);
|
|||||||
DECLARE(uch, window, 2L * WSIZE);
|
DECLARE(uch, window, 2L * WSIZE);
|
||||||
DECLARE(ush, tab_prefix, 1L << BITS);
|
DECLARE(ush, tab_prefix, 1L << BITS);
|
||||||
|
|
||||||
static int crc_table_empty = 1;
|
|
||||||
|
|
||||||
static int foreground; /* set if program run in foreground */
|
static int foreground; /* set if program run in foreground */
|
||||||
static int method = DEFLATED; /* compression method */
|
static int method = DEFLATED; /* compression method */
|
||||||
static int exit_code = OK; /* program exit code */
|
static int exit_code = OK; /* program exit code */
|
||||||
@ -387,14 +385,13 @@ static ulg updcrc(uch * s, unsigned n)
|
|||||||
register ulg c; /* temporary variable */
|
register ulg c; /* temporary variable */
|
||||||
static unsigned long crc_32_tab[256];
|
static unsigned long crc_32_tab[256];
|
||||||
|
|
||||||
if (crc_table_empty) {
|
if (crc_32_tab[1] == 0x00000000L) {
|
||||||
unsigned long csr; /* crc shift register */
|
unsigned long csr; /* crc shift register */
|
||||||
const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */
|
const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */
|
||||||
int i; /* counter for all possible eight bit values */
|
int i; /* counter for all possible eight bit values */
|
||||||
int k; /* byte being shifted into crc apparatus */
|
int k; /* byte being shifted into crc apparatus */
|
||||||
|
|
||||||
/* Compute table of CRC's. */
|
/* Compute table of CRC's. */
|
||||||
crc_32_tab[0] = 0x00000000L;
|
|
||||||
for (i = 1; i < 256; i++) {
|
for (i = 1; i < 256; i++) {
|
||||||
csr = i;
|
csr = i;
|
||||||
/* The idea to initialize the register with the byte instead of
|
/* The idea to initialize the register with the byte instead of
|
||||||
|
Loading…
Reference in New Issue
Block a user