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

Side by Side Diff: courgette/crc.cc

Issue 1543643002: Switch to standard integer types in courgette/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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 | « courgette/crc.h ('k') | courgette/difference_estimator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "courgette/crc.h" 5 #include "courgette/crc.h"
6 6
7 #include <stdint.h>
8 #include <stddef.h>
9
7 #ifdef COURGETTE_USE_CRC_LIB 10 #ifdef COURGETTE_USE_CRC_LIB
8 # include "zlib.h" 11 # include "zlib.h"
9 #else 12 #else
10 extern "C" { 13 extern "C" {
11 # include "third_party/lzma_sdk/7zCrc.h" 14 # include "third_party/lzma_sdk/7zCrc.h"
12 } 15 }
13 #endif 16 #endif
14 17
15 #include "base/basictypes.h"
16 18
17 namespace courgette { 19 namespace courgette {
18 20
19 uint32 CalculateCrc(const uint8* buffer, size_t size) { 21 uint32_t CalculateCrc(const uint8_t* buffer, size_t size) {
20 uint32 crc; 22 uint32_t crc;
21 23
22 #ifdef COURGETTE_USE_CRC_LIB 24 #ifdef COURGETTE_USE_CRC_LIB
23 // Calculate Crc by calling CRC method in zlib 25 // Calculate Crc by calling CRC method in zlib
24 crc = crc32(0, buffer, size); 26 crc = crc32(0, buffer, size);
25 #else 27 #else
26 // Calculate Crc by calling CRC method in LZMA SDK 28 // Calculate Crc by calling CRC method in LZMA SDK
27 CrcGenerateTable(); 29 CrcGenerateTable();
28 crc = CrcCalc(buffer, size); 30 crc = CrcCalc(buffer, size);
29 #endif 31 #endif
30 32
31 return ~crc; 33 return ~crc;
32 } 34 }
33 35
34 } // namespace 36 } // namespace
OLDNEW
« no previous file with comments | « courgette/crc.h ('k') | courgette/difference_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698