summaryrefslogtreecommitdiff
path: root/boost/align/detail/align.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/align/detail/align.hpp')
-rw-r--r--boost/align/detail/align.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/boost/align/detail/align.hpp b/boost/align/detail/align.hpp
index 77055e0328..a58dcea747 100644
--- a/boost/align/detail/align.hpp
+++ b/boost/align/detail/align.hpp
@@ -1,10 +1,9 @@
/*
-(c) 2014-2016 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
+Copyright 2014-2016 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_HPP
#define BOOST_ALIGN_DETAIL_ALIGN_HPP
@@ -15,13 +14,14 @@ http://boost.org/LICENSE_1_0.txt
namespace boost {
namespace alignment {
-inline void* align(std::size_t alignment, std::size_t size,
- void*& ptr, std::size_t& space)
+inline void*
+align(std::size_t alignment, std::size_t size, void*& ptr,
+ std::size_t& space)
{
BOOST_ASSERT(detail::is_alignment(alignment));
if (size <= space) {
- char* p = (char*)(((std::size_t)ptr + alignment - 1) &
- ~(alignment - 1));
+ char* p = reinterpret_cast<char*>((reinterpret_cast<std::
+ size_t>(ptr) + alignment - 1) & ~(alignment - 1));
std::size_t n = space - (p - static_cast<char*>(ptr));
if (size <= n) {
ptr = p;
@@ -32,7 +32,7 @@ inline void* align(std::size_t alignment, std::size_t size,
return 0;
}
-} /* .alignment */
-} /* .boost */
+} /* alignment */
+} /* boost */
#endif