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 id27250
push useremorley@mozilla.com
push dateTue, 05 Aug 2014 14:25:40 +0000
treeherdermozilla-central@2aaedcdf69f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1047176
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);
 }