zhaopuming / quickfast

Automatically exported from code.google.com/p/quickfast
Other
1 stars 0 forks source link

reinterpret_cast discards const in StringBuffer.h #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Got an error when compiling with clang because a reinterpret_cast was 
discarding the const modifier in StringBuffer.h

Here's the patch that corrects the issue:

diff --git a/src/external/quickfast/Common/StringBuffer.h 
b/src/external/quickfast/Common/StringBuffer.h
index 1f48568..0b4269d 100644
--- a/src/external/quickfast/Common/StringBuffer.h
+++ b/src/external/quickfast/Common/StringBuffer.h
@@ -101,7 +101,7 @@ namespace QuickFAST
       , growCount_(0)
       , delegateString_(0)
     {
-      assign(rhs, std::strlen(reinterpret_cast<char *>(rhs)));
+      assign(rhs, std::strlen(reinterpret_cast<const char *>(rhs)));
     }

     /// @brief Construct from a C style null terminated string

Original issue reported on code.google.com by yi.s.d...@gmail.com on 26 Aug 2012 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by dale.wil...@gmail.com on 21 Jan 2013 at 4:30