diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-15 21:17:42 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-15 21:17:42 +0000 |
commit | bfdc366037690c74d1e6b73fc33e2f73842ed793 (patch) | |
tree | eddffbfb10fcdcda6d2afd3bf17e4a9aaa2a8d54 /src/or | |
parent | ca32b4d5b51b95fac2b030874025ac4c19be8414 (diff) | |
download | tor-bfdc366037690c74d1e6b73fc33e2f73842ed793.tar tor-bfdc366037690c74d1e6b73fc33e2f73842ed793.tar.gz |
r12763@catbus: nickm | 2007-05-15 05:29:33 -0400
Make --enable-gcc-warnings happy on the upcoming gcc 4.2
svn:r10195
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitlist.c | 8 | ||||
-rw-r--r-- | src/or/config.c | 2 | ||||
-rw-r--r-- | src/or/router.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 5580bd039..44f056659 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1116,16 +1116,20 @@ assert_circuit_ok(const circuit_t *c) edge_connection_t *conn; const or_circuit_t *or_circ = NULL; const origin_circuit_t *origin_circ = NULL; + circuit_t *nonconst_circ; tor_assert(c); tor_assert(c->magic == ORIGIN_CIRCUIT_MAGIC || c->magic == OR_CIRCUIT_MAGIC); tor_assert(c->purpose >= _CIRCUIT_PURPOSE_MIN && c->purpose <= _CIRCUIT_PURPOSE_MAX); + /* Having a separate variable for this pleases GCC 4.2 in ways I hop I never + * understand. -NM. */ + nonconst_circ = (circuit_t*) c; if (CIRCUIT_IS_ORIGIN(c)) - origin_circ = TO_ORIGIN_CIRCUIT((circuit_t*)c); + origin_circ = TO_ORIGIN_CIRCUIT(nonconst_circ); else - or_circ = TO_OR_CIRCUIT((circuit_t*)c); + or_circ = TO_OR_CIRCUIT(nonconst_circ); if (c->n_conn) { tor_assert(!memcmp(c->n_conn->identity_digest, c->n_conn_id_digest, diff --git a/src/or/config.c b/src/or/config.c index 71f18f314..7b6fa169d 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3113,7 +3113,7 @@ options_init_from_torrc(int argc, char **argv) if (argc > 1 && (!strcmp(argv[1],"--version"))) { char vbuf[128]; - if (tor_svn_revision && strlen(tor_svn_revision)) { + if (tor_svn_revision != NULL && strlen(tor_svn_revision)) { tor_snprintf(vbuf, sizeof(vbuf), " (r%s)", tor_svn_revision); } else { vbuf[0] = 0; diff --git a/src/or/router.c b/src/or/router.c index 8937e0427..d510b9328 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1244,7 +1244,7 @@ get_platform_str(char *platform, size_t len) { char svn_version_buf[128]; if (!strcmpend(VERSION, "-dev") && - tor_svn_revision && strlen(tor_svn_revision)) { + tor_svn_revision != NULL && strlen(tor_svn_revision)) { tor_snprintf(svn_version_buf, sizeof(svn_version_buf), " (r%s)", tor_svn_revision); } else { |