Changeset db24058 in mainline for uspace/lib/libc/include/bitops.h
- Timestamp:
- 2009-06-30T15:53:15Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2d11a7d8
- Parents:
- 6db6fd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/bitops.h
r6db6fd1 rdb24058 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 43 43 * If number is zero, it returns 0 44 44 */ 45 static inline int fnzb32(uint32_t arg)45 static inline unsigned int fnzb32(uint32_t arg) 46 46 { 47 int n = 0;48 47 unsigned int n = 0; 48 49 49 if (arg >> 16) { 50 50 arg >>= 16; … … 75 75 } 76 76 77 static inline int fnzb64(uint64_t arg)77 static inline unsigned int fnzb64(uint64_t arg) 78 78 { 79 int n = 0;80 79 unsigned int n = 0; 80 81 81 if (arg >> 32) { 82 82 arg >>= 32; … … 84 84 } 85 85 86 return n + fnzb32((uint32_t) arg);86 return (n + fnzb32((uint32_t) arg)); 87 87 } 88 88 89 #define fnzb(x) fnzb32(x) 89 static inline unsigned int fnzb(size_t arg) 90 { 91 return fnzb64(arg); 92 } 90 93 91 94 #endif
Note:
See TracChangeset
for help on using the changeset viewer.