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

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

Issue 6730044: Upgrading lzma_sdk to version 9.20. Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 9 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.h ('k') | third_party/lzma_sdk/7zFormat.txt » ('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 /* 7zCrc.c */
2
3 #include "7zCrc.h"
4
5 #define kCrcPoly 0xEDB88320
6 UInt32 g_CrcTable[256];
7
8 void MY_FAST_CALL CrcGenerateTable()
9 {
10 UInt32 i;
11 for (i = 0; i < 256; i++)
12 {
13 UInt32 r = i;
14 int j;
15 for (j = 0; j < 8; j++)
16 r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
17 g_CrcTable[i] = r;
18 }
19 }
20
21 UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
22 {
23 const Byte *p = (const Byte *)data;
24 for (; size > 0 ; size--, p++)
25 v = CRC_UPDATE_BYTE(v, *p);
26 return v;
27 }
28
29 UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
30 {
31 return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
32 }
OLDNEW
« no previous file with comments | « third_party/lzma_sdk/7zCrc.h ('k') | third_party/lzma_sdk/7zFormat.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698