File style cleanup for the SDL 2.0 release

This commit is contained in:
Sam Lantinga 2013-05-18 14:17:52 -07:00
parent 2ac8624930
commit 0cb6385637
376 changed files with 17562 additions and 17773 deletions

View file

@ -21,7 +21,7 @@
/*
Used by the test execution component.
Used by the test execution component.
Original source code contributed by A. Schiffler for GSOC project.
*/
@ -39,10 +39,10 @@ int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
/* Sanity check context pointer */
if (crcContext==NULL) {
return -1;
}
}
/*
* Build auxiliary table for parallel byte-at-a-time CRC-32
* Build auxiliary table for parallel byte-at-a-time CRC-32
*/
#ifdef ORIGINAL_METHOD
for (i = 0; i < 256; ++i) {
@ -64,7 +64,7 @@ int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
crcContext->crc32_table[i] = c;
}
#endif
return 0;
}
@ -75,15 +75,15 @@ int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUin
if (SDLTest_Crc32CalcStart(crcContext,crc32)) {
return -1;
}
if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) {
return -1;
}
if (SDLTest_Crc32CalcEnd(crcContext, crc32)) {
return -1;
}
return 0;
}
@ -95,10 +95,10 @@ int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32)
if (crcContext==NULL) {
*crc32=0;
return -1;
}
}
/*
* Preload shift register, per CRC-32 spec
* Preload shift register, per CRC-32 spec
*/
*crc32 = 0xffffffff;
@ -113,10 +113,10 @@ int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32)
if (crcContext==NULL) {
*crc32=0;
return -1;
}
}
/*
* Return complement, per CRC-32 spec
* Return complement, per CRC-32 spec
*/
*crc32 = (~(*crc32));
@ -134,24 +134,24 @@ int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf,
*crc32=0;
return -1;
}
if (inBuf==NULL) {
return -1;
}
/*
* Calculate CRC from data
* Calculate CRC from data
*/
crc = *crc32;
for (p = inBuf; inLen > 0; ++p, --inLen) {
#ifdef ORIGINAL_METHOD
#ifdef ORIGINAL_METHOD
crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p];
#else
crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ];
#endif
}
#endif
}
*crc32 = crc;
return 0;
}
@ -159,7 +159,7 @@ int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext)
{
if (crcContext==NULL) {
return -1;
}
}
return 0;
}