summaryrefslogtreecommitdiff
path: root/boost/align/detail/align_up.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/align/detail/align_up.hpp')
-rw-r--r--boost/align/detail/align_up.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/boost/align/detail/align_up.hpp b/boost/align/detail/align_up.hpp
index e956f7a046..86686da6ae 100644
--- a/boost/align/detail/align_up.hpp
+++ b/boost/align/detail/align_up.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_UP_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_UP_HPP
#include <boost/align/detail/is_alignment.hpp>
-#include <boost/align/align_up_forward.hpp>
#include <boost/assert.hpp>
namespace boost {
namespace alignment {
-inline void* align_up(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
+inline void*
+align_up(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
{
BOOST_ASSERT(detail::is_alignment(alignment));
- return (void*)(align_up((std::size_t)ptr, alignment));
+ return reinterpret_cast<void*>((reinterpret_cast<std::
+ size_t>(ptr) + alignment - 1) & ~(alignment - 1));
}
-} /* .alignment */
-} /* .boost */
+} /* alignment */
+} /* boost */
#endif