Line 0
Link Here
|
|
|
1 |
--- src/crc32c_read_le.h.orig 2019-07-24 07:21:23 UTC |
2 |
+++ src/crc32c_read_le.h |
3 |
@@ -30,14 +30,14 @@ inline uint32_t ReadUint32LE(const uint8_t* buffer) { |
4 |
// Reads a little-endian 64-bit integer from a 64-bit-aligned buffer. |
5 |
inline uint64_t ReadUint64LE(const uint8_t* buffer) { |
6 |
#if BYTE_ORDER_BIG_ENDIAN |
7 |
- return ((static_cast<uint32_t>(static_cast<uint8_t>(buffer[0]))) | |
8 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[1])) << 8) | |
9 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[2])) << 16) | |
10 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[3])) << 24) | |
11 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[4])) << 32) | |
12 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[5])) << 40) | |
13 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[6])) << 48) | |
14 |
- (static_cast<uint32_t>(static_cast<uint8_t>(buffer[7])) << 56)); |
15 |
+ return ((static_cast<uint64_t>(static_cast<uint8_t>(buffer[0]))) | |
16 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[1])) << 8) | |
17 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[2])) << 16) | |
18 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[3])) << 24) | |
19 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[4])) << 32) | |
20 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[5])) << 40) | |
21 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[6])) << 48) | |
22 |
+ (static_cast<uint64_t>(static_cast<uint8_t>(buffer[7])) << 56)); |
23 |
#else // !BYTE_ORDER_BIG_ENDIAN |
24 |
uint64_t result; |
25 |
// This should be optimized to a single instruction. |