diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-21 21:57:47 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-21 21:57:47 +0000 |
commit | 69300eb606732a35eff5c2e150cf71667df59d3f (patch) | |
tree | 9f8f1f062957ed8812fa023ab72724d004459f6b /src/common/ht.h | |
parent | b375472d14cb9165e3acab899e4388a36c03bf25 (diff) | |
download | tor-69300eb606732a35eff5c2e150cf71667df59d3f.tar.gz tor-69300eb606732a35eff5c2e150cf71667df59d3f.zip |
r14374@tombo: nickm | 2008-02-21 16:57:39 -0500
Fix all remaining shorten-64-to-32 errors in src/common. Some were genuine problems. Many were compatibility errors with libraries (openssl, zlib) that like predate size_t. Partial backport candidate.
svn:r13665
Diffstat (limited to 'src/common/ht.h')
-rw-r--r-- | src/common/ht.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/ht.h b/src/common/ht.h index 61792cb8b4..762f836bd3 100644 --- a/src/common/ht.h +++ b/src/common/ht.h @@ -90,7 +90,8 @@ ht_string_hash(const char *s) while (*cp) { h = (1000003*h) ^ *cp++; } - h ^= (cp-(const unsigned char*)s); + /* This conversion truncates the length of the string, but that's ok. */ + h ^= (unsigned)(cp-(const unsigned char*)s); return h; } @@ -287,7 +288,7 @@ ht_string_hash(const char *s) 805306457, 1610612741 \ }; \ static unsigned name##_N_PRIMES = \ - sizeof(name##_PRIMES)/sizeof(name##_PRIMES[0]); \ + (unsigned)(sizeof(name##_PRIMES)/sizeof(name##_PRIMES[0])); \ /* Expand the internal table of 'head' until it is large enough to \ * hold 'size' elements. Return 0 on success, -1 on allocation \ * failure. */ \ |