Rename C reserved identifiers missed before.

This commit is contained in:
Linus Nordberg 2012-10-20 18:43:50 +02:00
parent cb51807236
commit 172aac62ed

View File

@ -62,14 +62,14 @@ static char geoip6_digest[DIGEST_LEN];
country_t country_t
geoip_get_country(const char *country) geoip_get_country(const char *country)
{ {
void *_idxplus1; void *idxplus1_;
intptr_t idx; intptr_t idx;
_idxplus1 = strmap_get_lc(country_idxplus1_by_lc_code, country); idxplus1_ = strmap_get_lc(country_idxplus1_by_lc_code, country);
if (!_idxplus1) if (!idxplus1_)
return -1; return -1;
idx = ((uintptr_t)_idxplus1)-1; idx = ((uintptr_t)idxplus1_)-1;
return (country_t)idx; return (country_t)idx;
} }
@ -81,14 +81,14 @@ geoip_ipv4_add_entry(uint32_t low, uint32_t high, const char *country)
{ {
intptr_t idx; intptr_t idx;
geoip_ipv4_entry_t *ent; geoip_ipv4_entry_t *ent;
void *_idxplus1; void *idxplus1_;
if (high < low) if (high < low)
return; return;
_idxplus1 = strmap_get_lc(country_idxplus1_by_lc_code, country); idxplus1_ = strmap_get_lc(country_idxplus1_by_lc_code, country);
if (!_idxplus1) { if (!idxplus1_) {
geoip_country_t *c = tor_malloc_zero(sizeof(geoip_country_t)); geoip_country_t *c = tor_malloc_zero(sizeof(geoip_country_t));
strlcpy(c->countrycode, country, sizeof(c->countrycode)); strlcpy(c->countrycode, country, sizeof(c->countrycode));
tor_strlower(c->countrycode); tor_strlower(c->countrycode);
@ -96,7 +96,7 @@ geoip_ipv4_add_entry(uint32_t low, uint32_t high, const char *country)
idx = smartlist_len(geoip_countries) - 1; idx = smartlist_len(geoip_countries) - 1;
strmap_set_lc(country_idxplus1_by_lc_code, country, (void*)(idx+1)); strmap_set_lc(country_idxplus1_by_lc_code, country, (void*)(idx+1));
} else { } else {
idx = ((uintptr_t)_idxplus1)-1; idx = ((uintptr_t)idxplus1_)-1;
} }
{ {
geoip_country_t *c = smartlist_get(geoip_countries, idx); geoip_country_t *c = smartlist_get(geoip_countries, idx);
@ -177,14 +177,14 @@ geoip_ipv6_add_entry(struct in6_addr low, struct in6_addr high,
{ {
intptr_t idx; intptr_t idx;
geoip_ipv6_entry_t *ent; geoip_ipv6_entry_t *ent;
void *_idxplus1; void *idxplus1_;
if (memcmp(&high, &low, sizeof(struct in6_addr)) < 0) if (memcmp(&high, &low, sizeof(struct in6_addr)) < 0)
return; return;
_idxplus1 = strmap_get_lc(country_idxplus1_by_lc_code, country); idxplus1_ = strmap_get_lc(country_idxplus1_by_lc_code, country);
if (!_idxplus1) { if (!idxplus1_) {
geoip_country_t *c = tor_malloc_zero(sizeof(geoip_country_t)); geoip_country_t *c = tor_malloc_zero(sizeof(geoip_country_t));
strlcpy(c->countrycode, country, sizeof(c->countrycode)); strlcpy(c->countrycode, country, sizeof(c->countrycode));
tor_strlower(c->countrycode); tor_strlower(c->countrycode);
@ -192,7 +192,7 @@ geoip_ipv6_add_entry(struct in6_addr low, struct in6_addr high,
idx = smartlist_len(geoip_countries) - 1; idx = smartlist_len(geoip_countries) - 1;
strmap_set_lc(country_idxplus1_by_lc_code, country, (void*)(idx+1)); strmap_set_lc(country_idxplus1_by_lc_code, country, (void*)(idx+1));
} else { } else {
idx = ((uintptr_t)_idxplus1)-1; idx = ((uintptr_t)idxplus1_)-1;
} }
{ {
geoip_country_t *c = smartlist_get(geoip_countries, idx); geoip_country_t *c = smartlist_get(geoip_countries, idx);