diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-15 16:23:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-15 16:23:22 -0400 |
commit | 6969bd9a02895ae7dc80264fb59adba4a44f79a1 (patch) | |
tree | 3d552065414cc5ffe8cb0839c5cdd84325cb9d0f /src/or/rephist.c | |
parent | db2af2abb03a82e7c71581efa04a45869feba38a (diff) | |
download | tor-6969bd9a02895ae7dc80264fb59adba4a44f79a1.tar.gz tor-6969bd9a02895ae7dc80264fb59adba4a44f79a1.zip |
Autoconvert most circuit-list iterations to smartlist iterations
Breaks compilation.
Used this coccinelle script:
@@
identifier c;
typedef circuit_t;
iterator name TOR_LIST_FOREACH;
iterator name SMARTLIST_FOREACH_BEGIN;
statement S;
@@
- circuit_t *c;
...
- TOR_LIST_FOREACH(c, \(&global_circuitlist\|circuit_get_global_list()\), head)
+ SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, c)
S
+ SMARTLIST_FOREACH_END(c);
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 8a0dbe1a88..7bc9e1ce12 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -2471,7 +2471,6 @@ rep_hist_format_buffer_stats(time_t now) time_t rep_hist_buffer_stats_write(time_t now) { - circuit_t *circ; char *str = NULL; if (!start_of_buffer_stats_interval) @@ -2480,9 +2479,10 @@ rep_hist_buffer_stats_write(time_t now) goto done; /* Not ready to write */ /* Add open circuits to the history. */ - TOR_LIST_FOREACH(circ, circuit_get_global_list(), head) { + SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) { rep_hist_buffer_stats_add_circ(circ, now); } + SMARTLIST_FOREACH_END(circ); /* Generate history string. */ str = rep_hist_format_buffer_stats(now); |