Remove redundant .c_str()s
After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
This commit is contained in:
10
src/util.cpp
10
src/util.cpp
@@ -945,13 +945,13 @@ static std::string FormatException(std::exception* pex, const char* pszThread)
|
||||
void LogException(std::exception* pex, const char* pszThread)
|
||||
{
|
||||
std::string message = FormatException(pex, pszThread);
|
||||
LogPrintf("\n%s", message.c_str());
|
||||
LogPrintf("\n%s", message);
|
||||
}
|
||||
|
||||
void PrintException(std::exception* pex, const char* pszThread)
|
||||
{
|
||||
std::string message = FormatException(pex, pszThread);
|
||||
LogPrintf("\n\n************************\n%s\n", message.c_str());
|
||||
LogPrintf("\n\n************************\n%s\n", message);
|
||||
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
|
||||
strMiscWarning = message;
|
||||
throw;
|
||||
@@ -960,7 +960,7 @@ void PrintException(std::exception* pex, const char* pszThread)
|
||||
void PrintExceptionContinue(std::exception* pex, const char* pszThread)
|
||||
{
|
||||
std::string message = FormatException(pex, pszThread);
|
||||
LogPrintf("\n\n************************\n%s\n", message.c_str());
|
||||
LogPrintf("\n\n************************\n%s\n", message);
|
||||
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
|
||||
strMiscWarning = message;
|
||||
}
|
||||
@@ -1305,7 +1305,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime)
|
||||
fDone = true;
|
||||
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.");
|
||||
strMiscWarning = strMessage;
|
||||
LogPrintf("*** %s\n", strMessage.c_str());
|
||||
LogPrintf("*** %s\n", strMessage);
|
||||
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
|
||||
}
|
||||
}
|
||||
@@ -1408,7 +1408,7 @@ void runCommand(std::string strCommand)
|
||||
{
|
||||
int nErr = ::system(strCommand.c_str());
|
||||
if (nErr)
|
||||
LogPrintf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr);
|
||||
LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr);
|
||||
}
|
||||
|
||||
void RenameThread(const char* name)
|
||||
|
||||
Reference in New Issue
Block a user