aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bitcoinrpc.cpp2
-rw-r--r--src/main.cpp4
-rw-r--r--src/net.cpp12
-rw-r--r--src/qt/bitcoin.cpp1
-rw-r--r--src/qt/bitcoingui.cpp1
-rw-r--r--src/qt/guiutil.cpp1
-rw-r--r--src/qt/paymentserver.cpp1
-rw-r--r--src/qt/splashscreen.cpp1
-rw-r--r--src/script.cpp2
-rw-r--r--src/util.cpp8
-rw-r--r--src/util.h1
-rw-r--r--src/wallet.cpp2
-rw-r--r--src/walletdb.cpp4
13 files changed, 17 insertions, 23 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 11fac42213..7a3e6560ab 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -414,7 +414,7 @@ int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto)
int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet)
{
int nLen = 0;
- loop
+ while (true)
{
string str;
std::getline(stream, str);
diff --git a/src/main.cpp b/src/main.cpp
index d358914406..39e1a51599 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4615,7 +4615,7 @@ void static BitcoinMiner(CWallet *pwallet)
CReserveKey reservekey(pwallet);
unsigned int nExtraNonce = 0;
- try { loop {
+ try { while (true) {
if (Params().NetworkID() != CChainParams::REGTEST) {
// Busy-wait for the network to come online so we don't waste time mining
// on an obsolete chain. In regtest mode we expect to fly solo.
@@ -4659,7 +4659,7 @@ void static BitcoinMiner(CWallet *pwallet)
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
uint256 hashbuf[2];
uint256& hash = *alignup<16>(hashbuf);
- loop
+ while (true)
{
unsigned int nHashesDone = 0;
unsigned int nNonceFound;
diff --git a/src/net.cpp b/src/net.cpp
index bd9aa1f50f..4ee1895a80 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -129,7 +129,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer)
bool RecvLine(SOCKET hSocket, string& strLine)
{
strLine = "";
- loop
+ while (true)
{
char c;
int nBytes = recv(hSocket, &c, 1, 0);
@@ -301,7 +301,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha
{
if (strLine.empty()) // HTTP response is separated from headers by blank line
{
- loop
+ while (true)
{
if (!RecvLine(hSocket, strLine))
{
@@ -741,7 +741,7 @@ static list<CNode*> vNodesDisconnected;
void ThreadSocketHandler()
{
unsigned int nPrevNodeCount = 0;
- loop
+ while (true)
{
//
// Disconnect nodes
@@ -1105,7 +1105,7 @@ void ThreadMapPort()
string strDesc = "Bitcoin " + FormatFullVersion();
try {
- loop {
+ while (true) {
#ifndef UPNPDISCOVER_SUCCESS
/* miniupnpc 1.5 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
@@ -1268,7 +1268,7 @@ void ThreadOpenConnections()
// Initiate network connections
int64 nStart = GetTime();
- loop
+ while (true)
{
ProcessOneShot();
@@ -1309,7 +1309,7 @@ void ThreadOpenConnections()
int64 nANow = GetAdjustedTime();
int nTries = 0;
- loop
+ while (true)
{
// 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/bitcoin.cpp b/src/qt/bitcoin.cpp
index 4e9180b88c..3b98334696 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -15,7 +15,6 @@
#include "splashscreen.h"
#include "intro.h"
-#undef loop /* Todo: ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
#include <QMessageBox>
#if QT_VERSION < 0x050000
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 11767cf312..4ed734b9c9 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -28,7 +28,6 @@
#include "macdockiconhandler.h"
#endif
-#undef loop /* Todo: ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
#include <QMenuBar>
#include <QMenu>
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 521d9bddd8..0ea5060e76 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -7,7 +7,6 @@
#include "util.h"
#include "init.h"
-#undef loop /* Todo: ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
#include <QDateTime>
#include <QDoubleValidator>
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 8178065bcc..0d31f24a13 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -8,7 +8,6 @@
#include "ui_interface.h"
#include "util.h"
-#undef loop /* Todo: ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
#include <QByteArray>
#include <QDataStream>
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp
index 43430a858e..22cf04486b 100644
--- a/src/qt/splashscreen.cpp
+++ b/src/qt/splashscreen.cpp
@@ -2,7 +2,6 @@
#include "clientversion.h"
#include "util.h"
-#undef loop /* Todo: ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
#include <QPainter>
diff --git a/src/script.cpp b/src/script.cpp
index 14fe80e207..5699fbfb6a 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -1163,7 +1163,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
// Compare
CScript::const_iterator pc1 = script1.begin();
CScript::const_iterator pc2 = script2.begin();
- loop
+ while (true)
{
if (pc1 == script1.end() && pc2 == script2.end())
{
diff --git a/src/util.cpp b/src/util.cpp
index bfb6d75838..c4212b3984 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -311,7 +311,7 @@ string vstrprintf(const char *format, va_list ap)
char* p = buffer;
int limit = sizeof(buffer);
int ret;
- loop
+ while (true)
{
va_list arg_ptr;
va_copy(arg_ptr, ap);
@@ -371,7 +371,7 @@ void ParseString(const string& str, char c, vector<string>& v)
return;
string::size_type i1 = 0;
string::size_type i2;
- loop
+ while (true)
{
i2 = str.find(c, i1);
if (i2 == str.npos)
@@ -487,7 +487,7 @@ vector<unsigned char> ParseHex(const char* psz)
{
// convert hex dump to vector
vector<unsigned char> vch;
- loop
+ while (true)
{
while (isspace(*psz))
psz++;
@@ -941,7 +941,7 @@ string DecodeBase32(const string& str)
bool WildcardMatch(const char* psz, const char* mask)
{
- loop
+ while (true)
{
switch (*mask)
{
diff --git a/src/util.h b/src/util.h
index bee2749c16..9ca73f3311 100644
--- a/src/util.h
+++ b/src/util.h
@@ -35,7 +35,6 @@ typedef unsigned long long uint64;
static const int64 COIN = 100000000;
static const int64 CENT = 1000000;
-#define loop for (;;)
#define BEGIN(a) ((char*)&(a))
#define END(a) ((char*)&((&(a))[1]))
#define UBEGIN(a) ((unsigned char*)&(a))
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 0b4c866f81..88b07c9d76 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -1194,7 +1194,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend,
LOCK2(cs_main, cs_wallet);
{
nFeeRet = nTransactionFee;
- loop
+ while (true)
{
wtxNew.vin.clear();
wtxNew.vout.clear();
diff --git a/src/walletdb.cpp b/src/walletdb.cpp
index 7aad779767..014d8cbe29 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -73,7 +73,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
if (!pcursor)
throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
unsigned int fFlags = DB_SET_RANGE;
- loop
+ while (true)
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
@@ -437,7 +437,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
return DB_CORRUPT;
}
- loop
+ while (true)
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);