Skip to content
This repository

Trim trailing whitespace in src/*.{cpp,h} #1170

Closed
wants to merge 1 commit into from

6 participants

Jeff Garzik Wladimir J. van der Laan P. Kaufmann R E Broadley Gregory Maxwell Pieter Wuille
Jeff Garzik
Collaborator

This commit changes no code, and makes no other cleanups than removing the trailing whitespace from source code and comment lines.

Script used: https://gist.github.com/2561322

Wladimir J. van der Laan
Owner

I'll never understand this war on spaces. IMO this just breaks other patches for reason at all.

Jeff Garzik
Collaborator

It is a very minor change, yes, but it pops up again and again in pull requests for various projects. Sometimes editors automatically trim this stuff, which may generate larger patches (with changes in unexpected areas) down the road.

Others will submit this stuff, as was already done in #1136, so might as well make our stuff uniform all in one go.

P. Kaufmann

Great big and never-ending ACK ;).

R E Broadley
rebroad commented

Well done. Does this mean I'll have more free disk space after applying this?

Gregory Maxwell
Collaborator

I think we should pull this in 0.7.0 after pulling most of the other outstanding 0.7.0 pulls that this would break.

P. Kaufmann
Diapolo commented

I think this should be rebased once more (if needed) and then get merged. Why should this even break pulls, it removes not a single line only spaces?

Jeff Garzik
Collaborator
jgarzik commented

It is scripted, thus may be regenerated from scratch at any time.

Pieter Wuille
Collaborator
sipa commented

ACK for applying at the end of 0.7.0's merge window.

Jeff Garzik
Collaborator

Closing. Will run script to do this immediately prior to 0.7rc1 release...

Jeff Garzik jgarzik closed this
P. Kaufmann

I hope so ^^.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 2 authors.

Apr 30, 2012
Trim trailing whitespace in src/*.{cpp,h} 6d82cd6
This page is out of date. Refresh to see the latest.
4  src/addrman.cpp
@@ -174,7 +174,7 @@ int CAddrMan::ShrinkNew(int nUBucket)
174 174
         nI++;
175 175
     }
176 176
     CAddrInfo &info = mapInfo[nOldest];
177  
-    if (--info.nRefCount == 0) 
  177
+    if (--info.nRefCount == 0)
178 178
     {
179 179
         SwapRandom(info.nRandomPos, vRandom.size()-1);
180 180
         vRandom.pop_back();
@@ -223,7 +223,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin)
223 223
     infoOld.nRefCount = 1;
224 224
     // do not update nTried, as we are going to move something else there immediately
225 225
 
226  
-    // check whether there is place in that one, 
  226
+    // check whether there is place in that one,
227 227
     if (vNew.size() < ADDRMAN_NEW_BUCKET_SIZE)
228 228
     {
229 229
         // if so, move it back there
2  src/addrman.h
@@ -213,7 +213,7 @@ class CAddrMan
213 213
     // This is the only place where actual deletes occur.
214 214
     // They are never deleted while in the "tried" table, only possibly evicted back to the "new" table.
215 215
     int ShrinkNew(int nUBucket);
216  
- 
  216
+
217 217
     // Move an entry from the "new" table(s) to the "tried" table
218 218
     // @pre vvUnkown[nOrigin].count(nId) != 0
219 219
     void MakeTried(CAddrInfo& info, int nId, int nOrigin);
2  src/base58.h
@@ -362,7 +362,7 @@ class CBitcoinSecret : public CBase58Data
362 362
 {
363 363
 public:
364 364
     void SetSecret(const CSecret& vchSecret, bool fCompressed)
365  
-    { 
  365
+    {
366 366
         assert(vchSecret.size() == 32);
367 367
         SetData(fTestNet ? 239 : 128, &vchSecret[0], vchSecret.size());
368 368
         if (fCompressed)
6  src/bitcoinrpc.cpp
@@ -19,7 +19,7 @@
19 19
 #include <boost/iostreams/stream.hpp>
20 20
 #include <boost/algorithm/string.hpp>
21 21
 #include <boost/lexical_cast.hpp>
22  
-#include <boost/asio/ssl.hpp> 
  22
+#include <boost/asio/ssl.hpp>
23 23
 #include <boost/filesystem/fstream.hpp>
24 24
 typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> SSLStream;
25 25
 
@@ -951,7 +951,7 @@ Value sendmany(const Array& params, bool fHelp)
951 951
 
952 952
         CScript scriptPubKey;
953 953
         scriptPubKey.SetBitcoinAddress(address);
954  
-        int64 nAmount = AmountFromValue(s.value_); 
  954
+        int64 nAmount = AmountFromValue(s.value_);
955 955
         totalAmount += nAmount;
956 956
 
957 957
         vecSend.push_back(make_pair(scriptPubKey, nAmount));
@@ -1330,7 +1330,7 @@ Value listtransactions(const Array& params, bool fHelp)
1330 1330
         if (ret.size() >= (nCount+nFrom)) break;
1331 1331
     }
1332 1332
     // ret is newest to oldest
1333  
-    
  1333
+
1334 1334
     if (nFrom > (int)ret.size())
1335 1335
         nFrom = ret.size();
1336 1336
     if ((nFrom + nCount) > (int)ret.size())
4  src/crypter.cpp
@@ -19,7 +19,7 @@ bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::v
19 19
 
20 20
     // Try to keep the keydata out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap)
21 21
     // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
22  
-    // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.  
  22
+    // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
23 23
     mlock(&chKey[0], sizeof chKey);
24 24
     mlock(&chIV[0], sizeof chIV);
25 25
 
@@ -46,7 +46,7 @@ bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigne
46 46
 
47 47
     // Try to keep the keydata out of swap
48 48
     // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
49  
-    // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.  
  49
+    // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
50 50
     mlock(&chKey[0], sizeof chKey);
51 51
     mlock(&chIV[0], sizeof chIV);
52 52
 
6  src/db.cpp
@@ -214,7 +214,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
214 214
                 { // surround usage of db with extra {}
215 215
                     CDB db(strFile.c_str(), "r");
216 216
                     Db* pdbCopy = new Db(&dbenv, 0);
217  
-    
  217
+
218 218
                     int ret = pdbCopy->open(NULL,                 // Txn pointer
219 219
                                             strFileRes.c_str(),   // Filename
220 220
                                             "main",    // Logical db name
@@ -226,7 +226,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
226 226
                         printf("Cannot create database file %s\n", strFileRes.c_str());
227 227
                         fSuccess = false;
228 228
                     }
229  
-    
  229
+
230 230
                     Dbc* pcursor = db.GetCursor();
231 231
                     if (pcursor)
232 232
                         while (fSuccess)
@@ -749,7 +749,7 @@ bool CAddrDB::LoadAddresses()
749 749
         printf("Loaded %i addresses\n", addrman.size());
750 750
         return true;
751 751
     }
752  
-    
  752
+
753 753
     // Read pre-0.6 addr records
754 754
 
755 755
     vector<CAddress> vAddr;
2  src/irc.cpp
@@ -291,7 +291,7 @@ void ThreadIRCSeed2(void* parg)
291 291
                 Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
292 292
             }
293 293
         }
294  
-        
  294
+
295 295
         if (fTestNet) {
296 296
             Send(hSocket, "JOIN #bitcoinTEST\r");
297 297
             Send(hSocket, "WHO #bitcoinTEST\r");
2  src/key.h
@@ -165,7 +165,7 @@ class CKey
165 165
         if (bn == NULL)
166 166
             throw key_error("CKey::GetSecret() : EC_KEY_get0_private_key failed");
167 167
         int n=BN_bn2bin(bn,&vchRet[32 - nBytes]);
168  
-        if (n != nBytes) 
  168
+        if (n != nBytes)
169 169
             throw key_error("CKey::GetSecret(): BN_bn2bin failed");
170 170
         fCompressed = fCompressedPubKey;
171 171
         return vchRet;
6  src/main.cpp
@@ -718,7 +718,7 @@ bool CWalletTx::AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs)
718 718
     return false;
719 719
 }
720 720
 
721  
-bool CWalletTx::AcceptWalletTransaction() 
  721
+bool CWalletTx::AcceptWalletTransaction()
722 722
 {
723 723
     CTxDB txdb("r");
724 724
     return AcceptWalletTransaction(txdb);
@@ -2862,7 +2862,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
2862 2862
         if (pto->nVersion == 0)
2863 2863
             return true;
2864 2864
 
2865  
-        // Keep-alive ping. We send a nonce of zero because we don't use it anywhere 
  2865
+        // Keep-alive ping. We send a nonce of zero because we don't use it anywhere
2866 2866
         // right now.
2867 2867
         if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
2868 2868
             if (pto->nVersion > BIP0031_VERSION)
@@ -3062,7 +3062,7 @@ void SHA256Transform(void* pstate, void* pinput, const void* pinit)
3062 3062
         ctx.h[i] = ((uint32_t*)pinit)[i];
3063 3063
 
3064 3064
     SHA256_Update(&ctx, data, sizeof(data));
3065  
-    for (int i = 0; i < 8; i++) 
  3065
+    for (int i = 0; i < 8; i++)
3066 3066
         ((uint32_t*)pstate)[i] = ctx.h[i];
3067 3067
 }
3068 3068
 
2  src/main.h
@@ -790,7 +790,7 @@ class CTxIndex
790 790
         return !(a == b);
791 791
     }
792 792
     int GetDepthInMainChain() const;
793  
- 
  793
+
794 794
 };
795 795
 
796 796
 
4  src/netbase.cpp
@@ -352,8 +352,8 @@ bool CNetAddr::IsIPv4() const
352 352
 bool CNetAddr::IsRFC1918() const
353 353
 {
354 354
     return IsIPv4() && (
355  
-        GetByte(3) == 10 || 
356  
-        (GetByte(3) == 192 && GetByte(2) == 168) || 
  355
+        GetByte(3) == 10 ||
  356
+        (GetByte(3) == 192 && GetByte(2) == 168) ||
357 357
         (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31)));
358 358
 }
359 359
 
2  src/util.cpp
@@ -1329,7 +1329,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
1329 1329
 
1330 1330
 static void pop_lock()
1331 1331
 {
1332  
-    if (fDebug) 
  1332
+    if (fDebug)
1333 1333
     {
1334 1334
         const CLockLocation& locklocation = (*lockstack).rbegin()->second;
1335 1335
         printf("Unlocked: %s\n", locklocation.ToString().c_str());
4  src/util.h
@@ -571,7 +571,7 @@ inline uint160 Hash160(const std::vector<unsigned char>& vch)
571 571
 }
572 572
 
573 573
 
574  
-/** Median filter over a stream of values. 
  574
+/** Median filter over a stream of values.
575 575
  * Returns the median of the last N numbers
576 576
  */
