Updates from BitShares FC #22
6 changed files with 13 additions and 9 deletions
|
|
@ -45,7 +45,7 @@ class ripemd160
|
|||
ripemd160 result();
|
||||
|
||||
private:
|
||||
struct impl;
|
||||
class impl;
|
||||
fc::fwd<impl,96> my;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -446,11 +446,11 @@ namespace fc
|
|||
catch( fc::exception& er ) { \
|
||||
FC_RETHROW_EXCEPTION( er, LOG_LEVEL, FORMAT, __VA_ARGS__ ); \
|
||||
} catch( const std::exception& e ) { \
|
||||
fc::exception fce( \
|
||||
throw fc::exception( \
|
||||
FC_LOG_MESSAGE( LOG_LEVEL, "${what}: " FORMAT,__VA_ARGS__("what",e.what())), \
|
||||
fc::std_exception_code,\
|
||||
typeid(e).name(), \
|
||||
e.what() ) ; throw fce;\
|
||||
e.what() ) ;\
|
||||
} catch( ... ) { \
|
||||
throw fc::unhandled_exception( \
|
||||
FC_LOG_MESSAGE( LOG_LEVEL, FORMAT,__VA_ARGS__), \
|
||||
|
|
@ -461,11 +461,11 @@ namespace fc
|
|||
catch( fc::exception& er ) { \
|
||||
FC_RETHROW_EXCEPTION( er, warn, "", FC_FORMAT_ARG_PARAMS(__VA_ARGS__) ); \
|
||||
} catch( const std::exception& e ) { \
|
||||
fc::exception fce( \
|
||||
throw fc::exception( \
|
||||
FC_LOG_MESSAGE( warn, "${what}: ",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)("what",e.what())), \
|
||||
fc::std_exception_code,\
|
||||
typeid(e).name(), \
|
||||
e.what() ) ; throw fce;\
|
||||
e.what() ) ;\
|
||||
} catch( ... ) { \
|
||||
throw fc::unhandled_exception( \
|
||||
FC_LOG_MESSAGE( warn, "",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)), \
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ FC_REFLECT_TYPENAME( fc::log_message );
|
|||
* @param LOG_LEVEL - a valid log_level::Enum name.
|
||||
*/
|
||||
#define FC_LOG_CONTEXT(LOG_LEVEL) \
|
||||
fc::log_context( fc::log_level::LOG_LEVEL, __FILE__, __LINE__, __func__ )
|
||||
fc::log_context( fc::log_level::LOG_LEVEL, (const char*)__FILE__, __LINE__, (const char*)__func__ )
|
||||
|
||||
/**
|
||||
* @def FC_LOG_MESSAGE(LOG_LEVEL,FORMAT,...)
|
||||
|
|
|
|||
|
|
@ -606,6 +606,8 @@ static const uint32_t crc_c[256] = {
|
|||
|
||||
uint64_t _mm_crc32_u64(uint64_t a, uint64_t b )
|
||||
{
|
||||
// Squelch warning about unusued variable crc_c
|
||||
(void)(crc_c);
|
||||
return crc32cSlicingBy8(a, (unsigned char*)&b, sizeof(b));
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ BOOST_AUTO_TEST_CASE(bigint_test_2)
|
|||
BOOST_CHECK( bi_accu >= a_1 );
|
||||
} while ( bi_accu.log2() <= 128 );
|
||||
|
||||
bi_accu = bi_accu;
|
||||
// Test self-assignment (a=a) has no effect, but throw in some arcanity to avoid a compiler warning
|
||||
const volatile auto* bi_accu_self = &bi_accu;
|
||||
bi_accu = const_cast<fc::bigint&>(*bi_accu_self);
|
||||
|
||||
BOOST_CHECK( bi_accu && !bi_accu.is_negative() && bi_accu != bi_1 );
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ static bool equal( const fc::variant& a, const fc::variant& b )
|
|||
return true;
|
||||
case fc::variant::type_id::blob_type:
|
||||
default:
|
||||
FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + a.get_type() );
|
||||
FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: {t}", ( "t", a.get_type() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ BOOST_AUTO_TEST_CASE(rethrow_test)
|
|||
} FC_RETHROW_EXCEPTIONS( warn, "Argh! ${biggie}", ("biggie",biggie) ) };
|
||||
BOOST_CHECK_THROW( test_r(), fc::unknown_host_exception );
|
||||
|
||||
auto test_lr = [&biggie](){
|
||||
auto test_lr = [](){
|
||||
try {
|
||||
FC_THROW_EXCEPTION( fc::unknown_host_exception, "WTF?" );
|
||||
} FC_LOG_AND_RETHROW() };
|
||||
|
|
|
|||
Loading…
Reference in a new issue