Fix various warnings #6133

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:bugfix_201505_warnings changing 3 files +4 −4
  1. luke-jr commented at 8:06 PM on May 13, 2015: member

    Found while building on Debian 7

    NOTE: There is one remaining warning I was not able to figure out:

    test/util_tests.cpp:322:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    
  2. in src/main.h:None in 1ced98a07d outdated
     135 | @@ -136,7 +136,7 @@ extern bool fPruneMode;
     136 |  /** Number of MiB of block files that we're trying to stay below. */
     137 |  extern uint64_t nPruneTarget;
     138 |  /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */
     139 | -static const signed int MIN_BLOCKS_TO_KEEP = 288;
     140 | +static const unsigned MIN_BLOCKS_TO_KEEP = 288;
    


    Diapolo commented at 2:30 PM on May 14, 2015:

    Feels strange to not see the type in here, no?


    laanwj commented at 3:29 PM on May 14, 2015:

    We never use unsigned without type in the code anywhere else, let's just make this unsigned int.


    Diapolo commented at 4:07 PM on May 25, 2015:

    Ping @luke-jr


    luke-jr commented at 3:47 AM on June 2, 2015:

    I see 5 other cases in the code, but fine with me.

  3. laanwj added the label Improvement on May 15, 2015
  4. in src/txmempool.cpp:None in 1ced98a07d outdated
     495 | @@ -496,7 +496,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in
     496 |                  continue;
     497 |              const CCoins *coins = pcoins->AccessCoins(txin.prevout.hash);
     498 |              if (fSanityCheck) assert(coins);
     499 | -            if (!coins || (coins->IsCoinBase() && nMemPoolHeight - coins->nHeight < COINBASE_MATURITY)) {
     500 | +            if (!coins || (coins->IsCoinBase() && ((signed long)nMemPoolHeight) - coins->nHeight < COINBASE_MATURITY)) {
    


    laanwj commented at 7:41 AM on May 27, 2015:

    coins->nHeight is an int, nMempoolHeight is an unsigned int. Any specific reason for introducing a signed long here?


    luke-jr commented at 3:46 AM on June 2, 2015:

    COINBASE_MATURITY is a [signed] int, and we are subtracting.


    laanwj commented at 5:52 PM on July 2, 2015:

    Right.

  5. luke-jr force-pushed on Jun 2, 2015
  6. jtimon commented at 1:50 PM on June 21, 2015: contributor

    Untested ACK, needs rebase.

  7. Fix various warnings
    Found while building on Debian 7
    e617fe2578
  8. luke-jr force-pushed on Jun 23, 2015
  9. luke-jr commented at 8:41 AM on June 23, 2015: member

    Rebased

  10. laanwj merged this on Jul 2, 2015
  11. laanwj closed this on Jul 2, 2015

  12. laanwj referenced this in commit 987efae1fd on Jul 2, 2015
  13. luke-jr referenced this in commit 54943e58c8 on Jan 10, 2016
  14. luke-jr referenced this in commit d89d0ebba8 on Jan 10, 2016
  15. zkbot referenced this in commit df07f9ad23 on Feb 15, 2017
  16. zkbot referenced this in commit ec069ce96c on Mar 3, 2017
  17. zkbot referenced this in commit 702eefc71a on Mar 3, 2017
  18. zkbot referenced this in commit 99c4c6de0c on Mar 3, 2017
  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-14 15:15 UTC

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