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

Side by Side Diff: third_party/lzma/v4_65/files/C/7zCrc.c

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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/v4_65/files/C/7zCrc.h ('k') | third_party/lzma/v4_65/files/C/7zFile.h » ('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 -- CRC32 calculation
2 2008-08-05
3 Igor Pavlov
4 Public domain */
5
6 #include "7zCrc.h"
7
8 #define kCrcPoly 0xEDB88320
9 UInt32 g_CrcTable[256];
10
11 void MY_FAST_CALL CrcGenerateTable(void)
12 {
13 UInt32 i;
14 for (i = 0; i < 256; i++)
15 {
16 UInt32 r = i;
17 int j;
18 for (j = 0; j < 8; j++)
19 r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
20 g_CrcTable[i] = r;
21 }
22 }
23
24 UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
25 {
26 const Byte *p = (const Byte *)data;
27 for (; size > 0 ; size--, p++)
28 v = CRC_UPDATE_BYTE(v, *p);
29 return v;
30 }
31
32 UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
33 {
34 return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
35 }
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/C/7zCrc.h ('k') | third_party/lzma/v4_65/files/C/7zFile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698