1.1 --- a/src/test/SDL_test_crc32.c Sat May 18 12:48:50 2013 -0700
1.2 +++ b/src/test/SDL_test_crc32.c Sat May 18 14:17:52 2013 -0700
1.3 @@ -21,7 +21,7 @@
1.4
1.5 /*
1.6
1.7 - Used by the test execution component.
1.8 + Used by the test execution component.
1.9 Original source code contributed by A. Schiffler for GSOC project.
1.10
1.11 */
1.12 @@ -39,10 +39,10 @@
1.13 /* Sanity check context pointer */
1.14 if (crcContext==NULL) {
1.15 return -1;
1.16 - }
1.17 -
1.18 + }
1.19 +
1.20 /*
1.21 - * Build auxiliary table for parallel byte-at-a-time CRC-32
1.22 + * Build auxiliary table for parallel byte-at-a-time CRC-32
1.23 */
1.24 #ifdef ORIGINAL_METHOD
1.25 for (i = 0; i < 256; ++i) {
1.26 @@ -64,7 +64,7 @@
1.27 crcContext->crc32_table[i] = c;
1.28 }
1.29 #endif
1.30 -
1.31 +
1.32 return 0;
1.33 }
1.34
1.35 @@ -75,15 +75,15 @@
1.36 if (SDLTest_Crc32CalcStart(crcContext,crc32)) {
1.37 return -1;
1.38 }
1.39 -
1.40 +
1.41 if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) {
1.42 return -1;
1.43 }
1.44 -
1.45 +
1.46 if (SDLTest_Crc32CalcEnd(crcContext, crc32)) {
1.47 return -1;
1.48 }
1.49 -
1.50 +
1.51 return 0;
1.52 }
1.53
1.54 @@ -95,10 +95,10 @@
1.55 if (crcContext==NULL) {
1.56 *crc32=0;
1.57 return -1;
1.58 - }
1.59 + }
1.60
1.61 /*
1.62 - * Preload shift register, per CRC-32 spec
1.63 + * Preload shift register, per CRC-32 spec
1.64 */
1.65 *crc32 = 0xffffffff;
1.66
1.67 @@ -113,10 +113,10 @@
1.68 if (crcContext==NULL) {
1.69 *crc32=0;
1.70 return -1;
1.71 - }
1.72 -
1.73 + }
1.74 +
1.75 /*
1.76 - * Return complement, per CRC-32 spec
1.77 + * Return complement, per CRC-32 spec
1.78 */
1.79 *crc32 = (~(*crc32));
1.80
1.81 @@ -134,24 +134,24 @@
1.82 *crc32=0;
1.83 return -1;
1.84 }
1.85 -
1.86 +
1.87 if (inBuf==NULL) {
1.88 return -1;
1.89 }
1.90
1.91 /*
1.92 - * Calculate CRC from data
1.93 + * Calculate CRC from data
1.94 */
1.95 crc = *crc32;
1.96 for (p = inBuf; inLen > 0; ++p, --inLen) {
1.97 -#ifdef ORIGINAL_METHOD
1.98 +#ifdef ORIGINAL_METHOD
1.99 crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p];
1.100 #else
1.101 crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ];
1.102 -#endif
1.103 - }
1.104 +#endif
1.105 + }
1.106 *crc32 = crc;
1.107 -
1.108 +
1.109 return 0;
1.110 }
1.111
1.112 @@ -159,7 +159,7 @@
1.113 {
1.114 if (crcContext==NULL) {
1.115 return -1;
1.116 - }
1.117 + }
1.118
1.119 return 0;
1.120 }