Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62705 - trunk/boost/pool
From: steven_at_[hidden]
Date: 2010-06-09 21:46:38


Author: steven_watanabe
Date: 2010-06-09 21:46:37 EDT (Wed, 09 Jun 2010)
New Revision: 62705
URL: http://svn.boost.org/trac/boost/changeset/62705

Log:
Use static_cast instead of reinterpret_cast. Fixes #2941
Text files modified:
   trunk/boost/pool/pool.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/boost/pool/pool.hpp
==============================================================================
--- trunk/boost/pool/pool.hpp (original)
+++ trunk/boost/pool/pool.hpp 2010-06-09 21:46:37 EDT (Wed, 09 Jun 2010)
@@ -63,7 +63,7 @@
   typedef std::ptrdiff_t difference_type;
 
   static char * malloc(const size_type bytes)
- { return reinterpret_cast<char *>(std::malloc(bytes)); }
+ { return static_cast<char *>(std::malloc(bytes)); }
   static void free(char * const block)
   { std::free(block); }
 };
@@ -113,9 +113,11 @@
     }
 
     size_type & next_size() const
- { return *(reinterpret_cast<size_type *>(ptr_next_size())); }
+ {
+ return *(static_cast<size_type *>(static_cast<void*>((ptr_next_size()))));
+ }
     char * & next_ptr() const
- { return *(reinterpret_cast<char **>(ptr_next_ptr())); }
+ { return *(static_cast<char **>(static_cast<void*>(ptr_next_ptr()))); }
 
     PODptr next() const
     { return PODptr<size_type>(next_ptr(), next_size()); }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk