Skip to content

Commit 1d3c49a

Browse files
author
Seppo Takalo
committed
Squashed 'features/FEATURE_COMMON_PAL/nanostack-libservice/' changes from 67affc61b..6444c8a4f
6444c8a4f Restore common_count_leading_zeros definition git-subtree-dir: features/FEATURE_COMMON_PAL/nanostack-libservice git-subtree-split: 6444c8a4f23dfe6d9b28014c78b41812879898b9
1 parent 8d65f6d commit 1d3c49a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

mbed-client-libservice/common_functions.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ NS_INLINE uint16_t common_read_16_bit_inverse(const uint8_t data_buf[__static 2]
169169
*/
170170
NS_INLINE uint_fast8_t common_count_bits(uint8_t byte);
171171

172+
/*
173+
* Count leading zeros in a byte
174+
*
175+
* \deprecated Use common_count_leading_zeros_8
176+
*
177+
* \param byte byte to inspect
178+
*
179+
* \return number of leading zeros in byte (0-8)
180+
*/
181+
NS_INLINE uint_fast8_t common_count_leading_zeros(uint8_t byte);
182+
172183
/*
173184
* Count leading zeros in a byte
174185
*
@@ -196,9 +207,6 @@ NS_INLINE uint_fast8_t common_count_leading_zeros_16(uint16_t value);
196207
*/
197208
NS_INLINE uint_fast8_t common_count_leading_zeros_32(uint32_t value);
198209

199-
/* Backwards compatibility */
200-
#define common_count_leading_zeros common_count_leading_zeros_8
201-
202210
/*
203211
* Compare 8-bit serial numbers
204212
*
@@ -454,6 +462,11 @@ COMMON_FUNCTIONS_FN uint_fast8_t common_count_bits(uint8_t byte)
454462
return count;
455463
}
456464

465+
COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros(uint8_t byte)
466+
{
467+
return common_count_leading_zeros_8(byte);
468+
}
469+
457470
COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_8(uint8_t byte)
458471
{
459472
#ifdef __CC_ARM

0 commit comments

Comments
 (0)