@@ -175,7 +175,7 @@ class ResponseHandler : public http_client::EventHandler
175175 error_message << " [OTLP HTTP Client] Session state: session create failed." ;
176176 if (!reason.empty ())
177177 {
178- error_message.write (reason.data (), reason.size ());
178+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
179179 }
180180 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
181181 }
@@ -207,7 +207,7 @@ class ResponseHandler : public http_client::EventHandler
207207 error_message << " [OTLP HTTP Client] Session state: connection failed." ;
208208 if (!reason.empty ())
209209 {
210- error_message.write (reason.data (), reason.size ());
210+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
211211 }
212212 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
213213 }
@@ -232,7 +232,7 @@ class ResponseHandler : public http_client::EventHandler
232232 error_message << " [OTLP HTTP Client] Session state: request send failed." ;
233233 if (!reason.empty ())
234234 {
235- error_message.write (reason.data (), reason.size ());
235+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
236236 }
237237 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
238238 }
@@ -250,7 +250,7 @@ class ResponseHandler : public http_client::EventHandler
250250 error_message << " [OTLP HTTP Client] Session state: SSL handshake failed." ;
251251 if (!reason.empty ())
252252 {
253- error_message.write (reason.data (), reason.size ());
253+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
254254 }
255255 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
256256 }
@@ -261,7 +261,7 @@ class ResponseHandler : public http_client::EventHandler
261261 error_message << " [OTLP HTTP Client] Session state: request time out." ;
262262 if (!reason.empty ())
263263 {
264- error_message.write (reason.data (), reason.size ());
264+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
265265 }
266266 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
267267 }
@@ -272,7 +272,7 @@ class ResponseHandler : public http_client::EventHandler
272272 error_message << " [OTLP HTTP Client] Session state: network error." ;
273273 if (!reason.empty ())
274274 {
275- error_message.write (reason.data (), reason.size ());
275+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
276276 }
277277 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
278278 }
@@ -297,7 +297,7 @@ class ResponseHandler : public http_client::EventHandler
297297 error_message << " [OTLP HTTP Client] Session state: (manually) cancelled." ;
298298 if (!reason.empty ())
299299 {
300- error_message.write (reason.data (), reason.size ());
300+ error_message.write (reason.data (), static_cast <std::streamsize>( reason.size () ));
301301 }
302302 OTEL_INTERNAL_LOG_ERROR (error_message.str ());
303303 }
@@ -376,11 +376,11 @@ static inline char HexEncode(unsigned char byte)
376376#endif
377377 if (byte >= 10 )
378378 {
379- return byte - 10 + ' a' ;
379+ return static_cast < char >( byte - 10 + ' a' ) ;
380380 }
381381 else
382382 {
383- return byte + ' 0' ;
383+ return static_cast < char >( byte + ' 0' ) ;
384384 }
385385}
386386
@@ -664,7 +664,7 @@ void ConvertListFieldToJson(nlohmann::json &value,
664664
665665OtlpHttpClient::OtlpHttpClient (OtlpHttpClientOptions &&options)
666666 : is_shutdown_(false ),
667- options_ (options),
667+ options_ (std::move( options) ),
668668 http_client_(http_client::HttpClientFactory::Create(options.thread_instrumentation)),
669669 start_session_counter_(0 ),
670670 finished_session_counter_(0 )
0 commit comments