Change the type of BlockStatus to unsigned int #11212

pull jjz wants to merge 1 commits into bitcoin:master from jjz:master changing 1 files +1 −1
  1. jjz commented at 2:09 PM on September 1, 2017: contributor
    1. The type used when using BlockStatus is unsigned int
    2. The 16bits range is sufficient to use
    3. unsigned int is whatever unsigned integer the compiler likes best
  2. Change the type of BlockStatus to unsigned int :
    1. The type used when using BlockStatus is unsigned int
    2. The 16bits range is sufficient to use
    3. unsigned int is whatever unsigned integer the compiler likes best
    c63ceefbf6
  3. MarcoFalke commented at 2:59 PM on September 1, 2017: member

    Is there any observable effect of this?

  4. jjz commented at 4:00 PM on September 1, 2017: contributor

    There is no obvious impact on performance , but the code is clean . the same data , why use different data types?

  5. gmaxwell commented at 4:01 PM on September 1, 2017: contributor

    Please do not switch to types of implementation size without good reason, they complicate review and analysis. Various thoughtful secure coding practice guides prohibit them entirely, and although we don't we probably don't want more of them without good reason.

    The type your description is calling for is uint_fast16_t but it's very likely that we'll add many more flags in the future, and that type is the uint32_t on all our supported systems in any case.

  6. jjz commented at 4:06 PM on September 1, 2017: contributor

    So should we change this code unsigned int nStatus; to uint32_t nStatus? Line 203 in the chain.h @gmaxwell

  7. jjz closed this on Sep 2, 2017

  8. 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 09:15 UTC

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