aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-06-17 18:22:39 +0000
committerNick Mathewson <nickm@torproject.org>2007-06-17 18:22:39 +0000
commit5adfa09fce2c61239f9a7fa5fb154282f802af0a (patch)
treeffd522053a544617737cc38128c2e315dce464b1 /src/or/routerparse.c
parent93f32db438cff63662761374f4a69b710f3d71d9 (diff)
downloadtor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.tar
tor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.tar.gz
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/routerparse.c')
-rw-r--r--src/or/routerparse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 7604cb6f6..83487d437 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2282,12 +2282,13 @@ token_free(directory_token_t *tok)
}
#define RET_ERR(msg) \
- do { \
+ STMT_BEGIN \
if (tok) token_free(tok); \
tok = tor_malloc_zero(sizeof(directory_token_t)); \
tok->tp = _ERR; \
tok->error = tor_strdup(msg); \
- goto done_tokenizing; } while (0)
+ goto done_tokenizing; \
+ STMT_END
static INLINE directory_token_t *
token_check_object(const char *kwd,
@@ -2346,12 +2347,13 @@ get_next_token(const char **s, token_rule_t *table)
const char *kwd = "";
#define RET_ERR(msg) \
- do { \
+ STMT_BEGIN \
if (tok) token_free(tok); \
tok = tor_malloc_zero(sizeof(directory_token_t)); \
tok->tp = _ERR; \
tok->error = tor_strdup(msg); \
- goto done_tokenizing; } while (0)
+ goto done_tokenizing; \
+ STMT_END
tok = tor_malloc_zero(sizeof(directory_token_t));
tok->tp = _ERR;