aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.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/or/geoip.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/or/geoip.c')
-rw-r--r--src/or/geoip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 5d6488817..6b7cc82b8 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -906,7 +906,7 @@ geoip_get_request_history(geoip_client_action_t action)
return NULL;
entries = smartlist_new();
- SMARTLIST_FOREACH(geoip_countries, geoip_country_t *, c, {
+ SMARTLIST_FOREACH_BEGIN(geoip_countries, geoip_country_t *, c) {
uint32_t tot = 0;
c_hist_t *ent;
tot = (action == GEOIP_CLIENT_NETWORKSTATUS) ?
@@ -917,7 +917,7 @@ geoip_get_request_history(geoip_client_action_t action)
strlcpy(ent->country, c->countrycode, sizeof(ent->country));
ent->total = round_to_next_multiple_of(tot, granularity);
smartlist_add(entries, ent);
- });
+ } SMARTLIST_FOREACH_END(c);
smartlist_sort(entries, _c_hist_compare);
strings = smartlist_new();