Changeset 83461 in webkit
- Timestamp:
- Apr 11, 2011 11:36:13 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r83416 r83461 1 2011-04-11 Tony Chang <tony@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 fix crc computation on 64 bit machines 6 https://bugs.webkit.org/show_bug.cgi?id=58243 7 8 unsigned long is dependenct on CPU architecture, so use unsigned which is always 32 bits 9 10 * DumpRenderTree/CyclicRedundancyCheck.cpp: 11 (makeCrcTable): 12 (computeCrc): 13 * DumpRenderTree/CyclicRedundancyCheck.h: 14 * DumpRenderTree/PixelDumpSupport.cpp: 15 (appendIntToVector): 16 (convertChecksumToPNGComment): 17 1 18 2011-04-10 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com> 2 19 -
trunk/Tools/DumpRenderTree/CyclicRedundancyCheck.cpp
r83219 r83461 34 34 #include <wtf/Vector.h> 35 35 36 static void makeCrcTable(unsigned longcrcTable[256])36 static void makeCrcTable(unsigned crcTable[256]) 37 37 { 38 for (unsigned longi = 0; i < 256; i++) {39 unsigned longc = i;38 for (unsigned i = 0; i < 256; i++) { 39 unsigned c = i; 40 40 for (int k = 0; k < 8; k++) { 41 41 if (c & 1) … … 48 48 } 49 49 50 unsigned longcomputeCrc(const Vector<unsigned char>& buffer)50 unsigned computeCrc(const Vector<unsigned char>& buffer) 51 51 { 52 static unsigned longcrcTable[256];52 static unsigned crcTable[256]; 53 53 static bool crcTableComputed = false; 54 54 if (!crcTableComputed) { … … 57 57 } 58 58 59 unsigned longcrc = 0xffffffffL;59 unsigned crc = 0xffffffffL; 60 60 for (size_t i = 0; i < buffer.size(); ++i) 61 61 crc = crcTable[(crc ^ buffer[i]) & 0xff] ^ ((crc >> 8) & 0x00ffffffL); -
trunk/Tools/DumpRenderTree/CyclicRedundancyCheck.h
r83219 r83461 34 34 #include <wtf/Vector.h> 35 35 36 unsigned longcomputeCrc(const Vector<unsigned char>&);36 unsigned computeCrc(const Vector<unsigned char>&); 37 37 38 38 #endif -
trunk/Tools/DumpRenderTree/PixelDumpSupport.cpp
r83219 r83461 75 75 } 76 76 77 static void appendIntToVector( intnumber, Vector<unsigned char>& vector)77 static void appendIntToVector(unsigned number, Vector<unsigned char>& vector) 78 78 { 79 79 size_t offset = vector.size(); … … 98 98 dataToCrc.append(textCommentPrefix + 4, prefixLength - 4); // Don't include the chunk length in the crc. 99 99 dataToCrc.append(checksum, checksumLength); 100 unsigned longcrc32 = computeCrc(dataToCrc);100 unsigned crc32 = computeCrc(dataToCrc); 101 101 102 102 appendIntToVector(crc32, bytesToAdd);
Note: See TracChangeset
for help on using the changeset viewer.