config.tests/mac/crc/main.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/config.tests/mac/crc/main.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/config.tests/mac/crc/main.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -71,7 +71,7 @@
         for(int iCodes = 0; iCodes <= 0xFF; iCodes++) {
             ulTable[iCodes] = Reflect(iCodes, 8) << 24;
             for(int iPos = 0; iPos < 8; iPos++) {
-                ulTable[iCodes] = (ulTable[iCodes] << 1)
+                ulTable[iCodes] = ((ulTable[iCodes] << 1) & 0xffffffff)
                     ^ ((ulTable[iCodes] & (1 << 31)) ? ulPolynomial : 0);
             }
 
@@ -84,7 +84,7 @@
         // Swap bit 0 for bit 7, bit 1 For bit 6, etc....
         for(int iPos = 1; iPos < (cChar + 1); iPos++) {
             if(ulReflect & 1) {
-                ulValue |= (1 << (cChar - iPos));
+                ulValue |= (1ul << (cChar - iPos));
             }
             ulReflect >>= 1;
         }