Merge pull request #292 from svost/patch
authorCryptoManiac <CryptoManiac@users.noreply.github.com>
Mon, 21 Mar 2016 09:17:51 +0000 (12:17 +0300)
committerCryptoManiac <CryptoManiac@users.noreply.github.com>
Mon, 21 Mar 2016 09:17:51 +0000 (12:17 +0300)
Minor fix

src/addrman.cpp
src/json/json_spirit_value.h
src/net.cpp
src/qt/intro.cpp
src/rpcwallet.cpp
src/serialize.h

index ed17c39..f24e7e7 100644 (file)
@@ -398,7 +398,7 @@ CAddress CAddrMan::Select_(int nUnkBias)
     {
         // use a tried node
         double fChanceFactor = 1.0;
-        while(1)
+        for ( ; ; )
         {
             int nKBucket = GetRandInt(vvTried.size());
             std::vector<int> &vTried = vvTried[nKBucket];
@@ -413,7 +413,7 @@ CAddress CAddrMan::Select_(int nUnkBias)
     } else {
         // use a new node
         double fChanceFactor = 1.0;
-        while(1)
+        for ( ; ; )
         {
             int nUBucket = GetRandInt(vvNew.size());
             std::set<int> &vNew = vvNew[nUBucket];
index 3b864f6..5e1ae64 100644 (file)
@@ -64,8 +64,8 @@ namespace json_spirit
         const Array&       get_array()  const;
         bool               get_bool()   const;
         int                get_int()    const;
-        boost::int64_t     get_int64()  const;
-        boost::uint64_t    get_uint64() const;
+        int64_t            get_int64()  const;
+        uint64_t           get_uint64() const;
         double             get_real()   const;
 
         Object& get_obj();
@@ -273,7 +273,7 @@ namespace json_spirit
     template< class Config >
     Value_impl< Config >::Value_impl( uint64_t value )
     :   type_( int_type )
-    ,   v_( static_cast< boost::int64_t >( value ) )
+    ,   v_( static_cast< int64_t >( value ) )
     ,   is_uint64_( true )
     {
     }
index 5a853da..9d3b998 100644 (file)
@@ -1760,7 +1760,7 @@ bool StopNode()
     if (semOutbound)
         for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++)
             semOutbound->post();
-    do
+    for ( ; ; )
     {
         int nThreadsRunning = 0;
         for (int n = 0; n < THREAD_MAX; n++)
@@ -1770,7 +1770,7 @@ bool StopNode()
         if (GetTime() - nStart > 20)
             break;
         Sleep(20);
-    } while(true);
+    };
     if (vnThreadsRunning[THREAD_SOCKETHANDLER] > 0) printf("ThreadSocketHandler still running\n");
     if (vnThreadsRunning[THREAD_OPENCONNECTIONS] > 0) printf("ThreadOpenConnections still running\n");
     if (vnThreadsRunning[THREAD_MESSAGEHANDLER] > 0) printf("ThreadMessageHandler still running\n");
index fe31dd0..75c1c82 100644 (file)
@@ -169,7 +169,7 @@ void Intro::pickDataDirectory()
         intro.setDataDirectory(dataDir);
         intro.setWindowIcon(QIcon(":icons/bitcoin"));
 
-        while(true)
+        for ( ; ; )
         {
             if(!intro.exec())
             {
index 8c36836..aa8f876 100644 (file)
@@ -1511,7 +1511,7 @@ void ThreadCleanWalletPassphrase(void* parg)
     {
         nWalletUnlockTime = nMyWakeTime;
 
-        do
+        for ( ; ; )
         {
             if (nWalletUnlockTime==0)
                 break;
@@ -1523,7 +1523,7 @@ void ThreadCleanWalletPassphrase(void* parg)
             Sleep(nToSleep);
             ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
 
-        } while(1);
+        };
 
         if (nWalletUnlockTime)
         {
index 8305dd0..bdcd830 100644 (file)
@@ -270,7 +270,7 @@ template<typename I>
 inline unsigned int GetSizeOfVarInt(I n)
 {
     int nRet = 0;
-    while(true) {
+    for ( ; ; ) {
         nRet++;
         if (n <= 0x7F)
             break;
@@ -284,7 +284,7 @@ void WriteVarInt(Stream& os, I n)
 {
     unsigned char tmp[(sizeof(n)*8+6)/7];
     int len=0;
-    while(true) {
+    for ( ; ; ) {
         tmp[len] = (n & 0x7F) | (len ? 0x80 : 0x00);
         if (n <= 0x7F)
             break;
@@ -300,7 +300,7 @@ template<typename Stream, typename I>
 I ReadVarInt(Stream& is)
 {
     I n = 0;
-    while(true) {
+    for ( ; ; ) {
         unsigned char chData;
         READDATA(is, chData);
         n = (n << 7) | (chData & 0x7F);