summaryrefslogtreecommitdiff
path: root/boost/align/detail/align_down.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/align/detail/align_down.hpp')
-rw-r--r--boost/align/detail/align_down.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/boost/align/detail/align_down.hpp b/boost/align/detail/align_down.hpp
index 97e1c1d3eb..9a8c358c41 100644
--- a/boost/align/detail/align_down.hpp
+++ b/boost/align/detail/align_down.hpp
@@ -1,28 +1,28 @@
/*
-(c) 2015 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
+Copyright 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)
*/
#ifndef BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP
#include <boost/align/detail/is_alignment.hpp>
-#include <boost/align/align_down_forward.hpp>
#include <boost/assert.hpp>
namespace boost {
namespace alignment {
-inline void* align_down(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
+inline void*
+align_down(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
{
BOOST_ASSERT(detail::is_alignment(alignment));
- return (void*)(align_down((std::size_t)ptr, alignment));
+ return reinterpret_cast<void*>(reinterpret_cast<std::
+ size_t>(ptr) & ~(alignment - 1));
}
-} /* .alignment */
-} /* .boost */
+} /* alignment */
+} /* boost */
#endif