dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Adjust types in CBloomFilter #1035

Closed AM5800 closed 5 years ago

AM5800 commented 5 years ago

As you know, C++ standard does not explicitly define how many bits should be there in char or int. And while currently, in absolute majority of cases, it is 8 and 32 bits respectively, leaving the things as is a potential way to shoot yourself in a leg. sizeof operator fundamental types

And while we can follow this rule and change everything, I believe that we should start with protocol first. Because compiling unit-e on a system, which uses 16 bit int, or a char that is >8 bits will break the CBloomFilter.

Signed-off-by: Aleksandr Mikhailov aleksandr@thirdhash.com

cornelius commented 5 years ago

Better defined types are great. utACK https://github.com/dtr-org/unit-e/pull/1035/commits/cdbc3fc9006716c4a43d94fd8ab83dc749d2fd46