diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-06-17 18:22:39 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-06-17 18:22:39 +0000 |
commit | 5adfa09fce2c61239f9a7fa5fb154282f802af0a (patch) | |
tree | ffd522053a544617737cc38128c2e315dce464b1 /src/or/test.c | |
parent | 93f32db438cff63662761374f4a69b710f3d71d9 (diff) | |
download | tor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.tar.gz tor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.zip |
r13477@catbus: nickm | 2007-06-17 14:22:03 -0400
Sun CC likes to give warnings for the do { } while(0) construction for making statement-like macros. Define STMT_BEGIN/STMT_END macros that do the right thing, and use them everywhere.
svn:r10645
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/test.c b/src/or/test.c index 776cc2aff0..985ff18aac 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -1007,25 +1007,25 @@ _test_eq_ip6(struct in6_addr *a, struct in6_addr *b, const char *e1, } #define test_eq_ip6(a,b) _test_eq_ip6((a),(b),#a,#b,__LINE__) -#define test_pton6_same(a,b) do { \ +#define test_pton6_same(a,b) STMT_BEGIN \ r = tor_inet_pton(AF_INET6, a, &a1); \ test_assert(r==1); \ r = tor_inet_pton(AF_INET6, b, &a2); \ test_assert(r==1); \ test_eq_ip6(&a1,&a2); \ - } while (0) + STMT_END #define test_pton6_bad(a) \ test_eq(0, tor_inet_pton(AF_INET6, a, &a1)) -#define test_ntop6_reduces(a,b) do { \ +#define test_ntop6_reduces(a,b) STMT_BEGIN \ r = tor_inet_pton(AF_INET6, a, &a1); \ test_assert(r==1); \ test_streq(tor_inet_ntop(AF_INET6, &a1, buf, sizeof(buf)), b); \ r = tor_inet_pton(AF_INET6, b, &a2); \ test_assert(r==1); \ test_eq_ip6(&a1, &a2); \ - } while (0) + STMT_END static void test_ip6_helpers(void) |