diff options
Diffstat (limited to 'util/coding.h')
-rw-r--r-- | util/coding.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/util/coding.h b/util/coding.h index f0fa2cb..d9eeaa3 100644 --- a/util/coding.h +++ b/util/coding.h @@ -64,10 +64,10 @@ inline uint32_t DecodeFixed32(const char* ptr) { memcpy(&result, ptr, sizeof(result)); // gcc optimizes this to a plain load return result; } else { - return ((static_cast<uint32_t>(static_cast<unsigned char>(ptr[0]))) - | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[1])) << 8) - | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[2])) << 16) - | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[3])) << 24)); + return ((static_cast<uint32_t>(static_cast<unsigned char>(ptr[0]))) | + (static_cast<uint32_t>(static_cast<unsigned char>(ptr[1])) << 8) | + (static_cast<uint32_t>(static_cast<unsigned char>(ptr[2])) << 16) | + (static_cast<uint32_t>(static_cast<unsigned char>(ptr[3])) << 24)); } } @@ -85,11 +85,9 @@ inline uint64_t DecodeFixed64(const char* ptr) { } // Internal routine for use by fallback path of GetVarint32Ptr -const char* GetVarint32PtrFallback(const char* p, - const char* limit, +const char* GetVarint32PtrFallback(const char* p, const char* limit, uint32_t* value); -inline const char* GetVarint32Ptr(const char* p, - const char* limit, +inline const char* GetVarint32Ptr(const char* p, const char* limit, uint32_t* value) { if (p < limit) { uint32_t result = *(reinterpret_cast<const unsigned char*>(p)); |