diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-07-17 09:33:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-07-17 10:34:08 -0400 |
commit | 7faf115dfffaf12cdae98eac71fc6811059c6657 (patch) | |
tree | 61d42ba38202e6cb233cc89082228abbd55a4b56 /src/or/config.c | |
parent | 21c6c8485367ce66ab0791c153177c17bccd25c5 (diff) | |
download | tor-7faf115dfffaf12cdae98eac71fc6811059c6657.tar.gz tor-7faf115dfffaf12cdae98eac71fc6811059c6657.zip |
Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/END
The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when
you have a nice short loop body, but using it for long bodies makes
your preprocessor tell the compiler that all the code is on the same
line. That causes grief, since compiler warnings and debugger lines
will all refer to that one line.
So, here's a new style rule: SMARTLIST_FOREACH blocks need to be
short.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/config.c b/src/or/config.c index f5b5c8fb58..4e9518f1d2 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3288,7 +3288,7 @@ compute_publishserverdescriptor(or_options_t *options) *auth = NO_DIRINFO; if (!list) /* empty list, answer is none */ return 0; - SMARTLIST_FOREACH(list, const char *, string, { + SMARTLIST_FOREACH_BEGIN(list, const char *, string) { if (!strcasecmp(string, "v1")) *auth |= V1_DIRINFO; else if (!strcmp(string, "1")) @@ -3310,7 +3310,7 @@ compute_publishserverdescriptor(or_options_t *options) /* no authority */; else return -1; - }); + } SMARTLIST_FOREACH_END(string); return 0; } @@ -3646,7 +3646,7 @@ options_validate(or_options_t *old_options, or_options_t *options, options->_AllowInvalid = 0; if (options->AllowInvalidNodes) { - SMARTLIST_FOREACH(options->AllowInvalidNodes, const char *, cp, { + SMARTLIST_FOREACH_BEGIN(options->AllowInvalidNodes, const char *, cp) { if (!strcasecmp(cp, "entry")) options->_AllowInvalid |= ALLOW_INVALID_ENTRY; else if (!strcasecmp(cp, "exit")) @@ -3662,7 +3662,7 @@ options_validate(or_options_t *old_options, or_options_t *options, "Unrecognized value '%s' in AllowInvalidNodes", cp); return -1; } - }); + } SMARTLIST_FOREACH_END(cp); } if (!options->SafeLogging || |