@@ -62,10 +62,10 @@ namespace tao::json::cbor
6262 {
6363 const auto b = json::internal::peek_uint8 ( in );
6464 switch ( b ) {
65- case std::uint8_t ( major::OTHER ) + 20 :
66- case std::uint8_t ( major::OTHER ) + 21 :
65+ case static_cast < std::uint8_t > ( major::OTHER ) + 20 :
66+ case static_cast < std::uint8_t > ( major::OTHER ) + 21 :
6767 in.bump_in_this_line ( 1 );
68- return bool ( b - std::uint8_t ( major::OTHER ) - 20 );
68+ return static_cast < bool > ( b - static_cast < std::uint8_t > ( major::OTHER ) - 20 );
6969 default :
7070 throw pegtl::parse_error ( " expected boolean" , in );
7171 }
@@ -84,8 +84,7 @@ namespace tao::json::cbor
8484 template < typename ... Ts >
8585 explicit basic_parts_parser ( Ts&&... ts )
8686 : m_input( std::forward< Ts >( ts )... )
87- {
88- }
87+ {}
8988
9089 [[nodiscard]] bool empty ()
9190 {
@@ -94,7 +93,7 @@ namespace tao::json::cbor
9493
9594 [[nodiscard]] bool null ()
9695 {
97- if ( json::internal::peek_uint8 ( m_input ) == std::uint8_t ( internal::major::OTHER ) + 22 ) {
96+ if ( json::internal::peek_uint8 ( m_input ) == static_cast < std::uint8_t > ( internal::major::OTHER ) + 22 ) {
9897 m_input.bump_in_this_line ( 1 );
9998 return true ;
10099 }
@@ -144,7 +143,7 @@ namespace tao::json::cbor
144143 [[nodiscard]] std::string_view string_view ()
145144 {
146145 const auto b = json::internal::peek_uint8 ( m_input );
147- if ( b != std::uint8_t ( internal::major::STRING ) + internal::minor_mask ) {
146+ if ( b != static_cast < std::uint8_t > ( internal::major::STRING ) + internal::minor_mask ) {
148147 throw pegtl::parse_error ( " expected definitive string" , m_input );
149148 }
150149 return internal::read_string_1< V, std::string_view >( m_input );
@@ -153,7 +152,7 @@ namespace tao::json::cbor
153152 [[nodiscard]] tao::binary_view binary_view ()
154153 {
155154 const auto b = json::internal::peek_uint8 ( m_input );
156- if ( b != std::uint8_t ( internal::major::BINARY ) + internal::minor_mask ) {
155+ if ( b != static_cast < std::uint8_t > ( internal::major::BINARY ) + internal::minor_mask ) {
157156 throw pegtl::parse_error ( " expected definitive binary" , m_input );
158157 }
159158 return internal::read_string_1< utf8_mode::trust, tao::binary_view >( m_input );
@@ -171,7 +170,7 @@ namespace tao::json::cbor
171170 if ( u > 9223372036854775807ULL ) {
172171 throw pegtl::parse_error ( " positive integer overflow" , m_input );
173172 }
174- return std::int64_t ( u );
173+ return static_cast < std::int64_t > ( u );
175174 }
176175
177176 [[nodiscard]] std::int64_t number_signed_negative ()
@@ -180,7 +179,7 @@ namespace tao::json::cbor
180179 if ( u > 9223372036854775808ULL ) {
181180 throw pegtl::parse_error ( " negative integer overflow" , m_input );
182181 }
183- return std::int64_t ( ~u );
182+ return static_cast < std::int64_t > ( ~u );
184183 }
185184
186185#if defined( _MSC_VER )
@@ -215,11 +214,11 @@ namespace tao::json::cbor
215214 {
216215 const auto b = json::internal::peek_uint8 ( m_input );
217216 switch ( b ) {
218- case std::uint8_t ( internal::major::OTHER ) + 25 :
217+ case static_cast < std::uint8_t > ( internal::major::OTHER ) + 25 :
219218 return internal::read_fp16 ( m_input );
220- case std::uint8_t ( internal::major::OTHER ) + 26 :
219+ case static_cast < std::uint8_t > ( internal::major::OTHER ) + 26 :
221220 return json::internal::read_big_endian_number< float >( m_input + 1 );
222- case std::uint8_t ( internal::major::OTHER ) + 27 :
221+ case static_cast < std::uint8_t > ( internal::major::OTHER ) + 27 :
223222 return json::internal::read_big_endian_number< double >( m_input + 1 );
224223 default :
225224 throw pegtl::parse_error ( " expected floating point number" , m_input );
0 commit comments