Added -Wconversion support for C++.

This commit is contained in:
Takatoshi Kondo
2019-03-20 17:35:00 +09:00
parent b759f5bdf7
commit 17267ed475
65 changed files with 498 additions and 219 deletions

View File

@@ -1,5 +1,12 @@
#include <msgpack.hpp>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <gtest/gtest.h>
#pragma GCC diagnostic pop
#include <sstream>
TEST(streaming, basic)
@@ -168,7 +175,7 @@ public:
while(true) {
pac.reserve_buffer(32*1024);
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), pac.buffer_capacity()));
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), static_cast<std::streamsize>(pac.buffer_capacity())));
if(len == 0) {
return;
@@ -240,7 +247,7 @@ TEST(streaming, basic_compat)
while(count < 3) {
pac.reserve_buffer(32*1024);
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), pac.buffer_capacity()));
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), static_cast<std::streamsize>(pac.buffer_capacity())));
pac.buffer_consumed(len);
while(pac.execute()) {
@@ -276,7 +283,7 @@ public:
while(true) {
pac.reserve_buffer(32*1024);
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), pac.buffer_capacity()));
size_t len = static_cast<size_t>(input.readsome(pac.buffer(), static_cast<std::streamsize>(pac.buffer_capacity())));
if(len == 0) {
return;