Apply remaining win32 patches by @emfrias
This commit is contained in:
parent
185f3a4ffc
commit
5633d92813
3 changed files with 3 additions and 7 deletions
|
|
@ -55,5 +55,5 @@ target_include_directories( graphene_chain
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_source_files_properties( database.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
|
set_source_files_properties( db_init.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
|
||||||
|
|
@ -153,11 +153,7 @@ void database::update_active_delegates()
|
||||||
|
|
||||||
// total_votes is 64 bits. Subtract the number of leading low bits from 64 to get the number of useful bits,
|
// total_votes is 64 bits. Subtract the number of leading low bits from 64 to get the number of useful bits,
|
||||||
// then I want to keep the most significant 16 bits of what's left.
|
// then I want to keep the most significant 16 bits of what's left.
|
||||||
#ifdef __GNUC__
|
int8_t bits_to_drop = std::max(int(boost::multiprecision::detail::find_msb(total_votes)) - 15, 0);
|
||||||
int8_t bits_to_drop = std::max(int(64 - __builtin_clzll(total_votes)) - 16, 0);
|
|
||||||
#else
|
|
||||||
int8_t bits_to_drop = std::max(int(boost::multiprecision::detail::find_msb(total_votes.value)) - 15, 0);
|
|
||||||
#endif
|
|
||||||
for( const auto& weight : weights )
|
for( const auto& weight : weights )
|
||||||
{
|
{
|
||||||
// Ensure that everyone has at least one vote. Zero weights aren't allowed.
|
// Ensure that everyone has at least one vote. Zero weights aren't allowed.
|
||||||
|
|
|
||||||
|
|
@ -905,8 +905,8 @@ string memo_message::serialize() const
|
||||||
|
|
||||||
memo_message memo_message::deserialize(const string& serial)
|
memo_message memo_message::deserialize(const string& serial)
|
||||||
{
|
{
|
||||||
FC_ASSERT( serial.size() >= sizeof(memo_message::checksum) );
|
|
||||||
memo_message result;
|
memo_message result;
|
||||||
|
FC_ASSERT( serial.size() >= sizeof(result.checksum) );
|
||||||
result.checksum = ntohl((uint32_t&)(*serial.data()));
|
result.checksum = ntohl((uint32_t&)(*serial.data()));
|
||||||
result.text = serial.substr(sizeof(result.checksum));
|
result.text = serial.substr(sizeof(result.checksum));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue