From: <ric...@us...> - 2013-06-24 06:09:37
|
Revision: 1189 http://sourceforge.net/p/loki-lib/code/1189 Author: rich_sposato Date: 2013-06-24 06:09:34 +0000 (Mon, 24 Jun 2013) Log Message: ----------- Use std namespace for C string functions. Modified Paths: -------------- trunk/include/loki/SafeFormat.h trunk/src/SafeFormat.cpp Modified: trunk/include/loki/SafeFormat.h =================================================================== --- trunk/include/loki/SafeFormat.h 2013-06-24 06:08:05 UTC (rev 1188) +++ trunk/include/loki/SafeFormat.h 2013-06-24 06:09:34 UTC (rev 1189) @@ -35,7 +35,6 @@ #include <cstdio> #include <climits> -#include <string> #include <cstring> #include <stdexcept> #include <utility> @@ -254,7 +253,7 @@ result_ = -1; return *this; } - const size_t len = std::min(std::strlen(s), prec_); + const size_t len = std::min(::std::strlen(s), prec_); if (width_ > len) { if (LeftJustify()) { Write(s, s + len); @@ -309,7 +308,7 @@ SetAlternateForm(); // printed with '0x' in front isSigned = true; // that's what gcc does } - if (!strchr("cdiuoxX", formatChar)) { + if (!::std::strchr("cdiuoxX", formatChar)) { result_ = -1; return; } @@ -404,7 +403,7 @@ // enforce format string validity ReadLeaders(); // enforce format spec - if (!strchr(check_fmt_char, *format_)) { + if (!::std::strchr(check_fmt_char, *format_)) { result_ = -1; return; } @@ -434,7 +433,7 @@ result_ = -1; return; } - Write(resultBuf, resultBuf + strlen(resultBuf)); + Write(resultBuf, resultBuf + ::std::strlen(resultBuf)); Advance(); // output stuff to the next format directive } Modified: trunk/src/SafeFormat.cpp =================================================================== --- trunk/src/SafeFormat.cpp 2013-06-24 06:08:05 UTC (rev 1188) +++ trunk/src/SafeFormat.cpp 2013-06-24 06:09:34 UTC (rev 1189) @@ -132,7 +132,7 @@ } PrintfState<std::string&, char> SPrintf(std::string& s, const char* format) { - const size_t estimate = ::strlen( format ) + 128; + const size_t estimate = ::std::strlen( format ) + 128; s.reserve( estimate ); return PrintfState<std::string&, char>(s, format); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |