diff options
Diffstat (limited to 'include/core/SkEndian.h')
-rw-r--r-- | include/core/SkEndian.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/include/core/SkEndian.h b/include/core/SkEndian.h index f08a9a9..a72dfe3 100644 --- a/include/core/SkEndian.h +++ b/include/core/SkEndian.h @@ -36,8 +36,7 @@ /** Swap the two bytes in the low 16bits of the parameters. e.g. 0x1234 -> 0x3412 */ -inline uint16_t SkEndianSwap16(U16CPU value) -{ +static inline uint16_t SkEndianSwap16(U16CPU value) { SkASSERT(value == (uint16_t)value); return (uint16_t)((value >> 8) | (value << 8)); } @@ -45,12 +44,10 @@ inline uint16_t SkEndianSwap16(U16CPU value) /** Vector version of SkEndianSwap16(), which swaps the low two bytes of each value in the array. */ -inline void SkEndianSwap16s(uint16_t array[], int count) -{ +static inline void SkEndianSwap16s(uint16_t array[], int count) { SkASSERT(count == 0 || array != NULL); - while (--count >= 0) - { + while (--count >= 0) { *array = SkEndianSwap16(*array); array += 1; } @@ -59,8 +56,7 @@ inline void SkEndianSwap16s(uint16_t array[], int count) /** Reverse all 4 bytes in a 32bit value. e.g. 0x12345678 -> 0x78563412 */ -inline uint32_t SkEndianSwap32(uint32_t value) -{ +static inline uint32_t SkEndianSwap32(uint32_t value) { return ((value & 0xFF) << 24) | ((value & 0xFF00) << 8) | ((value & 0xFF0000) >> 8) | @@ -70,12 +66,10 @@ inline uint32_t SkEndianSwap32(uint32_t value) /** Vector version of SkEndianSwap16(), which swaps the bytes of each value in the array. */ -inline void SkEndianSwap32s(uint32_t array[], int count) -{ +static inline void SkEndianSwap32s(uint32_t array[], int count) { SkASSERT(count == 0 || array != NULL); - while (--count >= 0) - { + while (--count >= 0) { *array = SkEndianSwap32(*array); array += 1; } |