Browse Source

Merge pull request #4206

79d06dc Remove redundant c_str (R E Broadley)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
73f7153f43
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 4
      src/addrman.h
  2. 2
      src/init.cpp
  3. 4
      src/leveldbwrapper.h
  4. 12
      src/main.h
  5. 2
      src/net.h
  6. 2
      src/script.h
  7. 4
      src/wallet.h

4
src/addrman.h

@ -420,7 +420,7 @@ public: @@ -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: @@ -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;
}

2
src/init.cpp

@ -914,7 +914,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -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;

4
src/leveldbwrapper.h

@ -93,7 +93,7 @@ public: @@ -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: @@ -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;

12
src/main.h

@ -859,13 +859,13 @@ public: @@ -859,13 +859,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.
@ -950,14 +950,14 @@ public: @@ -950,14 +950,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());
}
};

2
src/net.h

@ -431,7 +431,7 @@ public: @@ -431,7 +431,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;

2
src/script.h

@ -722,7 +722,7 @@ public: @@ -722,7 +722,7 @@ public:
void print() const
{
LogPrintf("%s\n", ToString().c_str());
LogPrintf("%s\n", ToString());
}
CScriptID GetID() const

4
src/wallet.h

@ -719,12 +719,12 @@ public: @@ -719,12 +719,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());
}
};

Loading…
Cancel
Save