From a3713f801d97b1903593a53c02da682acb3acee0 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 14 Dec 2018 13:08:21 +0700 Subject: clean up compiler attribute --- src/common/binary.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/common/binary.h') diff --git a/src/common/binary.h b/src/common/binary.h index 3ab87e3f8..7a93ee709 100644 --- a/src/common/binary.h +++ b/src/common/binary.h @@ -57,41 +57,35 @@ #define BIT_CLR_(x, n) ( (x) & (~BIT_(n)) ) ///< clear n-th bit of x #define BIT_TEST_(x, n) ( ((x) & BIT_(n)) ? true : false ) ///< check if n-th bit of x is 1 -static inline uint32_t bit_set(uint32_t value, uint8_t n) ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t bit_set(uint32_t value, uint8_t n) { return value | BIT_(n); } -static inline uint32_t bit_clear(uint32_t value, uint8_t n) ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t bit_clear(uint32_t value, uint8_t n) { return value & (~BIT_(n)); } -static inline bool bit_test(uint32_t value, uint8_t n) ATTR_CONST ATTR_ALWAYS_INLINE; static inline bool bit_test(uint32_t value, uint8_t n) { return (value & BIT_(n)) ? true : false; } ///< create a mask with n-bit lsb set to 1 -static inline uint32_t bit_mask(uint8_t n) ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t bit_mask(uint8_t n) { return (n < 32) ? ( BIT_(n) - 1 ) : UINT32_MAX; } -static inline uint32_t bit_mask_range(uint8_t start, uint32_t end) ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t bit_mask_range(uint8_t start, uint32_t end) { return bit_mask(end+1) & ~ bit_mask(start); } -static inline uint32_t bit_set_range(uint32_t value, uint8_t start, uint8_t end, uint32_t pattern) ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t bit_set_range(uint32_t value, uint8_t start, uint8_t end, uint32_t pattern) { - return ( value & ~bit_mask_range(start, end) ) | (pattern << start); + return ( value & ~bit_mask_range(start, end) ) | (pattern << start); } -- cgit v1.3.1