summaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-05-28 18:34:10 +0000
committerNick Mathewson <nickm@torproject.org>2008-05-28 18:34:10 +0000
commit664115251411dd735f16a268f1f9bed1490b11ed (patch)
tree7a6c937d25396000329faff6caa31a72f6ee8a95 /src/or/geoip.c
parentbd3b86df3b18cbded5f69de2f4ed5f7c5e2487e3 (diff)
downloadtor-664115251411dd735f16a268f1f9bed1490b11ed.tar.gz
tor-664115251411dd735f16a268f1f9bed1490b11ed.zip
Fix some warnings.
svn:r14781
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index b3e993b25f..66814f5cae 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -348,8 +348,10 @@ geoip_get_client_history(time_t now)
++total;
}
/* Don't record anything if we haven't seen enough IPs. */
+#if (MIN_IPS_TO_NOTE_ANYTHING > 0)
if (total < MIN_IPS_TO_NOTE_ANYTHING)
goto done;
+#endif
/* Make a list of c_hist_t */
entries = smartlist_create();
for (i = 0; i < n_countries; ++i) {
@@ -357,7 +359,11 @@ geoip_get_client_history(time_t now)
const char *countrycode;
c_hist_t *ent;
/* Only report a country if it has a minimum number of IPs. */
+#if (MIN_IPS_TO_NOTE_COUNTRY > 0)
if (c >= MIN_IPS_TO_NOTE_COUNTRY) {
+#else
+ if (1) {
+#endif
/* Round up to the next multiple of IP_GRANULARITY */
c += IP_GRANULARITY-1;
c -= c % IP_GRANULARITY;
@@ -379,7 +385,9 @@ geoip_get_client_history(time_t now)
smartlist_add(chunks, tor_strdup(buf));
});
result = smartlist_join_strings(chunks, ",", 0, NULL);
+#if (MIN_IPS_TO_NOTE_ANYTHING > 0)
done:
+#endif
tor_free(counts);
if (chunks) {
SMARTLIST_FOREACH(chunks, char *, c, tor_free(c));