Skip to content

Commit b83a823

Browse files
committed
Resolve some warnings from MSVC
1 parent e4ca876 commit b83a823

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

include/tao/json/events/hash.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,18 @@ namespace tao
8686
void number( const double v )
8787
{
8888
if( v >= 0 ) {
89-
const std::uint64_t u = v;
89+
const std::uint64_t u = static_cast< std::uint64_t >( v );
9090
if( u == v ) {
9191
number( u );
9292
return;
9393
}
9494
}
95-
const std::int64_t i = v;
96-
if( i == v ) {
97-
number( i );
98-
return;
95+
else {
96+
const std::int64_t i = static_cast< std::int64_t >( v );
97+
if( i == v ) {
98+
number( i );
99+
return;
100+
}
99101
}
100102
m_digests.back()->feed( 'd' );
101103
m_digests.back()->feed( &v, sizeof( v ) );

include/tao/json/traits.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ namespace tao
129129
struct number_trait
130130
{
131131
template< template< typename... > class Traits >
132-
static void extract( const basic_value< Traits >& v, T& i )
132+
static void extract( const basic_value< Traits >& v, T& n )
133133
{
134134
switch( v.type() ) {
135135
case type::SIGNED:
136-
i = v.unsafe_get_signed();
136+
n = static_cast< T >( v.unsafe_get_signed() );
137137
break;
138138
case type::UNSIGNED:
139-
i = v.unsafe_get_unsigned();
139+
n = static_cast< T >( v.unsafe_get_unsigned() );
140140
break;
141141
case type::DOUBLE:
142-
i = v.unsafe_get_double();
142+
n = static_cast< T >( v.unsafe_get_double() );
143143
break;
144144
default:
145145
TAOCPP_JSON_THROW_TYPE_ERROR( v.type() );

0 commit comments

Comments
 (0)