aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2012-12-31 18:23:28 +0100
committerSebastian Hahn <sebastian@torproject.org>2012-12-31 18:23:28 +0100
commit11e8a445c3051f017600b27999f0d666b7d63b04 (patch)
tree07ad0a898053b51a7bf1ffe6ebefcb1814ae14c6
parent51c2dd8f8954d52fbaef29d2afb44d5eda47f4da (diff)
downloadtor-11e8a445c3051f017600b27999f0d666b7d63b04.tar.gz
tor-11e8a445c3051f017600b27999f0d666b7d63b04.zip
Fix a couple of harmless clang3.2 warnings
-rw-r--r--changes/clang_enum_warnings3
-rw-r--r--src/common/crypto.c2
-rw-r--r--src/or/dirvote.c4
3 files changed, 6 insertions, 3 deletions
diff --git a/changes/clang_enum_warnings b/changes/clang_enum_warnings
new file mode 100644
index 0000000000..50de605fc8
--- /dev/null
+++ b/changes/clang_enum_warnings
@@ -0,0 +1,3 @@
+ o Code simplifications and refactoring:
+ - Get rid of a couple of harmless clang warnings, where we compared
+ enums to ints. These warnings are newly introduced in clang 3.2.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 39f5a4a642..4cf9a9cdb0 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1458,7 +1458,7 @@ crypto_digest256(char *digest, const char *m, size_t len,
int
crypto_digest_all(digests_t *ds_out, const char *m, size_t len)
{
- digest_algorithm_t i;
+ int i;
tor_assert(ds_out);
memset(ds_out, 0, sizeof(*ds_out));
if (crypto_digest(ds_out->d[DIGEST_SHA1], m, len) < 0)
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 1b9af0f731..3000ee26e5 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2223,7 +2223,7 @@ networkstatus_add_detached_signatures(networkstatus_t *target,
{
digests_t *digests = strmap_get(sigs->digests, flavor);
int n_matches = 0;
- digest_algorithm_t alg;
+ int alg;
if (!digests) {
*msg_out = "No digests for given consensus flavor";
return -1;
@@ -3471,7 +3471,7 @@ dirvote_free_all(void)
const char *
dirvote_get_pending_consensus(consensus_flavor_t flav)
{
- tor_assert(((int)flav) >= 0 && flav < N_CONSENSUS_FLAVORS);
+ tor_assert(((int)flav) >= 0 && (int)flav < N_CONSENSUS_FLAVORS);
return pending_consensuses[flav].body;
}