Bug 1047176 - Part 3: Cast to unsigned char in HashString. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Mon, 04 Aug 2014 11:29:33 -0700
changeset 197743 eb28e68b76fa53f02776dbed3c2639b04af81a4c
parent 197742 151a16abe0bdb2b1e6fc5fcf3907ea3890a04b96
child 197744 ca9fa41e977c99f772995a5e0ad9e25327d90c89
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersfroydnj
bugs1047176
milestone34.0a1
Bug 1047176 - Part 3: Cast to unsigned char in HashString. r=froydnj
mfbt/HashFunctions.h
--- a/mfbt/HashFunctions.h
+++ b/mfbt/HashFunctions.h
@@ -287,23 +287,23 @@ HashKnownLength(const T* aStr, size_t aL
  * The HashString overloads below do just what you'd expect.
  *
  * If you have the string's length, you might as well call the overload which
  * includes the length.  It may be marginally faster.
  */
 MOZ_WARN_UNUSED_RESULT inline uint32_t
 HashString(const char* aStr)
 {
-  return detail::HashUntilZero(aStr);
+  return detail::HashUntilZero(reinterpret_cast<const unsigned char*>(aStr));
 }
 
 MOZ_WARN_UNUSED_RESULT inline uint32_t
 HashString(const char* aStr, size_t aLength)
 {
-  return detail::HashKnownLength(aStr, aLength);
+  return detail::HashKnownLength(reinterpret_cast<const unsigned char*>(aStr), aLength);
 }
 
 MOZ_WARN_UNUSED_RESULT
 inline uint32_t
 HashString(const unsigned char* aStr, size_t aLength)
 {
   return detail::HashKnownLength(aStr, aLength);
 }