26 # ifndef DYNAMIC_CRC_TABLE 27 # define DYNAMIC_CRC_TABLE 34 #if !defined(NOBYFOUR) && defined(Z_U4) 38 local unsigned long crc32_little
OF((
unsigned long,
40 local unsigned long crc32_big
OF((
unsigned long,
54 #ifdef DYNAMIC_CRC_TABLE 56 local volatile int crc_table_empty = 1;
58 local void make_crc_table
OF((
void));
88 local void make_crc_table()
94 static volatile int first = 1;
95 static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
105 for (
n = 0;
n < (
int)(
sizeof(
p)/
sizeof(
unsigned char));
n++)
109 for (
n = 0;
n < 256;
n++) {
111 for (
k = 0;
k < 8;
k++)
112 c =
c & 1 ? poly ^ (
c >> 1) :
c >> 1;
119 for (
n = 0;
n < 256;
n++) {
122 for (
k = 1;
k < 4;
k++) {
134 while (crc_table_empty)
145 fprintf(
out,
"/* crc32.h -- tables for rapid CRC calculation\n");
146 fprintf(
out,
" * Generated automatically by crc32.c\n */\n\n");
148 fprintf(
out,
"crc_table[TBLS][256] =\n{\n {\n");
152 for (
k = 1;
k < 8;
k++) {
171 for (
n = 0;
n < 256;
n++)
173 (
unsigned long)(
table[
n]),
174 n == 255 ?
"\n" : (
n % 5 == 4 ?
",\n" :
", "));
190 #ifdef DYNAMIC_CRC_TABLE 198 #define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) 199 #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 204 const unsigned char FAR *
buf;
209 #ifdef DYNAMIC_CRC_TABLE 215 if (
sizeof(
void *) ==
sizeof(
ptrdiff_t)) {
219 if (*((
unsigned char *)(&endian)))
220 return crc32_little(crc,
buf,
len);
222 return crc32_big(crc,
buf,
len);
225 crc = crc ^ 0xffffffff
UL;
233 return crc ^ 0xffffffff
UL;
239 const unsigned char FAR *
buf;
260 #define DOLIT4 c ^= *buf4++; \ 261 c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ 262 crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] 263 #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 268 const unsigned char FAR *
buf;
290 buf = (
const unsigned char FAR *)buf4;
296 return (
unsigned long)
c;
300 #define DOBIG4 c ^= *buf4++; \ 301 c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ 302 crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] 303 #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 308 const unsigned char FAR *
buf;
330 buf = (
const unsigned char FAR *)buf4;
362 unsigned long *square;
387 odd[0] = 0xedb88320
UL;
uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2)
uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2)
GLenum GLsizei GLenum GLenum const GLvoid * table
unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
GLenum GLuint GLenum GLsizei const GLchar * buf
const z_crc_t FAR crc_table[TBLS][256]
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
unsigned long gf2_matrix_times(unsigned long *mat, unsigned long vec)
static int sum(int x_, int y_)
uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
const z_crc_t FAR *ZEXPORT get_crc_table()
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
__kernel_ptrdiff_t ptrdiff_t
unsigned long gf2_matrix_times OF((unsigned long *mat, unsigned long vec))
void gf2_matrix_square(unsigned long *square, unsigned long *mat)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *