macro: move DECIMAL_STR_WIDTH() into macro.h

So that it sets next to DECIMAL_STR_MAX(), where it belongs.
This commit is contained in:
Lennart Poettering 2015-10-27 01:03:38 +01:00
parent 8f328d36c9
commit 0d1dbeb3a4
2 changed files with 9 additions and 9 deletions

View file

@ -362,6 +362,15 @@ do { \
sizeof(type) <= 4 ? 10 : \
sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)])))
#define DECIMAL_STR_WIDTH(x) \
({ \
typeof(x) _x_ = (x); \
unsigned ans = 1; \
while (_x_ /= 10) \
ans++; \
ans; \
})
#define SET_FLAG(v, flag, b) \
(v) = (b) ? ((v) | (flag)) : ((v) & ~(flag))

View file

@ -237,15 +237,6 @@ static inline unsigned log2u_round_up(unsigned x) {
return log2u(x - 1) + 1;
}
#define DECIMAL_STR_WIDTH(x) \
({ \
typeof(x) _x_ = (x); \
unsigned ans = 1; \
while (_x_ /= 10) \
ans++; \
ans; \
})
#define alloca0(n) \
({ \
char *_new_; \