Fixed integer comparison warning. #7023

pull CodeShark wants to merge 1 commits into bitcoin:master from CodeShark:signed_int_comparison_fix changing 1 files +1 −1
  1. CodeShark commented at 1:13 AM on November 16, 2015: contributor

    Explicit typecast to remove compiler warning.

  2. Fixed integer comparison warning. 4d29032a64
  3. in src/main.cpp:None in 4d29032a64
    2576 | @@ -2577,7 +2577,7 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd
    2577 |          pos.nPos = vinfoBlockFile[nFile].nSize;
    2578 |      }
    2579 |  
    2580 | -    if (nFile != nLastBlockFile) {
    


    dcousens commented at 1:32 AM on November 16, 2015:

    This is obviously the smaller change, but, couldn't nLastBlockFile just be unsigned?


    CodeShark commented at 1:41 AM on November 16, 2015:

    I think it could - but that would require having to check whether that breaks anything...and if we're going down that route, we could also start changing a bunch of other variables...and I don't think I want to go down that path right now :)

  4. laanwj commented at 8:47 AM on November 16, 2015: member

    ACK. I don't think nLastBlockFile can be usefully negative, but this is clearly the least risky change.

  5. laanwj added the label Refactoring on Nov 16, 2015
  6. paveljanik commented at 8:56 AM on November 16, 2015: contributor

    ACK

    The warning comes from #6948.

  7. gmaxwell commented at 12:35 AM on November 17, 2015: contributor

    ACK.

  8. gmaxwell merged this on Nov 17, 2015
  9. gmaxwell closed this on Nov 17, 2015

  10. gmaxwell referenced this in commit 0a547d2d55 on Nov 17, 2015
  11. luke-jr referenced this in commit 9596888340 on Nov 18, 2015
  12. luke-jr referenced this in commit 37ac133328 on Dec 8, 2015
  13. 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-22 06:15 UTC

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