minor variable init changes in init.cpp #4980

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:init changing 1 files +5 −4
  1. Diapolo commented at 7:10 AM on September 25, 2014: none
    • explicit init of pcoinsdbview and pwalletMain (even if not needed, as globals are init to NULL, it seems cleaner)
    • remove check if (pwalletMain) in Shutdown() as delete is valid even if pwalletMain is NULL
  2. in src/init.cpp:None in dc78271456 outdated
     738 | @@ -738,8 +739,8 @@ bool AppInit2(boost::thread_group& threadGroup)
     739 |      std::ostringstream strErrors;
     740 |  
     741 |      if (nScriptCheckThreads) {
     742 | -        LogPrintf("Using %u threads for script verification\n", nScriptCheckThreads);
     743 | -        for (int i=0; i<nScriptCheckThreads-1; i++)
     744 | +        LogPrintf("Using %d threads for script verification\n", nScriptCheckThreads);
    


    laanwj commented at 7:13 AM on September 25, 2014:

    This is unnecessary, tinyformat doesn't look at 'd'/'u' but looks at the type of the parameter.


    Diapolo commented at 7:22 AM on September 25, 2014:

    Didn't know that, but doesn't it make sense to still try to match what the variable type is? It makes lazy and perhaps at some time we drop tinyformat.


    laanwj commented at 7:23 AM on September 25, 2014:

    No, it makes no sense, and no we won't drop tinyformat.

  3. in src/init.cpp:None in dc78271456 outdated
     738 | @@ -738,8 +739,8 @@ bool AppInit2(boost::thread_group& threadGroup)
     739 |      std::ostringstream strErrors;
     740 |  
     741 |      if (nScriptCheckThreads) {
     742 | -        LogPrintf("Using %u threads for script verification\n", nScriptCheckThreads);
     743 | -        for (int i=0; i<nScriptCheckThreads-1; i++)
     744 | +        LogPrintf("Using %d threads for script verification\n", nScriptCheckThreads);
     745 | +        for (int i = 0; i < nScriptCheckThreads - 1; i++)
    


    laanwj commented at 7:13 AM on September 25, 2014:

    No whitespace changes please.


    Diapolo commented at 7:23 AM on September 25, 2014:

    Right.

  4. in src/init.cpp:None in dc78271456 outdated
     341 | @@ -342,8 +342,8 @@ std::string HelpMessage(HelpMessageMode mode)
     342 |  
     343 |      strUsage += "\n" + _("Block creation options:") + "\n";
     344 |      strUsage += "  -blockminsize=<n>      " + _("Set minimum block size in bytes (default: 0)") + "\n";
     345 | -    strUsage += "  -blockmaxsize=<n>      " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n";
     346 | -    strUsage += "  -blockprioritysize=<n> " + strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), DEFAULT_BLOCK_PRIORITY_SIZE) + "\n";
     347 | +    strUsage += "  -blockmaxsize=<n>      " + strprintf(_("Set maximum block size in bytes (default: %u)"), DEFAULT_BLOCK_MAX_SIZE) + "\n";
    


    laanwj commented at 7:21 AM on September 25, 2014:

    Same here, please don't fiddle with %d/%u, its unnecessary


    Diapolo commented at 7:23 AM on September 25, 2014:

    See comment below.

  5. laanwj commented at 10:50 AM on September 25, 2014: member

    ACK after removing the unnecessary %d/%u changes

  6. Diapolo commented at 11:24 AM on September 25, 2014: none

    @laanwj Just to understand general rule here, it's perfectly equal wheter we use %i/%d/%u because of tinyformat and as such I shall revert the LogPrintx and strprintf changes, right?

  7. laanwj commented at 11:29 AM on September 25, 2014: member

    Right. They are equivalent, and changing them around gives pointless pull request and review work. For the appropriate code see https://github.com/bitcoin/bitcoin/blob/master/src/tinyformat.h#L776 .

  8. minor variable init changes in init.cpp
    - explicit init of pcoinsdbview and pwalletMain (even if not needed, as
      globals are init to NULL, it seems cleaner)
    - remove check if (pwalletMain) in Shutdown() as delete is valid even if
      pwalletMain is NULL
    20a11ffabf
  9. Diapolo renamed this:
    minor type-safety and variable init changes in init.cpp
    minor variable init changes in init.cpp
    on Sep 25, 2014
  10. Diapolo commented at 11:50 AM on September 25, 2014: none

    @laanwj Looked at the code you referenced, indeed it doesn't matter. Thanks!

  11. BitcoinPullTester commented at 12:04 PM on September 25, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4980_20a11ffabf0c6936ab2dbb7cfda676996318650a/ 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.

  12. sipa commented at 3:50 AM on September 29, 2014: member

    ACK

  13. sipa merged this on Oct 2, 2014
  14. sipa closed this on Oct 2, 2014

  15. sipa referenced this in commit 471d38b015 on Oct 2, 2014
  16. Diapolo deleted the branch on Oct 2, 2014
  17. MarcoFalke 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-21 18:15 UTC

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