diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-10 16:23:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-11 16:12:51 -0400 |
commit | db7b2a33eef9c8d432442b072f9c8868a068bb91 (patch) | |
tree | ce364a8c6abea10a8e21460cdc205f590cb820d5 /src/common/container.c | |
parent | 1d703ed22b249567c2df31db9035a4dda66483ca (diff) | |
download | tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar.gz tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.zip |
Automated conversion of memcmp to tor_memcmp/tor_mem[n]eq
This commit is _exactly_ the result of
perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch]
perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch]
perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch]
perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch]
git checkout src/common/di_ops.[ch]
git checkout src/or/test.c
git checkout src/common/test.h
Diffstat (limited to 'src/common/container.c')
-rw-r--r-- | src/common/container.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/container.c b/src/common/container.c index 977d604071..d1d5ce339d 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -215,7 +215,7 @@ smartlist_string_num_isin(const smartlist_t *sl, int num) } /** Return true iff <b>sl</b> has some element E such that - * !memcmp(E,<b>element</b>,DIGEST_LEN) + * tor_memeq(E,<b>element</b>,DIGEST_LEN) */ int smartlist_digest_isin(const smartlist_t *sl, const char *element) @@ -223,7 +223,7 @@ smartlist_digest_isin(const smartlist_t *sl, const char *element) int i; if (!sl) return 0; for (i=0; i < sl->num_used; i++) - if (memcmp((const char*)sl->list[i],element,DIGEST_LEN)==0) + if (tor_memcmp((const char*)sl->list[i],element,DIGEST_LEN)==0) return 1; return 0; } @@ -663,7 +663,7 @@ smartlist_pqueue_assert_ok(smartlist_t *sl, static int _compare_digests(const void **_a, const void **_b) { - return memcmp((const char*)*_a, (const char*)*_b, DIGEST_LEN); + return tor_memcmp((const char*)*_a, (const char*)*_b, DIGEST_LEN); } /** Sort the list of DIGEST_LEN-byte digests into ascending order. */ @@ -716,7 +716,7 @@ strmap_entry_hash(const strmap_entry_t *a) static INLINE int digestmap_entries_eq(const digestmap_entry_t *a, const digestmap_entry_t *b) { - return !memcmp(a->key, b->key, DIGEST_LEN); + return tor_memeq(a->key, b->key, DIGEST_LEN); } /** Helper: return a hash value for a digest_map_t. */ |