From 0a4555aaf99bbfc1b38fda177cc6cc8d3d634ba5 Mon Sep 17 00:00:00 2001 From: Anton Perkov Date: Wed, 30 May 2018 20:05:48 -0400 Subject: [PATCH] porting json/variant fixes from bitshares #3539 --- .../fc/include/fc/crypto/elliptic_r1.hpp | 8 +- .../fc/include/fc/crypto/private_key.hpp | 4 +- libraries/fc/include/fc/log/log_message.hpp | 27 ++++--- libraries/fc/include/fc/log/logger.hpp | 4 +- libraries/fc/include/fc/variant.hpp | 8 +- libraries/fc/src/crypto/elliptic_common.cpp | 12 +-- libraries/fc/src/crypto/elliptic_r1.cpp | 12 +-- libraries/fc/src/crypto/private_key.cpp | 4 +- libraries/fc/src/log/log_message.cpp | 45 +++++------ libraries/fc/src/time.cpp | 8 +- libraries/fc/src/variant.cpp | 76 +++++++++---------- 11 files changed, 106 insertions(+), 102 deletions(-) diff --git a/libraries/fc/include/fc/crypto/elliptic_r1.hpp b/libraries/fc/include/fc/crypto/elliptic_r1.hpp index a25f11b6c0e..3b7e427d6ce 100644 --- a/libraries/fc/include/fc/crypto/elliptic_r1.hpp +++ b/libraries/fc/include/fc/crypto/elliptic_r1.hpp @@ -175,10 +175,10 @@ namespace fc { } // namespace r1 } // namespace crypto - void to_variant( const crypto::r1::private_key& var, variant& vo ); - void from_variant( const variant& var, crypto::r1::private_key& vo ); - void to_variant( const crypto::r1::public_key& var, variant& vo ); - void from_variant( const variant& var, crypto::r1::public_key& vo ); + void to_variant( const crypto::r1::private_key& var, variant& vo, uint32_t max_depth ); + void from_variant( const variant& var, crypto::r1::private_key& vo, uint32_t max_depth ); + void to_variant( const crypto::r1::public_key& var, variant& vo, uint32_t max_depth ); + void from_variant( const variant& var, crypto::r1::public_key& vo, uint32_t max_depth ); namespace raw { diff --git a/libraries/fc/include/fc/crypto/private_key.hpp b/libraries/fc/include/fc/crypto/private_key.hpp index 9a2ccf5a147..95bd2b7c4f9 100644 --- a/libraries/fc/include/fc/crypto/private_key.hpp +++ b/libraries/fc/include/fc/crypto/private_key.hpp @@ -60,9 +60,9 @@ namespace fc { namespace crypto { } } // fc::crypto namespace fc { - void to_variant(const crypto::private_key& var, variant& vo); + void to_variant(const crypto::private_key& var, variant& vo, uint32_t max_depth); - void from_variant(const variant& var, crypto::private_key& vo); + void from_variant(const variant& var, crypto::private_key& vo, uint32_t max_depth); } // namespace fc FC_REFLECT(fc::crypto::private_key, (_storage) ) diff --git a/libraries/fc/include/fc/log/log_message.hpp b/libraries/fc/include/fc/log/log_message.hpp index 1928a986a5d..7a361263f8b 100644 --- a/libraries/fc/include/fc/log/log_message.hpp +++ b/libraries/fc/include/fc/log/log_message.hpp @@ -8,6 +8,8 @@ #include #include +#define FC_MAX_LOG_OBJECT_DEPTH 200 + namespace fc { namespace detail @@ -43,8 +45,8 @@ namespace fc values value; }; - void to_variant( log_level e, variant& v ); - void from_variant( const variant& e, log_level& ll ); + void to_variant( log_level e, variant& v, uint32_t max_depth = 1 ); + void from_variant( const variant& e, log_level& ll, uint32_t max_depth = 1 ); /** * @brief provides information about where and when a log message was generated. @@ -61,8 +63,8 @@ namespace fc uint64_t line, const char* method ); ~log_context(); - explicit log_context( const variant& v ); - variant to_variant()const; + explicit log_context( const variant& v, uint32_t max_depth ); + variant to_variant( uint32_t max_depth)const; string get_file()const; uint64_t get_line_number()const; @@ -81,8 +83,8 @@ namespace fc std::shared_ptr my; }; - void to_variant( const log_context& l, variant& v ); - void from_variant( const variant& l, log_context& c ); + void to_variant( const log_context& l, variant& v, uint32_t max_depth ); + void from_variant( const variant& l, log_context& c, uint32_t max_depth ); /** * @brief aggregates a message along with the context and associated meta-information. @@ -112,8 +114,8 @@ namespace fc log_message( log_context ctx, std::string format, variant_object args = variant_object() ); ~log_message(); - log_message( const variant& v ); - variant to_variant()const; + log_message( const variant& v, uint32_t max_depth ); + variant to_variant( uint32_t max_depth )const; string get_message()const; @@ -125,8 +127,8 @@ namespace fc std::shared_ptr my; }; - void to_variant( const log_message& l, variant& v ); - void from_variant( const variant& l, log_message& c ); + void to_variant( const log_message& l, variant& v, uint32_t max_depth ); + void from_variant( const variant& l, log_message& c, uint32_t max_depth ); typedef std::vector log_messages; @@ -158,5 +160,6 @@ FC_REFLECT_TYPENAME( fc::log_message ); * @param ... A set of key/value pairs denoted as ("key",val)("key2",val2)... */ #define FC_LOG_MESSAGE( LOG_LEVEL, FORMAT, ... ) \ - fc::log_message( FC_LOG_CONTEXT(LOG_LEVEL), FORMAT, fc::mutable_variant_object()__VA_ARGS__ ) - + fc::log_message( FC_LOG_CONTEXT(LOG_LEVEL), \ + FORMAT, \ + fc::limited_mutable_variant_object( FC_MAX_LOG_OBJECT_DEPTH, true )__VA_ARGS__ ) diff --git a/libraries/fc/include/fc/log/logger.hpp b/libraries/fc/include/fc/log/logger.hpp index 9005d7524e8..992e68d93b9 100644 --- a/libraries/fc/include/fc/log/logger.hpp +++ b/libraries/fc/include/fc/log/logger.hpp @@ -145,7 +145,7 @@ namespace fc BOOST_PP_STRINGIZE(base) ": ${" BOOST_PP_STRINGIZE( base ) "} " #define FC_FORMAT_ARGS(r, unused, base) \ - BOOST_PP_LPAREN() BOOST_PP_STRINGIZE(base),fc::variant(base) BOOST_PP_RPAREN() + BOOST_PP_LPAREN() BOOST_PP_STRINGIZE(base),fc::variant(base,FC_MAX_LOG_OBJECT_DEPTH) BOOST_PP_RPAREN() #define FC_FORMAT( SEQ )\ BOOST_PP_SEQ_FOR_EACH( FC_FORMAT_ARG, v, SEQ ) @@ -176,4 +176,4 @@ namespace fc # define ilog(...) FC_MULTILINE_MACRO_BEGIN FC_MULTILINE_MACRO_END # undef dlog # define dlog(...) FC_MULTILINE_MACRO_BEGIN FC_MULTILINE_MACRO_END -#endif \ No newline at end of file +#endif diff --git a/libraries/fc/include/fc/variant.hpp b/libraries/fc/include/fc/variant.hpp index d4662cb9f9a..5827b7e902b 100644 --- a/libraries/fc/include/fc/variant.hpp +++ b/libraries/fc/include/fc/variant.hpp @@ -57,8 +57,8 @@ namespace fc struct blob { std::vector data; }; - void to_variant( const blob& var, variant& vo, uint32_t max_depth ); - void from_variant( const variant& var, blob& vo, uint32_t max_depth ); + void to_variant( const blob& var, variant& vo, uint32_t max_depth = 1 ); + void from_variant( const variant& var, blob& vo, uint32_t max_depth = 1 ); template void to_variant( const boost::multi_index_container& s, variant& v, uint32_t max_depth ); @@ -247,8 +247,8 @@ namespace fc variant( variant_object, uint32_t max_depth = 1 ); variant( mutable_variant_object, uint32_t max_depth = 1 ); variant( variants, uint32_t max_depth = 1 ); - variant( const variant& ); - variant( variant&& ); + variant( const variant&, uint32_t max_depth = 1 ); + variant( variant&&, uint32_t max_depth = 1 ); ~variant(); /** diff --git a/libraries/fc/src/crypto/elliptic_common.cpp b/libraries/fc/src/crypto/elliptic_common.cpp index 87f0d92c11a..146dab88e82 100644 --- a/libraries/fc/src/crypto/elliptic_common.cpp +++ b/libraries/fc/src/crypto/elliptic_common.cpp @@ -222,27 +222,27 @@ namespace fc { namespace ecc { } -void to_variant( const ecc::private_key& var, variant& vo ) + void to_variant( const ecc::private_key& var, variant& vo, uint32_t ) { vo = var.get_secret(); } -void from_variant( const variant& var, ecc::private_key& vo ) +void from_variant( const variant& var, ecc::private_key& vo, uint32_t max_depth ) { fc::sha256 sec; - from_variant( var, sec ); + from_variant( var, sec, max_depth - 1 ); vo = ecc::private_key::regenerate(sec); } -void to_variant( const ecc::public_key& var, variant& vo ) +void to_variant( const ecc::public_key& var, variant& vo, uint32_t max_depth ) { vo = var.serialize(); } -void from_variant( const variant& var, ecc::public_key& vo ) +void from_variant( const variant& var, ecc::public_key& vo, uint32_t max_depth ) { ecc::public_key_data dat; - from_variant( var, dat ); + from_variant( var, dat, max_depth ); vo = ecc::public_key(dat); } diff --git a/libraries/fc/src/crypto/elliptic_r1.cpp b/libraries/fc/src/crypto/elliptic_r1.cpp index 100650ca1b9..3f002121b9c 100644 --- a/libraries/fc/src/crypto/elliptic_r1.cpp +++ b/libraries/fc/src/crypto/elliptic_r1.cpp @@ -633,25 +633,25 @@ namespace fc { namespace crypto { namespace r1 { } } - void to_variant( const crypto::r1::private_key& var, variant& vo ) + void to_variant( const crypto::r1::private_key& var, variant& vo, uint32_t ) { vo = var.get_secret(); } - void from_variant( const variant& var, crypto::r1::private_key& vo ) + void from_variant( const variant& var, crypto::r1::private_key& vo, uint32_t max_depth ) { fc::sha256 sec; - from_variant( var, sec ); + from_variant( var, sec, max_depth ); vo = crypto::r1::private_key::regenerate(sec); } - void to_variant( const crypto::r1::public_key& var, variant& vo ) + void to_variant( const crypto::r1::public_key& var, variant& vo, uint32_t ) { vo = var.serialize(); } - void from_variant( const variant& var, crypto::r1::public_key& vo ) + void from_variant( const variant& var, crypto::r1::public_key& vo, uint32_t max_depth ) { crypto::r1::public_key_data dat; - from_variant( var, dat ); + from_variant( var, dat, max_depth ); vo = crypto::r1::public_key(dat); } diff --git a/libraries/fc/src/crypto/private_key.cpp b/libraries/fc/src/crypto/private_key.cpp index 40f1f326507..016d87c5e0b 100644 --- a/libraries/fc/src/crypto/private_key.cpp +++ b/libraries/fc/src/crypto/private_key.cpp @@ -141,12 +141,12 @@ namespace fc { namespace crypto { namespace fc { - void to_variant(const fc::crypto::private_key& var, variant& vo) + void to_variant(const fc::crypto::private_key& var, variant& vo, uint32_t ) { vo = string(var); } - void from_variant(const variant& var, fc::crypto::private_key& vo) + void from_variant(const variant& var, fc::crypto::private_key& vo, uint32_t ) { vo = fc::crypto::private_key(var.as_string()); } diff --git a/libraries/fc/src/log/log_message.cpp b/libraries/fc/src/log/log_message.cpp index 67b202b9410..effc1e80b1e 100644 --- a/libraries/fc/src/log/log_message.cpp +++ b/libraries/fc/src/log/log_message.cpp @@ -54,11 +54,11 @@ namespace fc my->thread_name = fc::get_thread_name(); } - log_context::log_context( const variant& v ) + log_context::log_context( const variant& v, uint32_t max_depth ) :my( std::make_shared() ) { auto obj = v.get_object(); - my->level = obj["level"].as(); + my->level = obj["level"].as(max_depth); my->file = obj["file"].as_string(); my->line = obj["line"].as_uint64(); my->method = obj["method"].as_string(); @@ -66,9 +66,9 @@ namespace fc my->thread_name = obj["thread_name"].as_string(); if (obj.contains("task_name")) my->task_name = obj["task_name"].as_string(); - my->timestamp = obj["timestamp"].as(); + my->timestamp = obj["timestamp"].as(max_depth); if( obj.contains( "context" ) ) - my->context = obj["context"].as(); + my->context = obj["context"].as(max_depth); } fc::string log_context::to_string()const @@ -87,26 +87,26 @@ namespace fc log_context::~log_context(){} - void to_variant( const log_context& l, variant& v ) + void to_variant( const log_context& l, variant& v, uint32_t max_depth) { - v = l.to_variant(); + v = l.to_variant(max_depth); } - void from_variant( const variant& l, log_context& c ) + void from_variant( const variant& l, log_context& c, uint32_t max_depth) { - c = log_context(l); + c = log_context(l, max_depth); } - void from_variant( const variant& l, log_message& c ) + void from_variant( const variant& l, log_message& c, uint32_t max_depth) { - c = log_message(l); + c = log_message(l, max_depth); } - void to_variant( const log_message& m, variant& v ) + void to_variant( const log_message& m, variant& v, uint32_t max_depth) { - v = m.to_variant(); + v = m.to_variant(max_depth); } - void to_variant( log_level e, variant& v ) + void to_variant( log_level e, variant& v, uint32_t ) { switch( e ) { @@ -130,7 +130,7 @@ namespace fc return; } } - void from_variant( const variant& v, log_level& e ) + void from_variant( const variant& v, log_level& e, uint32_t ) { try { @@ -159,16 +159,16 @@ namespace fc string log_context::get_context()const { return my->context; } - variant log_context::to_variant()const + variant log_context::to_variant(uint32_t max_depth)const { mutable_variant_object o; - o( "level", variant(my->level) ) + o( "level", variant(my->level, max_depth - 1) ) ( "file", my->file ) ( "line", my->line ) ( "method", my->method ) ( "hostname", my->hostname ) ( "thread_name", my->thread_name ) - ( "timestamp", variant(my->timestamp) ); + ( "timestamp", variant(my->timestamp, max_depth - 1) ); if( my->context.size() ) o( "context", my->context ); @@ -181,22 +181,23 @@ namespace fc :my( std::make_shared() ){} log_message::log_message( log_context ctx, std::string format, variant_object args ) - :my( std::make_shared(std::move(ctx)) ) + :my( std::make_shared(std::move(ctx)) ) { my->format = std::move(format); my->args = std::move(args); } - log_message::log_message( const variant& v ) - :my( std::make_shared( log_context( v.get_object()["context"] ) ) ) + log_message::log_message( const variant& v, uint32_t max_depth ) + :my( std::make_shared( log_context( v.get_object()["context"], max_depth ) ) ) { my->format = v.get_object()["format"].as_string(); my->args = v.get_object()["data"].get_object(); } - variant log_message::to_variant()const + variant log_message::to_variant(uint32_t max_depth)const { - return mutable_variant_object( "context", my->context ) + return limited_mutable_variant_object(max_depth) + ( "context", my->context ) ( "format", my->format ) ( "data", my->args ); } diff --git a/libraries/fc/src/time.cpp b/libraries/fc/src/time.cpp index e61ee3cbd54..ecbe366ec75 100644 --- a/libraries/fc/src/time.cpp +++ b/libraries/fc/src/time.cpp @@ -63,16 +63,16 @@ namespace fc { } } FC_RETHROW_EXCEPTIONS( warn, "unable to convert ISO-formatted string to fc::time_point" ) } - void to_variant( const fc::time_point& t, variant& v ) { + void to_variant( const fc::time_point& t, variant& v, uint32_t ) { v = fc::string( t ); } - void from_variant( const fc::variant& v, fc::time_point& t ) { + void from_variant( const fc::variant& v, fc::time_point& t, uint32_t ) { t = fc::time_point::from_iso_string( v.as_string() ); } - void to_variant( const fc::time_point_sec& t, variant& v ) { + void to_variant( const fc::time_point_sec& t, variant& v, uint32_t ) { v = fc::string( t ); } - void from_variant( const fc::variant& v, fc::time_point_sec& t ) { + void from_variant( const fc::variant& v, fc::time_point_sec& t, uint32_t ) { t = fc::time_point_sec::from_iso_string( v.as_string() ); } diff --git a/libraries/fc/src/variant.cpp b/libraries/fc/src/variant.cpp index eaaf173c59b..2e43411cb07 100644 --- a/libraries/fc/src/variant.cpp +++ b/libraries/fc/src/variant.cpp @@ -183,7 +183,7 @@ void variant::clear() set_variant_type( this, null_type ); } -variant::variant( const variant& v ) +variant::variant( const variant& v, uint32_t ) { switch( v.get_type() ) { @@ -207,7 +207,7 @@ variant::variant( const variant& v ) } } -variant::variant( variant&& v ) +variant::variant( variant&& v, uint32_t ) { memcpy( this, &v, sizeof(v) ); set_variant_type( &v, null_type ); @@ -583,40 +583,40 @@ void from_variant( const variant& var, variants& vo ) // vo = var.get_object(); //} -void from_variant( const variant& var, variant& vo ) { vo = var; } +void from_variant( const variant& var, variant& vo, uint32_t ) { vo = var; } -void to_variant( const uint8_t& var, variant& vo ) { vo = uint64_t(var); } +void to_variant( const uint8_t& var, variant& vo, uint32_t ) { vo = uint64_t(var); } // TODO: warn on overflow? -void from_variant( const variant& var, uint8_t& vo ){ vo = static_cast(var.as_uint64()); } +void from_variant( const variant& var, uint8_t& vo, uint32_t ){ vo = static_cast(var.as_uint64()); } -void to_variant( const int8_t& var, variant& vo ) { vo = int64_t(var); } +void to_variant( const int8_t& var, variant& vo, uint32_t ) { vo = int64_t(var); } // TODO: warn on overflow? -void from_variant( const variant& var, int8_t& vo ){ vo = static_cast(var.as_int64()); } +void from_variant( const variant& var, int8_t& vo, uint32_t ){ vo = static_cast(var.as_int64()); } -void to_variant( const uint16_t& var, variant& vo ) { vo = uint64_t(var); } +void to_variant( const uint16_t& var, variant& vo, uint32_t ) { vo = uint64_t(var); } // TODO: warn on overflow? -void from_variant( const variant& var, uint16_t& vo ){ vo = static_cast(var.as_uint64()); } +void from_variant( const variant& var, uint16_t& vo, uint32_t ){ vo = static_cast(var.as_uint64()); } -void to_variant( const int16_t& var, variant& vo ) { vo = int64_t(var); } +void to_variant( const int16_t& var, variant& vo, uint32_t ) { vo = int64_t(var); } // TODO: warn on overflow? -void from_variant( const variant& var, int16_t& vo ){ vo = static_cast(var.as_int64()); } +void from_variant( const variant& var, int16_t& vo, uint32_t ){ vo = static_cast(var.as_int64()); } -void to_variant( const uint32_t& var, variant& vo ) { vo = uint64_t(var); } -void from_variant( const variant& var, uint32_t& vo ) +void to_variant( const uint32_t& var, variant& vo, uint32_t ) { vo = uint64_t(var); } +void from_variant( const variant& var, uint32_t& vo, uint32_t ) { vo = static_cast(var.as_uint64()); } -void to_variant( const int32_t& var, variant& vo ) { +void to_variant( const int32_t& var, variant& vo, uint32_t ) { vo = int64_t(var); } -void from_variant( const variant& var, int32_t& vo ) +void from_variant( const variant& var, int32_t& vo, uint32_t ) { vo = static_cast(var.as_int64()); } -void to_variant( const unsigned __int128& var, variant& vo ) { +void to_variant( const unsigned __int128& var, variant& vo, uint32_t ) { /* if( var <= static_cast( std::numeric_limits::max() ) ) { // uint32_t rather than uint64_t so that the number can be represented in JavaScript @@ -630,7 +630,7 @@ void to_variant( const unsigned __int128& var, variant& vo ) { // Assumes platform is little endian since it should write out the hex representation of 128-bit integer in little endian order. } -void from_variant( const variant& var, unsigned __int128& vo ) +void from_variant( const variant& var, unsigned __int128& vo, uint32_t ) { if( var.is_uint64() ) { vo = var.as_uint64(); @@ -648,7 +648,7 @@ void from_variant( const variant& var, unsigned __int128& vo ) } } -void to_variant( const __int128& var, variant& vo ) { +void to_variant( const __int128& var, variant& vo, uint32_t ) { /* if( static_cast<__int128>( std::numeric_limits::lowest() ) <= var && var <= static_cast<__int128>( std::numeric_limits::max() ) ) @@ -663,7 +663,7 @@ void to_variant( const __int128& var, variant& vo ) { // Assumes platform is little endian since it should write out the hex representation of 128-bit integer in little endian order. } -void from_variant( const variant& var, __int128& vo ) +void from_variant( const variant& var, __int128& vo, uint32_t ) { if( var.is_int64() ) { vo = var.as_int64(); @@ -681,48 +681,48 @@ void from_variant( const variant& var, __int128& vo ) } } -void from_variant( const variant& var, int64_t& vo ) +void from_variant( const variant& var, int64_t& vo, uint32_t ) { vo = var.as_int64(); } -void from_variant( const variant& var, uint64_t& vo ) +void from_variant( const variant& var, uint64_t& vo, uint32_t ) { vo = var.as_uint64(); } -void from_variant( const variant& var, bool& vo ) +void from_variant( const variant& var, bool& vo, uint32_t ) { vo = var.as_bool(); } -void from_variant( const variant& var, double& vo ) +void from_variant( const variant& var, double& vo, uint32_t ) { vo = var.as_double(); } -void from_variant( const variant& var, float& vo ) +void from_variant( const variant& var, float& vo, uint32_t ) { vo = static_cast(var.as_double()); } -void to_variant( const std::string& s, variant& v ) +void to_variant( const std::string& s, variant& v, uint32_t ) { v = variant( fc::string(s) ); } -void from_variant( const variant& var, string& vo ) +void from_variant( const variant& var, string& vo, uint32_t ) { vo = var.as_string(); } -void to_variant( const std::vector& var, variant& vo ) +void to_variant( const std::vector& var, variant& vo, uint32_t ) { if( var.size() ) vo = variant(to_hex(var.data(),var.size())); else vo = ""; } -void from_variant( const variant& var, std::vector& vo ) +void from_variant( const variant& var, std::vector& vo, uint32_t ) { auto str = var.as_string(); vo.resize( str.size() / 2 ); @@ -735,20 +735,20 @@ void from_variant( const variant& var, std::vector& vo ) // vo = std::vector( b64.c_str(), b64.c_str() + b64.size() ); } -void to_variant( const UInt<8>& n, variant& v ) { v = uint64_t(n); } +void to_variant( const UInt<8>& n, variant& v, uint32_t ) { v = uint64_t(n); } // TODO: warn on overflow? -void from_variant( const variant& v, UInt<8>& n ) { n = static_cast(v.as_uint64()); } +void from_variant( const variant& v, UInt<8>& n, uint32_t ) { n = static_cast(v.as_uint64()); } -void to_variant( const UInt<16>& n, variant& v ) { v = uint64_t(n); } +void to_variant( const UInt<16>& n, variant& v, uint32_t ) { v = uint64_t(n); } // TODO: warn on overflow? -void from_variant( const variant& v, UInt<16>& n ) { n = static_cast(v.as_uint64()); } +void from_variant( const variant& v, UInt<16>& n, uint32_t ) { n = static_cast(v.as_uint64()); } -void to_variant( const UInt<32>& n, variant& v ) { v = uint64_t(n); } +void to_variant( const UInt<32>& n, variant& v, uint32_t ) { v = uint64_t(n); } // TODO: warn on overflow? -void from_variant( const variant& v, UInt<32>& n ) { n = static_cast(v.as_uint64()); } +void from_variant( const variant& v, UInt<32>& n, uint32_t ) { n = static_cast(v.as_uint64()); } -void to_variant( const UInt<64>& n, variant& v ) { v = uint64_t(n); } -void from_variant( const variant& v, UInt<64>& n ) { n = v.as_uint64(); } +void to_variant( const UInt<64>& n, variant& v, uint32_t ) { v = uint64_t(n); } +void from_variant( const variant& v, UInt<64>& n, uint32_t ) { n = v.as_uint64(); } string format_string( const string& format, const variant_object& args ) { @@ -812,8 +812,8 @@ string format_string( const string& format, const variant_object& args ) } #ifdef __APPLE__ #elif !defined(_MSC_VER) - void to_variant( long long int s, variant& v ) { v = variant( int64_t(s) ); } - void to_variant( unsigned long long int s, variant& v ) { v = variant( uint64_t(s)); } + void to_variant( long long int s, variant& v, uint32_t ) { v = variant( int64_t(s) ); } + void to_variant( unsigned long long int s, variant& v, uint32_t ) { v = variant( uint64_t(s)); } #endif bool operator == ( const variant& a, const variant& b )