Apply remaining win32 patches by @emfrias

This commit is contained in:
Vikram Rajkumar 2015-06-09 14:11:57 -04:00
parent 185f3a4ffc
commit 5633d92813
3 changed files with 3 additions and 7 deletions

View file

@ -55,5 +55,5 @@ target_include_directories( graphene_chain
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
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)

View file

@ -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,
// then I want to keep the most significant 16 bits of what's left.
#ifdef __GNUC__
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
int8_t bits_to_drop = std::max(int(boost::multiprecision::detail::find_msb(total_votes)) - 15, 0);
for( const auto& weight : weights )
{
// Ensure that everyone has at least one vote. Zero weights aren't allowed.

View file

@ -905,8 +905,8 @@ string memo_message::serialize() const
memo_message memo_message::deserialize(const string& serial)
{
FC_ASSERT( serial.size() >= sizeof(memo_message::checksum) );
memo_message result;
FC_ASSERT( serial.size() >= sizeof(result.checksum) );
result.checksum = ntohl((uint32_t&)(*serial.data()));
result.text = serial.substr(sizeof(result.checksum));
return result;