Change ENABLE_VALGRIND_CHECKING to
[gcc.git] / libstdc++-v3 / libsupc++ / hash_bytes.cc
index a247a11492e5c0c9ed022b1584192c70fdbae2ab..2e5bbfaca1968d13fff3ece26bbdabc5096baa55 100644 (file)
@@ -1,6 +1,6 @@
 // Definition of _Hash_bytes. -*- C++ -*-
 
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010-2016 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -32,7 +32,7 @@
 // function apears to be better in both speed and hash quality, and
 // FNV is provided primarily for backward compatibility.
 
-#include <bits/c++config.h>
+#include <bits/hash_bytes.h>
 
 namespace
 {
@@ -65,6 +65,8 @@ namespace
 
 namespace std
 {
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
 #if __SIZEOF_SIZE_T__ == 4
 
   // Implementation of Murmur hash for 32-bit size_t.
@@ -97,7 +99,7 @@ namespace std
        hash ^= static_cast<unsigned char>(buf[1]) << 8;
       case 1:
        hash ^= static_cast<unsigned char>(buf[0]);
-        hash *= m;
+       hash *= m;
       };
 
     // Do a few final mixes of the hash.
@@ -126,7 +128,8 @@ namespace std
   size_t
   _Hash_bytes(const void* ptr, size_t len, size_t seed)
   {
-    static const size_t mul = (0xc6a4a793UL << 32UL) + 0x5bd1e995UL;
+    static const size_t mul = (((size_t) 0xc6a4a793UL) << 32UL)
+                             + (size_t) 0x5bd1e995UL;
     const char* const buf = static_cast<const char*>(ptr);
 
     // Remove the bytes not divisible by the sizeof(size_t).  This
@@ -182,4 +185,6 @@ namespace std
   { return _Hash_bytes(ptr, len, seed); }
 
 #endif /* __SIZEOF_SIZE_T__ */
-}
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace