From: <ric...@us...> - 2012-04-02 06:01:57
|
Revision: 1179 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1179&view=rev Author: rich_sposato Date: 2012-04-02 06:01:51 +0000 (Mon, 02 Apr 2012) Log Message: ----------- Fixed bug 3509427 by adding use of Loki::TypeTraits. Modified Paths: -------------- trunk/include/loki/SafeFormat.h trunk/src/SafeFormat.cpp Modified: trunk/include/loki/SafeFormat.h =================================================================== --- trunk/include/loki/SafeFormat.h 2012-04-02 05:49:21 UTC (rev 1178) +++ trunk/include/loki/SafeFormat.h 2012-04-02 06:01:51 UTC (rev 1179) @@ -44,6 +44,7 @@ #include <iostream> #include <loki/LokiExport.h> +#include <loki/TypeTraits.h> // long is 32 bit on 64-bit Windows! @@ -132,7 +133,7 @@ another device type. It is not for public use. */ template < class Device2 > - PrintfState< Device2, Char > ChangeDevice( Device2 & device ) const + PrintfState< Device2, Char > ChangeDevice( typename Loki::TypeTraits< Device2 >::ParameterType device ) const { return PrintfState< Device2, Char >( device, format_, width_, prec_, flags_, result_ ); } Modified: trunk/src/SafeFormat.cpp =================================================================== --- trunk/src/SafeFormat.cpp 2012-04-02 05:49:21 UTC (rev 1178) +++ trunk/src/SafeFormat.cpp 2012-04-02 06:01:51 UTC (rev 1179) @@ -70,7 +70,7 @@ const PrintfState< ::std::string &, char > state1( buffer, format ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), stdout ); ::std::FILE * f = stdout; - PrintfState< std::FILE *, char > printState2( state1.ChangeDevice( f ) ); + PrintfState< std::FILE *, char > printState2( state1.ChangeDevice< ::std::FILE * >( f ) ); return printState2; } @@ -79,7 +79,7 @@ const PrintfState< ::std::string &, char > state1( buffer, format.c_str() ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), stdout ); ::std::FILE * f = stdout; - PrintfState< std::FILE *, char > printState2( state1.ChangeDevice( f ) ); + PrintfState< std::FILE *, char > printState2( state1.ChangeDevice< ::std::FILE * >( f ) ); return printState2; } @@ -87,7 +87,7 @@ ::std::string buffer; const PrintfState< ::std::string &, char > state1( buffer, format ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), f ); - PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice( f ); + PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice< ::std::FILE * >( f ); return printState2; } @@ -95,7 +95,7 @@ ::std::string buffer; const PrintfState< ::std::string &, char > state1( buffer, format.c_str() ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), f ); - PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice( f ); + PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice< ::std::FILE * >( f ); return printState2; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |