Go to the documentation of this file.
29 #include "SDL_config.h"
40 if (crcContext==
NULL) {
47 #ifdef ORIGINAL_METHOD
48 for (
i = 0;
i < 256; ++
i) {
49 for (
c =
i << 24,
j = 8;
j > 0; --
j) {
55 for (
i=0;
i<256;
i++) {
94 if (crcContext==
NULL) {
112 if (crcContext==
NULL) {
120 *crc32 = (~(*crc32));
132 if (crcContext==
NULL) {
145 for (
p = inBuf; inLen > 0; ++
p, --inLen) {
146 #ifdef ORIGINAL_METHOD
147 crc = (crc << 8) ^ crcContext->
crc32_table[(crc >> 24) ^ *
p];
149 crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->
crc32_table[ (crc ^ *
p) & 0xFF ];
159 if (crcContext==
NULL) {
int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
Initialize the CRC context.
int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
int SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
calculate a crc32 from a data block
CrcUint32 crc32_table[256]
int SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext)
clean up CRC context
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
int SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)