aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorR E Broadley <rebroad+github@gmail.com>2014-05-21 18:50:46 +0800
committerR E Broadley <rebroad+github@gmail.com>2014-05-22 00:23:03 +0700
commit79d06dc6e07103b31b530f71b7187ea82c34266b (patch)
tree8a01bf8e5bc367115d4b58a7969b44c35cabe096 /src
parent6fcdad787f1fb381a3a0fe6b1a1e45477426dccb (diff)
Remove redundant c_str
Diffstat (limited to 'src')
-rw-r--r--src/addrman.h4
-rw-r--r--src/init.cpp2
-rw-r--r--src/leveldbwrapper.h4
-rw-r--r--src/main.h12
-rw-r--r--src/net.h2
-rw-r--r--src/script.h2
-rw-r--r--src/wallet.h4
7 files changed, 15 insertions, 15 deletions
diff --git a/src/addrman.h b/src/addrman.h
index e2b0cb1093..5328a93b45 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -420,7 +420,7 @@ public:
Check();
}
if (fRet)
- LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew);
+ LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString(), nTried, nNew);
return fRet;
}
@@ -436,7 +436,7 @@ public:
Check();
}
if (nAdd)
- LogPrint("addrman", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew);
+ LogPrint("addrman", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString(), nTried, nNew);
return nAdd > 0;
}
diff --git a/src/init.cpp b/src/init.cpp
index 7664988762..bc4924b48d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -914,7 +914,7 @@ bool AppInit2(boost::thread_group& threadGroup)
for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
uint256 hash = (*mi).first;
- if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0)
+ if (boost::algorithm::starts_with(hash.ToString(), strMatch))
{
CBlockIndex* pindex = (*mi).second;
CBlock block;
diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h
index 53e9e439bd..043a56bf38 100644
--- a/src/leveldbwrapper.h
+++ b/src/leveldbwrapper.h
@@ -93,7 +93,7 @@ public:
if (!status.ok()) {
if (status.IsNotFound())
return false;
- LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str());
+ LogPrintf("LevelDB read failure: %s\n", status.ToString());
HandleError(status);
}
try {
@@ -122,7 +122,7 @@ public:
if (!status.ok()) {
if (status.IsNotFound())
return false;
- LogPrintf("LevelDB read failure: %s\n", status.ToString().c_str());
+ LogPrintf("LevelDB read failure: %s\n", status.ToString());
HandleError(status);
}
return true;
diff --git a/src/main.h b/src/main.h
index f47c9ee825..1dc48c0af8 100644
--- a/src/main.h
+++ b/src/main.h
@@ -862,13 +862,13 @@ public:
{
return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, nHeight,
- hashMerkleRoot.ToString().c_str(),
- GetBlockHash().ToString().c_str());
+ hashMerkleRoot.ToString(),
+ GetBlockHash().ToString());
}
void print() const
{
- LogPrintf("%s\n", ToString().c_str());
+ LogPrintf("%s\n", ToString());
}
// Check whether this block index entry is valid up to the passed validity level.
@@ -953,14 +953,14 @@ public:
std::string str = "CDiskBlockIndex(";
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
- GetBlockHash().ToString().c_str(),
- hashPrev.ToString().c_str());
+ GetBlockHash().ToString(),
+ hashPrev.ToString());
return str;
}
void print() const
{
- LogPrintf("%s\n", ToString().c_str());
+ LogPrintf("%s\n", ToString());
}
};
diff --git a/src/net.h b/src/net.h
index 729b1bcd57..58a8fa739b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -430,7 +430,7 @@ public:
nRequestTime = it->second;
else
nRequestTime = 0;
- LogPrint("net", "askfor %s %d (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
+ LogPrint("net", "askfor %s %d (%s)\n", inv.ToString(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order
int64_t nNow = GetTimeMicros() - 1000000;
diff --git a/src/script.h b/src/script.h
index 0d8a8544bd..aed2b7a6ad 100644
--- a/src/script.h
+++ b/src/script.h
@@ -722,7 +722,7 @@ public:
void print() const
{
- LogPrintf("%s\n", ToString().c_str());
+ LogPrintf("%s\n", ToString());
}
CScriptID GetID() const
diff --git a/src/wallet.h b/src/wallet.h
index b2c06d3f61..81dfbba9cb 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -720,12 +720,12 @@ public:
std::string ToString() const
{
- return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str());
+ return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str());
}
void print() const
{
- LogPrintf("%s\n", ToString().c_str());
+ LogPrintf("%s\n", ToString());
}
};