aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-11 20:28:50 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-11 20:28:50 +0000
commit04ec7d1f9807c772349328947a1df861c28b414e (patch)
tree3693a95f33362bec09c6b17f312a9ec61bd21a5a /src/or
parent4277b0e9265ca24d324e210ded904f1588b24df1 (diff)
downloadtor-04ec7d1f9807c772349328947a1df861c28b414e.tar.gz
tor-04ec7d1f9807c772349328947a1df861c28b414e.zip
Now that tor_assert is no longer using a broken force-to-boolean formulation, we can tor_assert a bitfield without a gcc compile error.
svn:r17598
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection.c4
-rw-r--r--src/or/routerparse.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index b27e8d26b2..7a6a83a265 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2979,7 +2979,7 @@ assert_connection_ok(connection_t *conn, time_t now)
if (conn->linked_conn) {
tor_assert(conn->linked_conn->linked_conn == conn);
- tor_assert(conn->linked != 0);
+ tor_assert(conn->linked);
}
if (conn->linked)
tor_assert(conn->s < 0);
@@ -3030,7 +3030,7 @@ assert_connection_ok(connection_t *conn, time_t now)
tor_assert(edge_conn->socks_request);
if (conn->state == AP_CONN_STATE_OPEN) {
- tor_assert(edge_conn->socks_request->has_finished != 0);
+ tor_assert(edge_conn->socks_request->has_finished);
if (!conn->marked_for_close) {
tor_assert(edge_conn->cpath_layer);
assert_cpath_layer_ok(edge_conn->cpath_layer);
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 3506e8f28f..0a6c146571 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1265,7 +1265,7 @@ router_parse_entry_from_string(const char *s, const char *end,
}
if ((tok = find_opt_by_keyword(tokens, A_PURPOSE))) {
- tor_assert(tok->n_args != 0);
+ tor_assert(tok->n_args);
router->purpose = router_purpose_from_string(tok->args[0]);
} else {
router->purpose = ROUTER_PURPOSE_GENERAL;
@@ -1607,7 +1607,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
tok->key = NULL;
tok = find_by_keyword(tokens, K_FINGERPRINT);
- tor_assert(tok->n_args > 0);
+ tor_assert(tok->n_args);
if (base16_decode(fp_declared, DIGEST_LEN, tok->args[0],
strlen(tok->args[0]))) {
log_warn(LD_DIR, "Couldn't decode key certificate fingerprint %s",
@@ -1627,7 +1627,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
tok = find_opt_by_keyword(tokens, K_DIR_ADDRESS);
if (tok) {
- tor_assert(tok->n_args != 0);
+ tor_assert(tok->n_args);
if (parse_addr_port(LOG_WARN, tok->args[0], NULL, &cert->addr,
&cert->dir_port)<0) {
log_warn(LD_DIR, "Couldn't parse dir-address in certificate");
@@ -2004,7 +2004,7 @@ networkstatus_v2_parse_from_string(const char *s)
}
tok = find_by_keyword(tokens, K_FINGERPRINT);
- tor_assert(tok->n_args != 0);
+ tor_assert(tok->n_args);
if (base16_decode(ns->identity_digest, DIGEST_LEN, tok->args[0],
strlen(tok->args[0]))) {
log_warn(LD_DIR, "Couldn't decode networkstatus fingerprint %s",
@@ -2013,7 +2013,7 @@ networkstatus_v2_parse_from_string(const char *s)
}
if ((tok = find_opt_by_keyword(tokens, K_CONTACT))) {
- tor_assert(tok->n_args != 0);
+ tor_assert(tok->n_args);
ns->contact = tor_strdup(tok->args[0]);
}
@@ -2166,7 +2166,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
}
tok = find_by_keyword(tokens, K_VOTE_STATUS);
- tor_assert(tok->n_args != 0);
+ tor_assert(tok->n_args);
if (!strcmp(tok->args[0], "vote")) {
ns->type = NS_TYPE_VOTE;
} else if (!strcmp(tok->args[0], "consensus")) {