Skip to content

Commit 4f63075

Browse files
committed
Resolve some warnings from MSVC
1 parent dde11aa commit 4f63075

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

include/tao/json/events/key_camel_case_to_snake_case.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace tao
5151
r += '_';
5252
}
5353
last_lower = false;
54-
r += std::tolower( c );
54+
r += (char)std::tolower( c );
5555
}
5656
else {
5757
last_lower = std::islower( c );

include/tao/json/events/key_snake_case_to_camel_case.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace tao
3737
active = false;
3838
}
3939
else {
40-
r += std::toupper( c );
40+
r += (char)std::toupper( c );
4141
active = false;
4242
}
4343
}

include/tao/json/events/ubjson/grammar.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace tao
195195
static Result read_number( Input& in )
196196
{
197197
if( in.size( sizeof( Number ) ) > sizeof( Number ) ) {
198-
const Result result = json::internal::be_to_h< Number >( in.current() + 1 );
198+
const Result result = static_cast< Result >( json::internal::be_to_h< Number >( in.current() + 1 ) );
199199
in.bump_in_this_line( 1 + sizeof( Number ) );
200200
return result;
201201
}

include/tao/json/schema.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace tao
8383
}
8484
if( month == 2 ) {
8585
const bool is_leap_year = ( year % 4 == 0 ) && ( year % 100 != 0 || year % 400 == 0 );
86-
if( day > ( is_leap_year ? 29 : 28 ) ) {
86+
if( day > ( is_leap_year ? 29u : 28u ) ) {
8787
return false;
8888
}
8989
}
@@ -974,7 +974,7 @@ namespace tao
974974
}
975975
break;
976976
case HAS_MULTIPLE_OF_DOUBLE:
977-
if( !is_multiple_of( v, m_node->m_multiple_of.d ) ) {
977+
if( !is_multiple_of( (double)v, m_node->m_multiple_of.d ) ) {
978978
m_match = false;
979979
}
980980
break;
@@ -990,7 +990,7 @@ namespace tao
990990
}
991991
break;
992992
case HAS_MULTIPLE_OF_DOUBLE:
993-
if( !is_multiple_of( v, m_node->m_multiple_of.d ) ) {
993+
if( !is_multiple_of( (double)v, m_node->m_multiple_of.d ) ) {
994994
m_match = false;
995995
}
996996
break;
@@ -1001,7 +1001,7 @@ namespace tao
10011001
{
10021002
switch( m_node->m_flags & HAS_MULTIPLE_OF ) {
10031003
case HAS_MULTIPLE_OF_UNSIGNED:
1004-
if( !is_multiple_of( v, m_node->m_multiple_of.u ) ) {
1004+
if( !is_multiple_of( v, (double)m_node->m_multiple_of.u ) ) {
10051005
m_match = false;
10061006
}
10071007
break;

src/test/json/type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace tao
1111
{
1212
void unit_test()
1313
{
14-
TEST_ASSERT( sizeof( type ) == 1 );
14+
static_assert( sizeof( type ) == 1, "oops" );
1515

1616
TEST_ASSERT( to_string( type::UNINITIALIZED ) == std::string( "uninitialized" ) );
1717
TEST_ASSERT( to_string( type::DISCARDED ) == std::string( "discarded" ) );

0 commit comments

Comments
 (0)