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

Side by Side Diff: xz/debug/crc32.c

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « xz/debug/README ('k') | xz/debug/full_flush.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file crc32.c
4 /// \brief Primitive CRC32 calculation tool
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #include "sysdefs.h"
14 #include "lzma.h"
15 #include <stdio.h>
16
17
18 int
19 main(void)
20 {
21 uint32_t crc = 0;
22
23 do {
24 uint8_t buf[BUFSIZ];
25 const size_t size = fread(buf, 1, sizeof(buf), stdin);
26 crc = lzma_crc32(buf, size, crc);
27 } while (!ferror(stdin) && !feof(stdin));
28
29 //printf("%08" PRIX32 "\n", crc);
30
31 // I want it little endian so it's easy to work with hex editor.
32 printf("%02" PRIX32 " ", crc & 0xFF);
33 printf("%02" PRIX32 " ", (crc >> 8) & 0xFF);
34 printf("%02" PRIX32 " ", (crc >> 16) & 0xFF);
35 printf("%02" PRIX32 " ", crc >> 24);
36 printf("\n");
37
38 return 0;
39 }
OLDNEW
« no previous file with comments | « xz/debug/README ('k') | xz/debug/full_flush.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698