aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-17 09:33:38 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-17 10:34:08 -0400
commit7faf115dfffaf12cdae98eac71fc6811059c6657 (patch)
tree61d42ba38202e6cb233cc89082228abbd55a4b56 /src/common/log.c
parent21c6c8485367ce66ab0791c153177c17bccd25c5 (diff)
downloadtor-7faf115dfffaf12cdae98eac71fc6811059c6657.tar
tor-7faf115dfffaf12cdae98eac71fc6811059c6657.tar.gz
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/common/log.c')
-rw-r--r--src/common/log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 5966e4445..5e2e6b5b5 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1005,8 +1005,7 @@ parse_log_severity_config(const char **cfg_ptr,
smartlist_split_string(domains_list, domains_str, ",", SPLIT_SKIP_SPACE,
-1);
tor_free(domains_str);
- SMARTLIST_FOREACH(domains_list, const char *, domain,
- {
+ SMARTLIST_FOREACH_BEGIN(domains_list, const char *, domain) {
if (!strcmp(domain, "*")) {
domains = ~0u;
} else {
@@ -1027,7 +1026,7 @@ parse_log_severity_config(const char **cfg_ptr,
domains |= d;
}
}
- });
+ } SMARTLIST_FOREACH_END(domain);
SMARTLIST_FOREACH(domains_list, char *, d, tor_free(d));
smartlist_free(domains_list);
if (err)