- The type used when using BlockStatus is unsigned int
- The 16bits range is sufficient to use
- unsigned int is whatever unsigned integer the compiler likes best
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-
jjz commented at 2:09 PM on September 1, 2017: contributor
-
c63ceefbf6
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
-
MarcoFalke commented at 2:59 PM on September 1, 2017: member
Is there any observable effect of this?
-
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?
-
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.
- jjz closed this on Sep 2, 2017
- MarcoFalke locked this on Sep 8, 2021
Contributors