mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
+2
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user