@@ -62,10 +62,10 @@ namespace tao::json::cbor
62
62
{
63
63
const auto b = json::internal::peek_uint8 ( in );
64
64
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 :
67
67
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 );
69
69
default :
70
70
throw pegtl::parse_error ( " expected boolean" , in );
71
71
}
@@ -84,8 +84,7 @@ namespace tao::json::cbor
84
84
template < typename ... Ts >
85
85
explicit basic_parts_parser ( Ts&&... ts )
86
86
: m_input( std::forward< Ts >( ts )... )
87
- {
88
- }
87
+ {}
89
88
90
89
[[nodiscard]] bool empty ()
91
90
{
@@ -94,7 +93,7 @@ namespace tao::json::cbor
94
93
95
94
[[nodiscard]] bool null ()
96
95
{
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 ) {
98
97
m_input.bump_in_this_line ( 1 );
99
98
return true ;
100
99
}
@@ -144,7 +143,7 @@ namespace tao::json::cbor
144
143
[[nodiscard]] std::string_view string_view ()
145
144
{
146
145
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 ) {
148
147
throw pegtl::parse_error ( " expected definitive string" , m_input );
149
148
}
150
149
return internal::read_string_1< V, std::string_view >( m_input );
@@ -153,7 +152,7 @@ namespace tao::json::cbor
153
152
[[nodiscard]] tao::binary_view binary_view ()
154
153
{
155
154
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 ) {
157
156
throw pegtl::parse_error ( " expected definitive binary" , m_input );
158
157
}
159
158
return internal::read_string_1< utf8_mode::trust, tao::binary_view >( m_input );
@@ -171,7 +170,7 @@ namespace tao::json::cbor
171
170
if ( u > 9223372036854775807ULL ) {
172
171
throw pegtl::parse_error ( " positive integer overflow" , m_input );
173
172
}
174
- return std::int64_t ( u );
173
+ return static_cast < std::int64_t > ( u );
175
174
}
176
175
177
176
[[nodiscard]] std::int64_t number_signed_negative ()
@@ -180,7 +179,7 @@ namespace tao::json::cbor
180
179
if ( u > 9223372036854775808ULL ) {
181
180
throw pegtl::parse_error ( " negative integer overflow" , m_input );
182
181
}
183
- return std::int64_t ( ~u );
182
+ return static_cast < std::int64_t > ( ~u );
184
183
}
185
184
186
185
#if defined( _MSC_VER )
@@ -215,11 +214,11 @@ namespace tao::json::cbor
215
214
{
216
215
const auto b = json::internal::peek_uint8 ( m_input );
217
216
switch ( b ) {
218
- case std::uint8_t ( internal::major::OTHER ) + 25 :
217
+ case static_cast < std::uint8_t > ( internal::major::OTHER ) + 25 :
219
218
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 :
221
220
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 :
223
222
return json::internal::read_big_endian_number< double >( m_input + 1 );
224
223
default :
225
224
throw pegtl::parse_error ( " expected floating point number" , m_input );
0 commit comments