Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57394 - trunk/boost/wave/util
From: hartmut.kaiser_at_[hidden]
Date: 2009-11-04 19:27:00


Author: hkaiser
Date: 2009-11-04 19:26:59 EST (Wed, 04 Nov 2009)
New Revision: 57394
URL: http://svn.boost.org/trac/boost/changeset/57394

Log:
Wave: fixed another strict alias warning issued bz gcc
Text files modified:
   trunk/boost/wave/util/flex_string.hpp | 13 +++++++++----
   1 files changed, 9 insertions(+), 4 deletions(-)

Modified: trunk/boost/wave/util/flex_string.hpp
==============================================================================
--- trunk/boost/wave/util/flex_string.hpp (original)
+++ trunk/boost/wave/util/flex_string.hpp 2009-11-04 19:26:59 EST (Wed, 04 Nov 2009)
@@ -647,7 +647,7 @@
 
     iterator begin()
     { return pData_->buffer_; }
-
+
     const_iterator begin() const
     { return pData_->buffer_; }
 
@@ -692,7 +692,7 @@
         newStr.Init(size(), res_arg);
 
         flex_string_details::pod_copy(begin(), end(), newStr.begin());
-
+
         swap(newStr);
     }
 
@@ -1207,7 +1207,10 @@
     };
 
     Storage& Data() const
- { Storage* v= reinterpret_cast<Storage*>(buf_); return *v; }
+ {
+ Storage* p = reinterpret_cast<Storage*>(&buf_[0]);
+ return *p;
+ }
 
     RefCountType GetRefs() const
     {
@@ -1236,8 +1239,10 @@
         } temp;
 
         --(*Data().begin()); // decrement the use count of the remaining object
+
+ Storage* p = reinterpret_cast<Storage*>(&temp.buf_[0]);
         new(buf_) Storage(
- *new(temp.buf_) Storage(Data()),
+ *new(p) Storage(Data()),
             flex_string_details::Shallow());
         *Data().begin() = 1;
     }


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