#define local static
-/* Definitions for doing the crc four data bytes at a time. */
-#if !defined(NOBYFOUR) && defined(Z_U4)
-# define BYFOUR
-#endif
-#ifdef BYFOUR
- local unsigned long crc32_little (unsigned long, const unsigned char *, unsigned);
- local unsigned long crc32_big (unsigned long, const unsigned char *, unsigned);
-# define TBLS 8
-#else
-# define TBLS 1
-#endif /* BYFOUR */
+local unsigned long crc32_little (unsigned long, const unsigned char *, unsigned);
+local unsigned long crc32_big (unsigned long, const unsigned char *, unsigned);
/* Local functions for crc concatenation */
local unsigned long gf2_matrix_times (unsigned long *mat, unsigned long vec);
#ifdef DYNAMIC_CRC_TABLE
local volatile int crc_table_empty = 1;
-local z_crc_t crc_table[TBLS][256];
+local z_crc_t crc_table[8][256];
local void make_crc_table (void);
#ifdef MAKECRCH
local void write_table (FILE *, const z_crc_t *);
crc_table[0][n] = c;
}
-#ifdef BYFOUR
/* generate crc for each value followed by one, two, and three zeros,
and then the byte reversal of those as well as the first table */
for (n = 0; n < 256; n++) {
crc_table[k + 4][n] = ZSWAP32(c);
}
}
-#endif /* BYFOUR */
crc_table_empty = 0;
}
fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
fprintf(out, "local const z_crc_t ");
- fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
+ fprintf(out, "crc_table[8][256] =\n{\n {\n");
write_table(out, crc_table[0]);
-# ifdef BYFOUR
- fprintf(out, "#ifdef BYFOUR\n");
for (k = 1; k < 8; k++) {
fprintf(out, " },\n {\n");
write_table(out, crc_table[k]);
}
- fprintf(out, "#endif\n");
-# endif /* BYFOUR */
fprintf(out, " }\n};\n");
fclose(out);
}
make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
-#ifdef BYFOUR
if (sizeof(void *) == sizeof(ptrdiff_t)) {
z_crc_t endian;
else
return crc32_big(crc, buf, len);
}
-#endif /* BYFOUR */
crc = crc ^ 0xffffffffUL;
#ifdef CRC32_UNROLL_LESS
return crc ^ 0xffffffffUL;
}
-#ifdef BYFOUR
/* ========================================================================= */
#define DOLIT4 c ^= *buf4++; \
return (unsigned long)(ZSWAP32(c));
}
-#endif /* BYFOUR */
#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
* Generated automatically by crc32.c
*/
-local const z_crc_t crc_table[TBLS][256] =
+local const z_crc_t crc_table[8][256] =
{
{
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
0x2d02ef8dUL
-#ifdef BYFOUR
},
{
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
0xf10605deUL
-#endif
}
};