]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: move DECIMAL_STR_WIDTH() into macro.h
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 00:03:38 +0000 (01:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:25:57 +0000 (13:25 +0100)
So that it sets next to DECIMAL_STR_MAX(), where it belongs.

src/basic/macro.h
src/basic/util.h

index 02f34cedadc2bb1248025b72c8f3b7ffeb79fc60..01916bd788429f8a063516b59c4fa6ddc2fb72c5 100644 (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))
 
index 078c4313b54b9a79698494415d3487ad9ebe50a6..fc73e13fe4898a09ace01826984f51acfa364fb6 100644 (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_;                            \