Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Side by Side Diff: third_party/lzma_sdk/7zCrcOpt.c

Issue 10152012: Second attempt to update lzma_sdk to 9.20 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/lzma_sdk/7zCrc.c ('k') | third_party/lzma_sdk/7zDec.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* 7zCrcOpt.c -- CRC32 calculation : optimized version
2 2009-11-23 : Igor Pavlov : Public domain */
3
4 #include "CpuArch.h"
5
6 #ifdef MY_CPU_LE
7
8 #define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
9
10 UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const U Int32 *table)
11 {
12 const Byte *p = (const Byte *)data;
13 for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
14 v = CRC_UPDATE_BYTE_2(v, *p);
15 for (; size >= 4; size -= 4, p += 4)
16 {
17 v ^= *(const UInt32 *)p;
18 v =
19 table[0x300 + (v & 0xFF)] ^
20 table[0x200 + ((v >> 8) & 0xFF)] ^
21 table[0x100 + ((v >> 16) & 0xFF)] ^
22 table[0x000 + ((v >> 24))];
23 }
24 for (; size > 0; size--, p++)
25 v = CRC_UPDATE_BYTE_2(v, *p);
26 return v;
27 }
28
29 UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const U Int32 *table)
30 {
31 return CrcUpdateT4(v, data, size, table);
32 }
33
34 #endif
OLDNEW
« no previous file with comments | « third_party/lzma_sdk/7zCrc.c ('k') | third_party/lzma_sdk/7zDec.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698