1212#include " ../../external/byte.hpp"
1313#include " ../../internal/endian.hpp"
1414
15+ #ifdef _MSC_VER
16+ #pragma warning( push )
17+ #pragma warning( disable : 4310 )
18+ #endif
19+
1520namespace tao
1621{
1722 namespace json
@@ -52,7 +57,7 @@ namespace tao
5257 void number ( const std::int64_t v )
5358 {
5459 if ( ( v >= -32 ) && ( v <= -1 ) ) {
55- const std::int8_t x = v ;
60+ const std::int8_t x = static_cast < std:: int8_t >( v ) ;
5661 os.write ( reinterpret_cast < const char * >( &x ), sizeof ( x ) );
5762 }
5863 else if ( ( v >= -128 ) && ( v <= 127 ) ) {
@@ -61,7 +66,7 @@ namespace tao
6166 else if ( ( v >= -32768 ) && ( v <= 32767 ) ) {
6267 number_impl< std::uint16_t >( 0xd1 , v );
6368 }
64- else if ( ( v >= -2147483648 ) && ( v <= 2147483647 ) ) {
69+ else if ( ( v >= -2147483648ll ) && ( v <= 2147483647 ) ) {
6570 number_impl< std::uint32_t >( 0xd2 , v );
6671 }
6772 else {
@@ -72,7 +77,7 @@ namespace tao
7277 void number ( const std::uint64_t v )
7378 {
7479 if ( v <= 127 ) {
75- const std::uint8_t x = v ;
80+ const std::uint8_t x = static_cast < std:: uint8_t >( v ) ;
7681 os.write ( reinterpret_cast < const char * >( &x ), sizeof ( x ) );
7782 }
7883 else if ( v <= 255 ) {
@@ -215,4 +220,8 @@ namespace tao
215220
216221} // namespace tao
217222
223+ #ifdef _MSC_VER
224+ #pragma warning( pop )
225+ #endif
226+
218227#endif
0 commit comments