/** Sorting helper: return -1, 1, or 0 based on comparison of two
* geoip_ipv4_entry_t */
static int
-_geoip_ipv4_compare_entries(const void **_a, const void **_b)
+geoip_ipv4_compare_entries_(const void **_a, const void **_b)
{
const geoip_ipv4_entry_t *a = *_a, *b = *_b;
if (a->ip_low < b->ip_low)
/** bsearch helper: return -1, 1, or 0 based on comparison of an IP (a pointer
* to a uint32_t in host order) to a geoip_ipv4_entry_t */
static int
-_geoip_ipv4_compare_key_to_entry(const void *_key, const void **_member)
+geoip_ipv4_compare_key_to_entry_(const void *_key, const void **_member)
{
/* No alignment issue here, since _key really is a pointer to uint32_t */
const uint32_t addr = *(uint32_t *)_key;
/** Sorting helper: return -1, 1, or 0 based on comparison of two
* geoip_ipv6_entry_t */
static int
-_geoip_ipv6_compare_entries(const void **_a, const void **_b)
+geoip_ipv6_compare_entries_(const void **_a, const void **_b)
{
const geoip_ipv6_entry_t *a = *_a, *b = *_b;
return memcmp(&a->ip_low, &b->ip_low, sizeof(struct in6_addr));
/** bsearch helper: return -1, 1, or 0 based on comparison of an IPv6 (a pointer
* to a in6_addr in host order) to a geoip_ipv6_entry_t */
static int
-_geoip_ipv6_compare_key_to_entry(const void *_key, const void **_member)
+geoip_ipv6_compare_key_to_entry_(const void *_key, const void **_member)
{
/* XXX5053 The following comment isn't correct anymore and I'm not 100%
* certain how to fix it, because I don't know what alignment issues
fclose(f);
if (family == AF_INET)
- smartlist_sort(geoip_ipv4_entries, _geoip_ipv4_compare_entries);
+ smartlist_sort(geoip_ipv4_entries, geoip_ipv4_compare_entries_);
else /* AF_INET6 */
- smartlist_sort(geoip_ipv6_entries, _geoip_ipv6_compare_entries);
+ smartlist_sort(geoip_ipv6_entries, geoip_ipv6_compare_entries_);
/* Okay, now we need to maybe change our mind about what is in which
* country. */
geoip_ipv4_entry_t *ent;
if (!geoip_ipv4_entries)
return -1;
- ent = smartlist_bsearch(geoip_ipv4_entries, &ipaddr, _geoip_ipv4_compare_key_to_entry);
+ ent = smartlist_bsearch(geoip_ipv4_entries, &ipaddr, geoip_ipv4_compare_key_to_entry_);
return ent ? (int)ent->country : 0;
}
if (!geoip_ipv6_entries)
return -1;
- ent = smartlist_bsearch(geoip_ipv6_entries, addr, _geoip_ipv6_compare_key_to_entry);
+ ent = smartlist_bsearch(geoip_ipv6_entries, addr, geoip_ipv6_compare_key_to_entry_);
return ent ? (int)ent->country : 0;
}