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 197764 eb28e68b76fa53f02776dbed3c2639b04af81a4c
parent 197763 151a16abe0bdb2b1e6fc5fcf3907ea3890a04b96
child 197765 ca9fa41e977c99f772995a5e0ad9e25327d90c89
push id8052
push useremorley@mozilla.com
push dateTue, 05 Aug 2014 15:34:10 +0000
treeherderfx-team@a5be9b4e46e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);
 }