]> git.kaiwu.me - klib.git/commitdiff
Add type casts to avoid warnings
authorRussell Belfer <rb@github.com>
Fri, 31 Aug 2012 23:13:18 +0000 (16:13 -0700)
committerRussell Belfer <rb@github.com>
Fri, 31 Aug 2012 23:13:18 +0000 (16:13 -0700)
On some build platforms, the assignments in the hash string fn
were generating warning messages.  This clears those up.

khash.h

diff --git a/khash.h b/khash.h
index afa2e16585ca027d3e220ca61de2e574e88470ba..0333510332c5551efd8f4d383f878f05d1db94e9 100644 (file)
--- a/khash.h
+++ b/khash.h
@@ -378,8 +378,8 @@ static const double __ac_HASH_UPPER = 0.77;
  */
 static kh_inline khint_t __ac_X31_hash_string(const char *s)
 {
-       khint_t h = *s;
-       if (h) for (++s ; *s; ++s) h = (h << 5) - h + *s;
+       khint_t h = (khint_t)*s;
+       if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)*s;
        return h;
 }
 /*! @function