Browse Source

Trim trailing whitespace for src/*.{h,cpp}

0.8
Jeff Garzik 12 years ago committed by Jeff Garzik
parent
commit
ea0796bde3
  1. 4
      src/addrman.cpp
  2. 2
      src/addrman.h
  3. 2
      src/base58.h
  4. 2
      src/bitcoinrpc.cpp
  5. 4
      src/db.cpp
  6. 2
      src/main.h
  7. 8
      src/netbase.cpp
  8. 2
      src/rpcnet.cpp
  9. 2
      src/sync.cpp
  10. 4
      src/util.h
  11. 2
      src/wallet.h

4
src/addrman.cpp

@ -187,7 +187,7 @@ int CAddrMan::ShrinkNew(int nUBucket)
} }
assert(mapInfo.count(nOldest) == 1); assert(mapInfo.count(nOldest) == 1);
CAddrInfo &info = mapInfo[nOldest]; CAddrInfo &info = mapInfo[nOldest];
if (--info.nRefCount == 0) if (--info.nRefCount == 0)
{ {
SwapRandom(info.nRandomPos, vRandom.size()-1); SwapRandom(info.nRandomPos, vRandom.size()-1);
vRandom.pop_back(); vRandom.pop_back();
@ -241,7 +241,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin)
infoOld.nRefCount = 1; infoOld.nRefCount = 1;
// do not update nTried, as we are going to move something else there immediately // do not update nTried, as we are going to move something else there immediately
// check whether there is place in that one, // check whether there is place in that one,
if (vNew.size() < ADDRMAN_NEW_BUCKET_SIZE) if (vNew.size() < ADDRMAN_NEW_BUCKET_SIZE)
{ {
// if so, move it back there // if so, move it back there

2
src/addrman.h

@ -214,7 +214,7 @@ protected:
// This is the only place where actual deletes occur. // This is the only place where actual deletes occur.
// They are never deleted while in the "tried" table, only possibly evicted back to the "new" table. // They are never deleted while in the "tried" table, only possibly evicted back to the "new" table.
int ShrinkNew(int nUBucket); int ShrinkNew(int nUBucket);
// Move an entry from the "new" table(s) to the "tried" table // Move an entry from the "new" table(s) to the "tried" table
// @pre vvUnkown[nOrigin].count(nId) != 0 // @pre vvUnkown[nOrigin].count(nId) != 0
void MakeTried(CAddrInfo& info, int nId, int nOrigin); void MakeTried(CAddrInfo& info, int nId, int nOrigin);

2
src/base58.h

@ -403,7 +403,7 @@ class CBitcoinSecret : public CBase58Data
{ {
public: public:
void SetSecret(const CSecret& vchSecret, bool fCompressed) void SetSecret(const CSecret& vchSecret, bool fCompressed)
{ {
assert(vchSecret.size() == 32); assert(vchSecret.size() == 32);
SetData(fTestNet ? 239 : 128, &vchSecret[0], vchSecret.size()); SetData(fTestNet ? 239 : 128, &vchSecret[0], vchSecret.size());
if (fCompressed) if (fCompressed)

2
src/bitcoinrpc.cpp

@ -983,7 +983,7 @@ void ThreadRPCServer3(void* parg)
strReply = JSONRPCExecBatch(valRequest.get_array()); strReply = JSONRPCExecBatch(valRequest.get_array());
else else
throw JSONRPCError(-32700, "Top-level object parse error"); throw JSONRPCError(-32700, "Top-level object parse error");
conn->stream() << HTTPReply(200, strReply, fRun) << std::flush; conn->stream() << HTTPReply(200, strReply, fRun) << std::flush;
} }
catch (Object& objError) catch (Object& objError)

4
src/db.cpp

@ -281,7 +281,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
{ // surround usage of db with extra {} { // surround usage of db with extra {}
CDB db(strFile.c_str(), "r"); CDB db(strFile.c_str(), "r");
Db* pdbCopy = new Db(&bitdb.dbenv, 0); Db* pdbCopy = new Db(&bitdb.dbenv, 0);
int ret = pdbCopy->open(NULL, // Txn pointer int ret = pdbCopy->open(NULL, // Txn pointer
strFileRes.c_str(), // Filename strFileRes.c_str(), // Filename
"main", // Logical db name "main", // Logical db name
@ -293,7 +293,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
printf("Cannot create database file %s\n", strFileRes.c_str()); printf("Cannot create database file %s\n", strFileRes.c_str());
fSuccess = false; fSuccess = false;
} }
Dbc* pcursor = db.GetCursor(); Dbc* pcursor = db.GetCursor();
if (pcursor) if (pcursor)
while (fSuccess) while (fSuccess)

2
src/main.h

@ -753,7 +753,7 @@ public:
return !(a == b); return !(a == b);
} }
int GetDepthInMainChain() const; int GetDepthInMainChain() const;
}; };

8
src/netbase.cpp

@ -246,7 +246,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket)
string strSocks5("\5\1"); string strSocks5("\5\1");
strSocks5 += '\000'; strSocks5 += '\003'; strSocks5 += '\000'; strSocks5 += '\003';
strSocks5 += static_cast<char>(std::min((int)strDest.size(), 255)); strSocks5 += static_cast<char>(std::min((int)strDest.size(), 255));
strSocks5 += strDest; strSocks5 += strDest;
strSocks5 += static_cast<char>((port >> 8) & 0xFF); strSocks5 += static_cast<char>((port >> 8) & 0xFF);
strSocks5 += static_cast<char>((port >> 0) & 0xFF); strSocks5 += static_cast<char>((port >> 0) & 0xFF);
ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL);
@ -478,7 +478,7 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout)
// first connect to proxy server // first connect to proxy server
if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout))
return false; return false;
// do socks negotiation // do socks negotiation
switch (proxy.second) { switch (proxy.second) {
case 4: case 4:
@ -617,8 +617,8 @@ bool CNetAddr::IsIPv6() const
bool CNetAddr::IsRFC1918() const bool CNetAddr::IsRFC1918() const
{ {
return IsIPv4() && ( return IsIPv4() && (
GetByte(3) == 10 || GetByte(3) == 10 ||
(GetByte(3) == 192 && GetByte(2) == 168) || (GetByte(3) == 192 && GetByte(2) == 168) ||
(GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31))); (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31)));
} }

2
src/rpcnet.cpp

@ -61,7 +61,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
ret.push_back(obj); ret.push_back(obj);
} }
return ret; return ret;
} }

2
src/sync.cpp

@ -105,7 +105,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
static void pop_lock() static void pop_lock()
{ {
if (fDebug) if (fDebug)
{ {
const CLockLocation& locklocation = (*lockstack).rbegin()->second; const CLockLocation& locklocation = (*lockstack).rbegin()->second;
printf("Unlocked: %s\n", locklocation.ToString().c_str()); printf("Unlocked: %s\n", locklocation.ToString().c_str());

4
src/util.h

@ -483,7 +483,7 @@ inline uint160 Hash160(const std::vector<unsigned char>& vch)
} }
/** Median filter over a stream of values. /** Median filter over a stream of values.
* Returns the median of the last N numbers * Returns the median of the last N numbers
*/ */
template <typename T> class CMedianFilter template <typename T> class CMedianFilter
@ -500,7 +500,7 @@ public:
vValues.push_back(initial_value); vValues.push_back(initial_value);
vSorted = vValues; vSorted = vValues;
} }
void input(T value) void input(T value)
{ {
if(vValues.size() == nSize) if(vValues.size() == nSize)

2
src/wallet.h

@ -353,7 +353,7 @@ static void WriteOrderPos(const int64& nOrderPos, mapValue_t& mapValue)
} }
/** A transaction with a bunch of additional info that only the owner cares about. /** A transaction with a bunch of additional info that only the owner cares about.
* It includes any unrecorded transactions needed to link it back to the block chain. * It includes any unrecorded transactions needed to link it back to the block chain.
*/ */
class CWalletTx : public CMerkleTx class CWalletTx : public CMerkleTx

Loading…
Cancel
Save