577 577
 template <typename T> class CMedianFilter
@@ -588,7 +588,7 @@ template <typename T> class CMedianFilter
588 588
         vValues.push_back(initial_value);
589 589
         vSorted = vValues;
590 590
     }
591  
-    
  591
+
592 592
     void input(T value)
593 593
     {
594 594
         if(vValues.size() == nSize)
2  src/version.h
@@ -17,7 +17,7 @@ static const int CLIENT_VERSION_BUILD       = 1;
17 17
 
18 18
 static const int CLIENT_VERSION =
19 19
                            1000000 * CLIENT_VERSION_MAJOR
20  
-                         +   10000 * CLIENT_VERSION_MINOR 
  20
+                         +   10000 * CLIENT_VERSION_MINOR
21 21
                          +     100 * CLIENT_VERSION_REVISION
22 22
                          +       1 * CLIENT_VERSION_BUILD;
23 23
 
2  src/wallet.cpp
@@ -567,7 +567,7 @@ void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, l
567 567
 
568 568
 }
569 569
 
570  
-void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived, 
  570
+void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
571 571
                                   int64& nSent, int64& nFee) const
572 572
 {
573 573
     nGenerated = nReceived = nSent = nFee = 0;
4  src/wallet.h
@@ -298,7 +298,7 @@ class CReserveKey
298 298
 };
299 299
 
300 300
 
301  
-/** A transaction with a bunch of additional info that only the owner cares about. 
  301
+/** A transaction with a bunch of additional info that only the owner cares about.
302 302
  * It includes any unrecorded transactions needed to link it back to the block chain.
303 303
  */
304 304
 class CWalletTx : public CMerkleTx
@@ -533,7 +533,7 @@ class CWalletTx : public CMerkleTx
533 533
     void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<CBitcoinAddress, int64> >& listReceived,
534 534
                     std::list<std::pair<CBitcoinAddress, int64> >& listSent, int64& nFee, std::string& strSentAccount) const;
535 535
 
536  
-    void GetAccountAmounts(const std::string& strAccount, int64& nGenerated, int64& nReceived, 
  536
+    void GetAccountAmounts(const std::string& strAccount, int64& nGenerated, int64& nReceived,
537 537
                            int64& nSent, int64& nFee) const;
538 538
 
539 539
     bool IsFromMe() const
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.