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/top.c | |
parent | 4d0c1ea4784c9844f8468d97ca5c26d3c70f9921 (diff) |
*: more BUILD_BUG_ON conversions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps/top.c')
-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 { }; //FIX_ALIASING; - large code growth enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; #define G (*(struct globals*)&bb_common_bufsiz1) -struct BUG_bad_size { - char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; - char BUG_line_buf_too_small[LINE_BUF_SIZE > 80 ? 1 : -1]; -}; #define top (G.top ) #define ntop (G.ntop ) #define sort_field (G.sort_field ) @@ -204,7 +200,10 @@ struct BUG_bad_size { #define num_cpus (G.num_cpus ) #define total_pcpu (G.total_pcpu ) #define line_buf (G.line_buf ) -#define INIT_G() do { } while (0) +#define INIT_G() do { \ + BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ + BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \ +} while (0) enum { OPT_d = (1 << 0), |