Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sign mismatch warning, use uint32_t for versions. #971

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/bitcoin/bitcoin/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ BC_CONSTEXPR size_t retargeting_interval =
//-----------------------------------------------------------------------------

// Consensus rule change activation and enforcement parameters.
BC_CONSTEXPR size_t first_version = 1;
BC_CONSTEXPR size_t bip34_version = 2;
BC_CONSTEXPR size_t bip66_version = 3;
BC_CONSTEXPR size_t bip65_version = 4;
BC_CONSTEXPR uint32_t first_version = 1;
BC_CONSTEXPR uint32_t bip34_version = 2;
BC_CONSTEXPR uint32_t bip66_version = 3;
BC_CONSTEXPR uint32_t bip65_version = 4;
BC_CONSTEXPR uint32_t bip9_version_bit0 = 1u << 0;
BC_CONSTEXPR uint32_t bip9_version_bit1 = 1u << 1;
BC_CONSTEXPR uint32_t bip9_version_base = 0x20000000;
Expand Down
4 changes: 2 additions & 2 deletions src/chain/chain_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ chain_state::activations chain_state::activation(const data& values,
// CONSENSUS: Though unspecified in bip34, the satoshi implementation
// performed this comparison using the signed integer version value.
//*************************************************************************
const auto ge = [](uint32_t value, size_t version)
const auto ge = [](uint32_t value, uint32_t version)
{
return static_cast<int32_t>(value) >= version;
return static_cast<int32_t>(value) >= static_cast<int32_t>(version);
};

// Declare bip34-based version predicates.
Expand Down