mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12:00
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:
parent
1975b7e139
commit
4066950975
6 changed files with 21 additions and 113 deletions
|
@ -1,20 +1,20 @@
|
|||
#include "stdafx.h"
|
||||
#include "StrFmt.h"
|
||||
|
||||
static const std::string fmt::placeholder = "???";
|
||||
extern const std::string fmt::placeholder = "???";
|
||||
|
||||
|
||||
//wrapper to deal with advance sprintf formating options with automatic length finding
|
||||
//can't take strings by reference because of "va_start", so overload it with char *
|
||||
std::string fmt::FormatV(const char *fmt, va_list args)
|
||||
{
|
||||
int length = 256;
|
||||
size_t length = 256;
|
||||
std::string str;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
std::vector<char> buffptr(length);
|
||||
size_t printlen = vsnprintf(buffptr.data(), length, fmt, args);
|
||||
int printlen = vsnprintf(buffptr.data(), length, fmt, args);
|
||||
if (printlen >= 0 && printlen < length)
|
||||
{
|
||||
str = std::string(buffptr.data(), printlen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue