From 0a054faf23a6922e614bdbd3ff427e06d9162061 Mon Sep 17 00:00:00 2001 From: Cliff Green Date: Mon, 30 Mar 2020 12:43:36 -0700 Subject: [PATCH] Static casts added as appropriate to eliminate VC++ warnings. --- example/echo_binary_text_server_demo.cpp | 2 +- test/net_ip/detail/output_queue_test.cpp | 2 +- test/shared_test/msg_handling_test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/echo_binary_text_server_demo.cpp b/example/echo_binary_text_server_demo.cpp index fdae800..d3c039d 100644 --- a/example/echo_binary_text_server_demo.cpp +++ b/example/echo_binary_text_server_demo.cpp @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) { // create buffer to send altered text back to client chops::mutable_shared_buffer buf_out; // 1st 2 bytes are the size of the message - uint16_t size_val = s.size(); + uint16_t size_val = static_cast(s.size()); // endian correct data marshalling std::byte tbuf[HDR_SIZE]; // temp buffer to hold the header // write those 2 bytes to the temp buffer diff --git a/test/net_ip/detail/output_queue_test.cpp b/test/net_ip/detail/output_queue_test.cpp index 6bcf7ab..22bacae 100644 --- a/test/net_ip/detail/output_queue_test.cpp +++ b/test/net_ip/detail/output_queue_test.cpp @@ -50,7 +50,7 @@ void output_queue_test(const std::vector& data_vec, int multiplier) { REQUIRE (qs.output_queue_size == tot); REQUIRE (qs.bytes_in_output_queue == chops::test::accum_io_buf_size(data_vec) * multiplier); - chops::repeat(tot, [&outq] { + chops::repeat(static_cast(tot), [&outq] { auto e = outq.get_next_element(); // REQUIRE (e); assert (e); diff --git a/test/shared_test/msg_handling_test.cpp b/test/shared_test/msg_handling_test.cpp index 35a7b9a..c3f9555 100644 --- a/test/shared_test/msg_handling_test.cpp +++ b/test/shared_test/msg_handling_test.cpp @@ -110,7 +110,7 @@ void make_msg_vec_test(F&& f) { GIVEN ("A preamble and a char to repeat") { auto empty = make_empty_body_msg(f); - int delta = empty.size(); + auto delta = empty.size(); REQUIRE (delta <= 2); WHEN ("make_msg_vec is called") { auto vb = make_msg_vec(f, "Good tea!", 'Z', 20);