diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-13 17:17:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-13 17:17:34 +0200 |
commit | 7b85ec30b5941f0b90c48a990f2f6840aca87bce (patch) | |
tree | 3565032bf3f34eeea195258d9d4edc9f01480e6e /procps | |
parent | 4d0c1ea4784c9844f8468d97ca5c26d3c70f9921 (diff) | |
download | busybox-w32-7b85ec30b5941f0b90c48a990f2f6840aca87bce.tar.gz busybox-w32-7b85ec30b5941f0b90c48a990f2f6840aca87bce.tar.bz2 busybox-w32-7b85ec30b5941f0b90c48a990f2f6840aca87bce.zip |
*: more BUILD_BUG_ON conversions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/top.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/procps/top.c b/procps/top.c index 3d67c3cfd..9a3f171ac 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -184,10 +184,6 @@ struct globals { | |||
184 | }; //FIX_ALIASING; - large code growth | 184 | }; //FIX_ALIASING; - large code growth |
185 | enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; | 185 | enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; |
186 | #define G (*(struct globals*)&bb_common_bufsiz1) | 186 | #define G (*(struct globals*)&bb_common_bufsiz1) |
187 | struct BUG_bad_size { | ||
188 | char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; | ||
189 | char BUG_line_buf_too_small[LINE_BUF_SIZE > 80 ? 1 : -1]; | ||
190 | }; | ||
191 | #define top (G.top ) | 187 | #define top (G.top ) |
192 | #define ntop (G.ntop ) | 188 | #define ntop (G.ntop ) |
193 | #define sort_field (G.sort_field ) | 189 | #define sort_field (G.sort_field ) |
@@ -204,7 +200,10 @@ struct BUG_bad_size { | |||
204 | #define num_cpus (G.num_cpus ) | 200 | #define num_cpus (G.num_cpus ) |
205 | #define total_pcpu (G.total_pcpu ) | 201 | #define total_pcpu (G.total_pcpu ) |
206 | #define line_buf (G.line_buf ) | 202 | #define line_buf (G.line_buf ) |
207 | #define INIT_G() do { } while (0) | 203 | #define INIT_G() do { \ |
204 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | ||
205 | BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \ | ||
206 | } while (0) | ||
208 | 207 | ||
209 | enum { | 208 | enum { |
210 | OPT_d = (1 << 0), | 209 | OPT_d = (1 << 0), |