2 #include "../precompiled.h"
10 #define CRC32_INIT_VALUE 0xffffffffL
11 #define CRC32_XOR_VALUE 0xffffffffL
13 #ifdef CREATE_CRC_TABLE
15 static unsigned long crctable[256];
42 void make_crc_table(
void ) {
44 unsigned long c,
poly;
46 static const byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
50 for ( i = 0; i <
sizeof(
p ) /
sizeof(
byte ); i++ ) {
51 poly |= 1
L << ( 31 - p[
i] );
54 for ( i = 0; i < 256; i++ ) {
56 for ( j = 0; j < 8; j++ ) {
57 c = ( c & 1 ) ? poly ^ ( c >> 1 ) : ( c >> 1 );
68 static unsigned long crctable[256] = {
69 0x00000000
L, 0x77073096
L, 0xee0e612c
L, 0x990951ba
L,
70 0x076dc419
L, 0x706af48f
L, 0xe963a535
L, 0x9e6495a3
L,
71 0x0edb8832
L, 0x79dcb8a4
L, 0xe0d5e91e
L, 0x97d2d988
L,
72 0x09b64c2b
L, 0x7eb17cbd
L, 0xe7b82d07
L, 0x90bf1d91
L,
73 0x1db71064
L, 0x6ab020f2
L, 0xf3b97148
L, 0x84be41de
L,
74 0x1adad47d
L, 0x6ddde4eb
L, 0xf4d4b551
L, 0x83d385c7
L,
75 0x136c9856
L, 0x646ba8c0
L, 0xfd62f97a
L, 0x8a65c9ec
L,
76 0x14015c4f
L, 0x63066cd9
L, 0xfa0f3d63
L, 0x8d080df5
L,
77 0x3b6e20c8
L, 0x4c69105e
L, 0xd56041e4
L, 0xa2677172
L,
78 0x3c03e4d1
L, 0x4b04d447
L, 0xd20d85fd
L, 0xa50ab56b
L,
79 0x35b5a8fa
L, 0x42b2986c
L, 0xdbbbc9d6
L, 0xacbcf940
L,
80 0x32d86ce3
L, 0x45df5c75
L, 0xdcd60dcf
L, 0xabd13d59
L,
81 0x26d930ac
L, 0x51de003a
L, 0xc8d75180
L, 0xbfd06116
L,
82 0x21b4f4b5
L, 0x56b3c423
L, 0xcfba9599
L, 0xb8bda50f
L,
83 0x2802b89e
L, 0x5f058808
L, 0xc60cd9b2
L, 0xb10be924
L,
84 0x2f6f7c87
L, 0x58684c11
L, 0xc1611dab
L, 0xb6662d3d
L,
85 0x76dc4190
L, 0x01db7106
L, 0x98d220bc
L, 0xefd5102a
L,
86 0x71b18589
L, 0x06b6b51f
L, 0x9fbfe4a5
L, 0xe8b8d433
L,
87 0x7807c9a2
L, 0x0f00f934
L, 0x9609a88e
L, 0xe10e9818
L,
88 0x7f6a0dbb
L, 0x086d3d2d
L, 0x91646c97
L, 0xe6635c01
L,
89 0x6b6b51f4
L, 0x1c6c6162
L, 0x856530d8
L, 0xf262004e
L,
90 0x6c0695ed
L, 0x1b01a57b
L, 0x8208f4c1
L, 0xf50fc457
L,
91 0x65b0d9c6
L, 0x12b7e950
L, 0x8bbeb8ea
L, 0xfcb9887c
L,
92 0x62dd1ddf
L, 0x15da2d49
L, 0x8cd37cf3
L, 0xfbd44c65
L,
93 0x4db26158
L, 0x3ab551ce
L, 0xa3bc0074
L, 0xd4bb30e2
L,
94 0x4adfa541
L, 0x3dd895d7
L, 0xa4d1c46d
L, 0xd3d6f4fb
L,
95 0x4369e96a
L, 0x346ed9fc
L, 0xad678846
L, 0xda60b8d0
L,
96 0x44042d73
L, 0x33031de5
L, 0xaa0a4c5f
L, 0xdd0d7cc9
L,
97 0x5005713c
L, 0x270241aa
L, 0xbe0b1010
L, 0xc90c2086
L,
98 0x5768b525
L, 0x206f85b3
L, 0xb966d409
L, 0xce61e49f
L,
99 0x5edef90e
L, 0x29d9c998
L, 0xb0d09822
L, 0xc7d7a8b4
L,
100 0x59b33d17
L, 0x2eb40d81
L, 0xb7bd5c3b
L, 0xc0ba6cad
L,
101 0xedb88320
L, 0x9abfb3b6
L, 0x03b6e20c
L, 0x74b1d29a
L,
102 0xead54739
L, 0x9dd277af
L, 0x04db2615
L, 0x73dc1683
L,
103 0xe3630b12
L, 0x94643b84
L, 0x0d6d6a3e
L, 0x7a6a5aa8
L,
104 0xe40ecf0b
L, 0x9309ff9d
L, 0x0a00ae27
L, 0x7d079eb1
L,
105 0xf00f9344
L, 0x8708a3d2
L, 0x1e01f268
L, 0x6906c2fe
L,
106 0xf762575d
L, 0x806567cb
L, 0x196c3671
L, 0x6e6b06e7
L,
107 0xfed41b76
L, 0x89d32be0
L, 0x10da7a5a
L, 0x67dd4acc
L,
108 0xf9b9df6f
L, 0x8ebeeff9
L, 0x17b7be43
L, 0x60b08ed5
L,
109 0xd6d6a3e8
L, 0xa1d1937e
L, 0x38d8c2c4
L, 0x4fdff252
L,
110 0xd1bb67f1
L, 0xa6bc5767
L, 0x3fb506dd
L, 0x48b2364b
L,
111 0xd80d2bda
L, 0xaf0a1b4c
L, 0x36034af6
L, 0x41047a60
L,
112 0xdf60efc3
L, 0xa867df55
L, 0x316e8eef
L, 0x4669be79
L,
113 0xcb61b38c
L, 0xbc66831a
L, 0x256fd2a0
L, 0x5268e236
L,
114 0xcc0c7795
L, 0xbb0b4703
L, 0x220216b9
L, 0x5505262f
L,
115 0xc5ba3bbe
L, 0xb2bd0b28
L, 0x2bb45a92
L, 0x5cb36a04
L,
116 0xc2d7ffa7
L, 0xb5d0cf31
L, 0x2cd99e8b
L, 0x5bdeae1d
L,
117 0x9b64c2b0
L, 0xec63f226
L, 0x756aa39c
L, 0x026d930a
L,
118 0x9c0906a9
L, 0xeb0e363f
L, 0x72076785
L, 0x05005713
L,
119 0x95bf4a82
L, 0xe2b87a14
L, 0x7bb12bae
L, 0x0cb61b38
L,
120 0x92d28e9b
L, 0xe5d5be0d
L, 0x7cdcefb7
L, 0x0bdbdf21
L,
121 0x86d3d2d4
L, 0xf1d4e242
L, 0x68ddb3f8
L, 0x1fda836e
L,
122 0x81be16cd
L, 0xf6b9265b
L, 0x6fb077e1
L, 0x18b74777
L,
123 0x88085ae6
L, 0xff0f6a70
L, 0x66063bca
L, 0x11010b5c
L,
124 0x8f659eff
L, 0xf862ae69
L, 0x616bffd3
L, 0x166ccf45
L,
125 0xa00ae278
L, 0xd70dd2ee
L, 0x4e048354
L, 0x3903b3c2
L,
126 0xa7672661
L, 0xd06016f7
L, 0x4969474d
L, 0x3e6e77db
L,
127 0xaed16a4a
L, 0xd9d65adc
L, 0x40df0b66
L, 0x37d83bf0
L,
128 0xa9bcae53
L, 0xdebb9ec5
L, 0x47b2cf7f
L, 0x30b5ffe9
L,
129 0xbdbdf21c
L, 0xcabac28a
L, 0x53b39330
L, 0x24b4a3a6
L,
130 0xbad03605
L, 0xcdd70693
L, 0x54de5729
L, 0x23d967bf
L,
131 0xb3667a2e
L, 0xc4614ab8
L, 0x5d681b02
L, 0x2a6f2b94
L,
132 0xb40bbe37
L, 0xc30c8ea1
L, 0x5a05df1b
L, 0x2d02ef8dL
142 crcvalue = crctable[ ( crcvalue ^
data ) & 0xff ] ^ ( crcvalue >> 8 );
147 const unsigned char *buf = (
const unsigned char *) data;
151 crc = crctable[ ( crc ^ ( *buf++ ) ) & 0xff ] ^ ( crc >> 8 );
unsigned long CRC32_BlockChecksum(const void *data, int length)
void CRC32_Update(unsigned long &crcvalue, const byte data)
void CRC32_InitChecksum(unsigned long &crcvalue)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void CRC32_UpdateChecksum(unsigned long &crcvalue, const void *data, int length)
void CRC32_FinishChecksum(unsigned long &crcvalue)
GLsizei const GLcharARB const GLint * length