Chromium Code Reviews| Index: include/core/SkEndian.h |
| diff --git a/include/core/SkEndian.h b/include/core/SkEndian.h |
| index 6eba297548ee0a88d63b2e11e7c0fca4f95d1786..29452bdd768e8e66648b5732339ce3fc480eaa90 100644 |
| --- a/include/core/SkEndian.h |
| +++ b/include/core/SkEndian.h |
| @@ -29,8 +29,7 @@ |
| /** Swap the two bytes in the low 16bits of the parameters. |
| e.g. 0x1234 -> 0x3412 |
| */ |
| -static inline uint16_t SkEndianSwap16(U16CPU value) { |
| - SkASSERT(value == (uint16_t)value); |
| +static inline uint16_t SkEndianSwap16(uint16_t value) { |
| return static_cast<uint16_t>((value >> 8) | (value << 8)); |
| } |
| template<uint16_t N> struct SkTEndianSwap16 { |
| @@ -52,11 +51,11 @@ static inline void SkEndianSwap16s(uint16_t array[], int count) { |
| /** Reverse all 4 bytes in a 32bit value. |
| e.g. 0x12345678 -> 0x78563412 |
| */ |
| -static inline uint32_t SkEndianSwap32(uint32_t value) { |
| - return ((value & 0xFF) << 24) | |
| - ((value & 0xFF00) << 8) | |
| - ((value & 0xFF0000) >> 8) | |
| - (value >> 24); |
| +static inline uint32_t SkEndianSwap32(uint32_t v) { |
|
bungeman-skia
2014/04/23 14:15:13
Any reason to change this from 'value'?
reed1
2014/04/23 14:27:37
historical from previous patches. will revert.
|
| + return ((v & 0xFF) << 24) | |
| + ((v & 0xFF00) << 8) | |
| + ((v & 0xFF0000) >> 8) | |
| + (v >> 24); |
| } |
| template<uint32_t N> struct SkTEndianSwap32 { |
| static const uint32_t value = ((N & 0xFF) << 24) | |