[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r14781: Fix some warnings. (tor/trunk/src/or)



Author: nickm
Date: 2008-05-28 14:34:10 -0400 (Wed, 28 May 2008)
New Revision: 14781

Modified:
   tor/trunk/src/or/geoip.c
Log:
Fix some warnings.

Modified: tor/trunk/src/or/geoip.c
===================================================================
--- tor/trunk/src/or/geoip.c	2008-05-28 18:31:57 UTC (rev 14780)
+++ tor/trunk/src/or/geoip.c	2008-05-28 18:34:10 UTC (rev 14781)
@@ -348,8 +348,10 @@
       ++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 @@
       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 @@
         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));