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/cpuworker.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/cpuworker.c')
-rw-r--r-- | src/or/cpuworker.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 9d48dd7cf7..0255227e7b 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -417,8 +417,7 @@ cull_wedged_cpuworkers(void) { time_t now = time(NULL); smartlist_t *conns = get_connection_array(); - SMARTLIST_FOREACH(conns, connection_t *, conn, - { + SMARTLIST_FOREACH_BEGIN(conns, connection_t *, conn) { if (!conn->marked_for_close && conn->type == CONN_TYPE_CPUWORKER && conn->state == CPUWORKER_STATE_BUSY_ONION && @@ -429,7 +428,7 @@ cull_wedged_cpuworkers(void) num_cpuworkers--; connection_mark_for_close(conn); } - }); + } SMARTLIST_FOREACH_END(conn); } /** Try to tell a cpuworker to perform the public key operations necessary to |