]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/align/test/is_aligned_test.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / align / test / is_aligned_test.cpp
index ccc8c86e00db0b788ee9f4c6cf895b613420dcaa..72600543230a8f1226db3b51cfbc4926b61b6b97 100644 (file)
@@ -1,10 +1,9 @@
 /*
-(c) 2014-2015 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
+Copyright 2014-2015 Glen Joseph Fernandes
+(glenjofe@gmail.com)
 
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
 */
 #include <boost/align/alignment_of.hpp>
 #include <boost/align/is_aligned.hpp>
@@ -14,15 +13,14 @@ http://boost.org/LICENSE_1_0.txt
 template<std::size_t N>
 struct A { };
 
-template<class T, std::size_t N>
-void test(T* p, A<N>)
+template<std::size_t N>
+void test(char* p, A<N>)
 {
     BOOST_TEST(boost::alignment::is_aligned(p, N));
-    BOOST_TEST(!boost::alignment::is_aligned((char*)p + 1, N));
+    BOOST_TEST(!boost::alignment::is_aligned(p + 1, N));
 }
 
-template<class T>
-void test(T* p, A<1>)
+void test(char* p, A<1>)
 {
     BOOST_TEST(boost::alignment::is_aligned(p, 1));
 }
@@ -31,7 +29,8 @@ template<class T>
 void test()
 {
     T o;
-    test(&o, A<boost::alignment::alignment_of<T>::value>());
+    test(reinterpret_cast<char*>(&o),
+        A<boost::alignment::alignment_of<T>::value>());
 }
 
 class X;
@@ -54,7 +53,7 @@ int main()
     test<long long>();
 #endif
     test<float>();
-#if !defined(_MSC_VER)
+#if !defined(BOOST_MSVC)
     test<double>();
     test<long double>();
 #endif
@@ -63,7 +62,7 @@ int main()
     test<int*>();
     test<X*>();
     test<void(*)()>();
-#if !defined(_MSC_VER)
+#if !defined(BOOST_MSVC)
     test<int X::*>();
     test<int(X::*)()>();
 #endif