// 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
// 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
{
namespace std
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if __SIZEOF_SIZE_T__ == 4
// Implementation of Murmur hash for 32-bit size_t.
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.
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
{ return _Hash_bytes(ptr, len, seed); }
#endif /* __SIZEOF_SIZE_T__ */
-}
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace