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 /networking | |
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 'networking')
-rw-r--r-- | networking/inetd.c | 4 | ||||
-rw-r--r-- | networking/nbd-client.c | 5 | ||||
-rw-r--r-- | networking/telnet.c | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index dce5a0885..243165a07 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -329,9 +329,6 @@ struct globals { | |||
329 | } FIX_ALIASING; | 329 | } FIX_ALIASING; |
330 | #define G (*(struct globals*)&bb_common_bufsiz1) | 330 | #define G (*(struct globals*)&bb_common_bufsiz1) |
331 | enum { LINE_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line) }; | 331 | enum { LINE_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line) }; |
332 | struct BUG_G_too_big { | ||
333 | char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; | ||
334 | }; | ||
335 | #define rlim_ofile_cur (G.rlim_ofile_cur ) | 332 | #define rlim_ofile_cur (G.rlim_ofile_cur ) |
336 | #define rlim_ofile (G.rlim_ofile ) | 333 | #define rlim_ofile (G.rlim_ofile ) |
337 | #define serv_list (G.serv_list ) | 334 | #define serv_list (G.serv_list ) |
@@ -352,6 +349,7 @@ struct BUG_G_too_big { | |||
352 | #define allsock (G.allsock ) | 349 | #define allsock (G.allsock ) |
353 | #define line (G.line ) | 350 | #define line (G.line ) |
354 | #define INIT_G() do { \ | 351 | #define INIT_G() do { \ |
352 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | ||
355 | rlim_ofile_cur = OPEN_MAX; \ | 353 | rlim_ofile_cur = OPEN_MAX; \ |
356 | global_queuelen = 128; \ | 354 | global_queuelen = 128; \ |
357 | config_filename = "/etc/inetd.conf"; \ | 355 | config_filename = "/etc/inetd.conf"; \ |
diff --git a/networking/nbd-client.c b/networking/nbd-client.c index a601430b6..70869d651 100644 --- a/networking/nbd-client.c +++ b/networking/nbd-client.c | |||
@@ -57,9 +57,8 @@ int nbdclient_main(int argc, char **argv) | |||
57 | uint32_t flags; | 57 | uint32_t flags; |
58 | char data[124]; | 58 | char data[124]; |
59 | } nbd_header; | 59 | } nbd_header; |
60 | struct bug_check { | 60 | |
61 | char c[offsetof(struct nbd_header_t, data) == 8+8+8+4 ? 1 : -1]; | 61 | BUILD_BUG_ON(offsetof(struct nbd_header_t, data) != 8+8+8+4); |
62 | }; | ||
63 | 62 | ||
64 | // Parse command line stuff (just a stub now) | 63 | // Parse command line stuff (just a stub now) |
65 | if (argc != 4) | 64 | if (argc != 4) |
diff --git a/networking/telnet.c b/networking/telnet.c index 3bb6fb1ba..944cf1bd6 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -110,9 +110,7 @@ struct globals { | |||
110 | } FIX_ALIASING; | 110 | } FIX_ALIASING; |
111 | #define G (*(struct globals*)&bb_common_bufsiz1) | 111 | #define G (*(struct globals*)&bb_common_bufsiz1) |
112 | #define INIT_G() do { \ | 112 | #define INIT_G() do { \ |
113 | struct G_sizecheck { \ | 113 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
114 | char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \ | ||
115 | }; \ | ||
116 | } while (0) | 114 | } while (0) |
117 | 115 | ||
118 | 116 | ||