Various warning fixes and devirtualization

* Remove ArrayString
* devirtualize GetCount and SetCount, they're no longer needed
* set storage duration of fmt::placeholder to extern to be consistent
* make length unsigned and the return value of sprintf signed
* remove dead code "s.Close()" is never reached
* devirtualize WrteToLog()
* devirtualize Ini functions
This commit is contained in:
Peter Tissen 2014-04-08 19:29:17 +02:00
parent 1975b7e139
commit 4066950975
6 changed files with 21 additions and 113 deletions

View file

@ -78,13 +78,13 @@ namespace fmt{
template<typename ... Args>
string Format(const string &fmt, Args&& ... parameters)
{
int length = 256;
size_t length = 256;
string str;
for (;;)
{
std::vector<char> buffptr(length);
size_t printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward<Args>(parameters)...);
int printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward<Args>(parameters)...);
if (printlen >= 0 && printlen < length)
{
str = string(buffptr.data(), printlen);