Apply clang-format on some infrequently-updated files #4933

pull sipa wants to merge 1 commits into bitcoin:master from sipa:clang changing 30 files +847 −744
  1. sipa commented at 7:45 PM on September 16, 2014: member

    Only touch files with at most 5 commits in the past 6 months (and excluding some recently created files).

    Command line:

    clang-format-3.6 -style=file -i allocators.cpp coincontrol.h checkqueue.h db.h hash.cpp limitedmap.h noui.cpp noui.h random.h sync.cpp threadsafety.h addrman.cpp allocators.h leveldbwrapper.h leveldbwrapper.cpp miner.h mruset.h protocol.h rpcclient.h sync.h chainparamsbase.h chainparamsbase.cpp random.cpp timedata.h uint256.cpp version.cpp base58.cpp checkpoints.h clientversion.h db.cpp init.h key.h
    
  2. jgarzik commented at 7:50 PM on September 16, 2014: contributor

    ut ACK - reviewed and verified formatting-only changes

  3. laanwj commented at 11:12 AM on September 17, 2014: member

    Verified that the same command with my version of clang (built from git) give exactly the same output. Seems that the explicit -style=file isn't even necessary.

    I wonder why we had problems getting our results to match last time.

  4. laanwj commented at 11:22 AM on September 17, 2014: member

    When we merge this we should probably send out a notification on the mailing list etc, to tell people what to do if they have current patches against these files - ie, to run clang-format on the patched version as well as the original and then do a diff to create a new patch.

  5. Apply clang-format on some infrequently-updated files 20e01b1a03
  6. in src/allocators.cpp:None in e0aa910f7b outdated
      36 | @@ -37,13 +37,13 @@ static inline size_t GetSystemPageSize()
      37 |      page_size = sSysInfo.dwPageSize;
      38 |  #elif defined(PAGESIZE) // defined in limits.h
      39 |      page_size = PAGESIZE;
      40 | -#else // assume some POSIX OS
      41 | +#else                   // assume some POSIX OS
    


    Diapolo commented at 5:10 AM on September 18, 2014:

    Most changes are looking good, while this one is really bad IMHO!


    jgarzik commented at 12:31 PM on September 18, 2014:

    Why? It's aligning with another comment.


    Diapolo commented at 1:45 PM on September 18, 2014:

    I didn`t see it in the diff :-D.

  7. sipa force-pushed on Sep 19, 2014
  8. sipa commented at 5:22 PM on September 19, 2014: member

    Rebased.

  9. BitcoinPullTester commented at 5:36 PM on September 19, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4933_20e01b1a03819d843a860284033b48a5e3b65ff7/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  10. sipa commented at 5:38 PM on September 19, 2014: member

    @laanwj I don't think this conflicts with too many PRs, but I don't have numbers.

  11. laanwj commented at 9:43 AM on September 20, 2014: member

    @sipa I don't think so either. However people may have private patch sets. So it needs to be documented how to get past this in any case.

  12. jgarzik commented at 1:00 PM on September 20, 2014: contributor

    Email to list sent. Let's merge this...

  13. sipa merged this on Sep 20, 2014
  14. sipa closed this on Sep 20, 2014

  15. sipa referenced this in commit 934b153a2c on Sep 20, 2014
  16. Diapolo commented at 7:19 AM on September 22, 2014: none

    @laanwj Can we have this for the Qt and test files also? And before you could merge this one #4852 ;).

  17. laanwj commented at 7:32 AM on September 22, 2014: member

    @Diapolo Not sure yet. Most of the GUI code is written in Qt style, not the style of the core code. So this is bound to generate extremely large diffs.

  18. laanwj commented at 7:42 AM on September 22, 2014: member

    OK I've tried this on the UI code and it matches quite well actually, however this looks strange

    -WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
    -    QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
    -    transactionTableModel(0),
    -    recentRequestsTableModel(0),
    -    cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
    -    cachedEncryptionStatus(Unencrypted),
    -    cachedNumBlocks(0)
    +WalletModel::WalletModel(CWallet* wallet, OptionsModel* optionsModel, QObject* parent) : QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
    +                                                                                         transactionTableModel(0),
    +                                                                                         recentRequestsTableModel(0),
    +                                                                                         cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
    +                                                                                         cachedEncryptionStatus(Unencrypted),
    +                                                                                         cachedNumBlocks(0)
    

    Aligning all those initializers to the extreme right (instead of just indenting them) is unhelpful)

  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me