]> git.lyx.org Git - features.git/blobdiff - boost/boost/functional/hash/detail/hash_float_x86.hpp
boost: add eol property
[features.git] / boost / boost / functional / hash / detail / hash_float_x86.hpp
index ee8e75810bedf243bae260dcd37af8e64f414f92..b39bb0d081767474f48554feae091c10052d1022 100644 (file)
@@ -1,56 +1,56 @@
-\r
-// Copyright 2005-2009 Daniel James.\r
-// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
-\r
-// A non-portable hash function form non-zero floats on x86.\r
-//\r
-// Even if you're on an x86 platform, this might not work if their floating\r
-// point isn't set up as this expects. So this should only be used if it's\r
-// absolutely certain that it will work.\r
-\r
-#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER)\r
-#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER\r
-\r
-#include <boost/cstdint.hpp>\r
-\r
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
-# pragma once\r
-#endif\r
-\r
-namespace boost\r
-{\r
-    namespace hash_detail\r
-    {\r
-        inline void hash_float_combine(std::size_t& seed, std::size_t value)\r
-        {\r
-            seed ^= value + (seed<<6) + (seed>>2);\r
-        }\r
-\r
-        inline std::size_t float_hash_impl(float v)\r
-        {\r
-            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
-            std::size_t seed = *ptr;\r
-            return seed;\r
-        }\r
-\r
-        inline std::size_t float_hash_impl(double v)\r
-        {\r
-            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
-            std::size_t seed = *ptr++;\r
-            hash_float_combine(seed, *ptr);\r
-            return seed;\r
-        }\r
-\r
-        inline std::size_t float_hash_impl(long double v)\r
-        {\r
-            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
-            std::size_t seed = *ptr++;\r
-            hash_float_combine(seed, *ptr++);\r
-            hash_float_combine(seed, *(boost::uint16_t*)ptr);\r
-            return seed;\r
-        }\r
-    }\r
-}\r
-\r
-#endif\r
+
+// Copyright 2005-2009 Daniel James.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// A non-portable hash function form non-zero floats on x86.
+//
+// Even if you're on an x86 platform, this might not work if their floating
+// point isn't set up as this expects. So this should only be used if it's
+// absolutely certain that it will work.
+
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER)
+#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER
+
+#include <boost/cstdint.hpp>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+namespace boost
+{
+    namespace hash_detail
+    {
+        inline void hash_float_combine(std::size_t& seed, std::size_t value)
+        {
+            seed ^= value + (seed<<6) + (seed>>2);
+        }
+
+        inline std::size_t float_hash_impl(float v)
+        {
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;
+            std::size_t seed = *ptr;
+            return seed;
+        }
+
+        inline std::size_t float_hash_impl(double v)
+        {
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;
+            std::size_t seed = *ptr++;
+            hash_float_combine(seed, *ptr);
+            return seed;
+        }
+
+        inline std::size_t float_hash_impl(long double v)
+        {
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;
+            std::size_t seed = *ptr++;
+            hash_float_combine(seed, *ptr++);
+            hash_float_combine(seed, *(boost::uint16_t*)ptr);
+            return seed;
+        }
+    }
+}
+
+#endif