aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-16 16:15:27 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-23 16:05:01 +0100
commit7d9d134bf95cb6a2ce9623c7e6a3535432a61af2 (patch)
treeeeca53e065947846648d9373f240d593c0c0ecfc /src/db.cpp
parentb77dfdc9e36e308aa806d63aa3b5628971789d5a (diff)
downloadbitcoin-7d9d134bf95cb6a2ce9623c7e6a3535432a61af2.tar.xz
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.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 1f2ee1c554..51c28cda69 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -75,7 +75,7 @@ bool CDBEnv::Open(const boost::filesystem::path& pathIn)
filesystem::path pathLogDir = path / "database";
filesystem::create_directory(pathLogDir);
filesystem::path pathErrorFile = path / "db.log";
- LogPrintf("dbenv.open LogDir=%s ErrorFile=%s\n", pathLogDir.string().c_str(), pathErrorFile.string().c_str());
+ LogPrintf("dbenv.open LogDir=%s ErrorFile=%s\n", pathLogDir.string(), pathErrorFile.string());
unsigned int nEnvFlags = 0;
if (GetBoolArg("-privdb", true))
@@ -353,7 +353,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
bitdb.mapFileUseCount.erase(strFile);
bool fSuccess = true;
- LogPrintf("Rewriting %s...\n", strFile.c_str());
+ LogPrintf("Rewriting %s...\n", strFile);
string strFileRes = strFile + ".rewrite";
{ // surround usage of db with extra {}
CDB db(strFile.c_str(), "r");
@@ -367,7 +367,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
0);
if (ret > 0)
{
- LogPrintf("Cannot create database file %s\n", strFileRes.c_str());
+ LogPrintf("Cannot create database file %s\n", strFileRes);
fSuccess = false;
}
@@ -423,7 +423,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
fSuccess = false;
}
if (!fSuccess)
- LogPrintf("Rewriting of %s FAILED!\n", strFileRes.c_str());
+ LogPrintf("Rewriting of %s FAILED!\n", strFileRes);
return fSuccess;
}
}
@@ -448,17 +448,17 @@ void CDBEnv::Flush(bool fShutdown)
{
string strFile = (*mi).first;
int nRefCount = (*mi).second;
- LogPrint("db", "%s refcount=%d\n", strFile.c_str(), nRefCount);
+ LogPrint("db", "%s refcount=%d\n", strFile, nRefCount);
if (nRefCount == 0)
{
// Move log data to the dat file
CloseDb(strFile);
- LogPrint("db", "%s checkpoint\n", strFile.c_str());
+ LogPrint("db", "%s checkpoint\n", strFile);
dbenv.txn_checkpoint(0, 0, 0);
- LogPrint("db", "%s detach\n", strFile.c_str());
+ LogPrint("db", "%s detach\n", strFile);
if (!fMockDb)
dbenv.lsn_reset(strFile.c_str(), 0);
- LogPrint("db", "%s closed\n", strFile.c_str());
+ LogPrint("db", "%s closed\n", strFile);
mapFileUseCount.erase(mi++);
}
else