[tor-commits] [tor/master] Fix clang warnings introduced by 9f2b887c5d251b93ee9def708
nickm at torproject.org
nickm at torproject.org
Wed Jun 20 21:50:07 UTC 2018
commit f91ea506f0a9af55a520dab4c88abf0c01bd2ce1
Author: Nick Mathewson <nickm at torproject.org>
Date: Wed Jun 20 17:49:06 2018 -0400
Fix clang warnings introduced by 9f2b887c5d251b93ee9def708
---
src/common/util.c | 5 ++---
src/or/control.c | 5 ++---
src/or/geoip.c | 3 +--
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/common/util.c b/src/common/util.c
index 53e4507f1..26b76c31f 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -4801,8 +4801,8 @@ process_environment_t *
process_environment_make(struct smartlist_t *env_vars)
{
process_environment_t *env = tor_malloc_zero(sizeof(process_environment_t));
- size_t n_env_vars = smartlist_len(env_vars);
- size_t i;
+ int n_env_vars = smartlist_len(env_vars);
+ int i;
size_t total_env_length;
smartlist_t *env_vars_sorted;
@@ -5375,4 +5375,3 @@ tor_ntohll(uint64_t a)
{
return tor_htonll(a);
}
-
diff --git a/src/or/control.c b/src/or/control.c
index 0d637dce7..ae54689c0 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4597,7 +4597,7 @@ handle_control_add_onion(control_connection_t *conn,
const char *body)
{
smartlist_t *args;
- size_t arg_len;
+ int arg_len;
(void) len; /* body is nul-terminated; it's safe to ignore the length */
args = getargs_helper("ADD_ONION", conn, body, 2, -1);
if (!args)
@@ -4618,7 +4618,7 @@ handle_control_add_onion(control_connection_t *conn,
rend_auth_type_t auth_type = REND_NO_AUTH;
/* Default to adding an anonymous hidden service if no flag is given */
int non_anonymous = 0;
- for (size_t i = 1; i < arg_len; i++) {
+ for (int i = 1; i < arg_len; i++) {
static const char *port_prefix = "Port=";
static const char *flags_prefix = "Flags=";
static const char *max_s_prefix = "MaxStreams=";
@@ -7736,4 +7736,3 @@ control_testing_set_global_event_mask(uint64_t mask)
global_event_mask = mask;
}
#endif /* defined(TOR_UNIT_TESTS) */
-
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 2c917c564..c66bee0fa 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -150,7 +150,7 @@ geoip_add_entry(const tor_addr_t *low, const tor_addr_t *high,
idx = ((uintptr_t)idxplus1_)-1;
}
{
- geoip_country_t *c = smartlist_get(geoip_countries, idx);
+ geoip_country_t *c = smartlist_get(geoip_countries, (int)idx);
tor_assert(!strcasecmp(c->countrycode, country));
}
@@ -1884,4 +1884,3 @@ geoip_free_all(void)
memset(geoip_digest, 0, sizeof(geoip_digest));
memset(geoip6_digest, 0, sizeof(geoip6_digest));
}
-
More information about the tor-commits
mailing list