From 48b27ec277c70795166bc1467c36bc7e1b335a11 Mon Sep 17 00:00:00 2001 From: svost Date: Mon, 14 Mar 2016 16:20:22 +0300 Subject: [PATCH] Fix msvc c4127 warning --- src/bitcoinrpc.cpp | 4 ++-- src/init.cpp | 2 +- src/irc.cpp | 6 +++--- src/main.cpp | 4 ++-- src/net.cpp | 8 ++++---- src/qt/qtipcserver.cpp | 2 +- src/script.cpp | 2 +- src/txdb-bdb.cpp | 2 +- src/txdb-leveldb.cpp | 2 +- src/util.cpp | 12 ++++++------ src/wallet.cpp | 4 ++-- src/walletdb.cpp | 6 +++--- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index d0f4e15..b555f0b 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -441,7 +441,7 @@ int ReadHTTPStatus(std::basic_istream& stream, int &proto) int ReadHTTPHeader(std::basic_istream& stream, map& mapHeadersRet) { int nLen = 0; - while (true) + for ( ; ; ) { string str; std::getline(stream, str); @@ -992,7 +992,7 @@ void ThreadRPCServer3(void* parg) AcceptedConnection *conn = (AcceptedConnection *) parg; bool fRun = true; - while (true) + for ( ; ; ) { if (fShutdown || !fRun) { diff --git a/src/init.cpp b/src/init.cpp index 8fec3c6..8fab885 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1013,7 +1013,7 @@ bool AppInit2() #if !defined(QT_GUI) // Loop until process is exit()ed from shutdown() function, // called from ThreadRPCServer thread when a "stop" command is received. - while (1) + for ( ; ; ) Sleep(5000); #endif diff --git a/src/irc.cpp b/src/irc.cpp index ecdafaa..b594529 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -75,7 +75,7 @@ static bool Send(SOCKET hSocket, const char* pszSend) bool RecvLineIRC(SOCKET hSocket, string& strLine) { - while (true) + for ( ; ; ) { bool fRet = RecvLine(hSocket, strLine); if (fRet) @@ -98,7 +98,7 @@ bool RecvLineIRC(SOCKET hSocket, string& strLine) int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL) { - while (true) + for ( ; ; ) { string strLine; strLine.reserve(10000); @@ -133,7 +133,7 @@ bool Wait(int nSeconds) bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet) { strRet.clear(); - while (true) + for ( ; ; ) { string strLine; if (!RecvLineIRC(hSocket, strLine)) diff --git a/src/main.cpp b/src/main.cpp index 1668679..38b3ac5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2723,7 +2723,7 @@ static unsigned int nCurrentBlockFile = 1; FILE* AppendBlockFile(unsigned int& nFileRet) { nFileRet = 0; - while (true) + for ( ; ; ) { FILE* file = OpenBlockFile(nCurrentBlockFile, 0, "ab"); if (!file) @@ -3808,7 +3808,7 @@ bool ProcessMessages(CNode* pfrom) // (x) data // - while (true) + for ( ; ; ) { // Don't bother if send buffer is too full to respond anyway if (pfrom->vSend.size() >= SendBufferSize()) diff --git a/src/net.cpp b/src/net.cpp index 756e5cb..5a853da 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -143,7 +143,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer) bool RecvLine(SOCKET hSocket, string& strLine) { strLine = ""; - while (true) + for ( ; ; ) { char c; int nBytes = recv(hSocket, &c, 1, 0); @@ -606,7 +606,7 @@ void ThreadSocketHandler2(void* parg) { printf("ThreadSocketHandler started\n"); size_t nPrevNodeCount = 0; - while (true) + for ( ; ; ) { // // Disconnect nodes @@ -1154,7 +1154,7 @@ void ThreadOpenConnections2(void* parg) // Initiate network connections int64_t nStart = GetTime(); - while (true) + for ( ; ; ) { ProcessOneShot(); @@ -1225,7 +1225,7 @@ void ThreadOpenConnections2(void* parg) int64_t nANow = GetAdjustedTime(); int nTries = 0; - while (true) + for ( ; ; ) { // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections) CAddress addr = addrman.Select(10 + min(nOutbound,8)*10); diff --git a/src/qt/qtipcserver.cpp b/src/qt/qtipcserver.cpp index c446793..8d2d30f 100644 --- a/src/qt/qtipcserver.cpp +++ b/src/qt/qtipcserver.cpp @@ -100,7 +100,7 @@ static void ipcThread2(void* pArg) size_t nSize = 0; unsigned int nPriority = 0; - while (true) + for ( ; ; ) { ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(100); if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d)) diff --git a/src/script.cpp b/src/script.cpp index 16dfa99..1b82de4 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1384,7 +1384,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector& v) return; string::size_type i1 = 0; string::size_type i2; - while (true) + for ( ; ; ) { i2 = str.find(c, i1); if (i2 == str.npos) @@ -486,7 +486,7 @@ vector ParseHex(const char* psz) { // convert hex dump to vector vector vch; - while (true) + for ( ; ; ) { while (isspace(*psz)) psz++; @@ -705,7 +705,7 @@ vector DecodeBase64(const char* p, bool* pfInvalid) int mode = 0; int left = 0; - while (1) + for ( ; ; ) { int dec = decode64_table[(unsigned char)*p]; if (dec == -1) break; @@ -858,7 +858,7 @@ vector DecodeBase32(const char* p, bool* pfInvalid) int mode = 0; int left = 0; - while (1) + for ( ; ; ) { int dec = decode32_table[(unsigned char)*p]; if (dec == -1) break; @@ -1001,7 +1001,7 @@ std::string DecodeDumpString(const std::string &str) { bool WildcardMatch(const char* psz, const char* mask) { - while (true) + for ( ; ; ) { switch (*mask) { diff --git a/src/wallet.cpp b/src/wallet.cpp index 2ee7dfa..87ffe93 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1660,7 +1660,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, CTxDB txdb("r"); { nFeeRet = nTransactionFee; - while (true) + for ( ; ; ) { wtxNew.vin.clear(); wtxNew.vout.clear(); @@ -2048,7 +2048,7 @@ bool CWallet::CreateCoinStake(uint256 &hashTx, uint32_t nOut, uint32_t nGenerati nCredit += GetProofOfStakeReward(nCoinAge, nBits, nGenerationTime); int64_t nMinFee = 0; - while (true) + for ( ; ; ) { // Set output amount if (fDontSplitCoins) diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 640f78b..cd90f97 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -85,7 +85,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list& vTxHash) return DB_CORRUPT; } - while (true) + for ( ; ; ) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); -- 1.7.1