From 16012a9c0bb3121766c83996f98126fe267eb41d Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Thu, 5 Oct 2017 13:21:51 -0700 Subject: [PATCH 1/2] Use static cast to avoid compiler warning. --- cpp/src/plasma/io.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc index d604078114e..31b68e979a5 100644 --- a/cpp/src/plasma/io.cc +++ b/cpp/src/plasma/io.cc @@ -99,7 +99,7 @@ Status ReadMessage(int fd, int64_t* type, std::vector* buffer) { sizeof(length_temp)), *type = DISCONNECT_CLIENT); // The length must be read as an int64_t, but it should be used as a size_t. - size_t length = length_temp; + size_t length = std::static_cast(length_temp); if (length > buffer->size()) { buffer->resize(length); } From 638a2f844c5b36750ce1e3149388fe6287a9385b Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Thu, 5 Oct 2017 13:35:48 -0700 Subject: [PATCH 2/2] Fix bug. --- cpp/src/plasma/io.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc index 31b68e979a5..89c9e877a11 100644 --- a/cpp/src/plasma/io.cc +++ b/cpp/src/plasma/io.cc @@ -99,7 +99,7 @@ Status ReadMessage(int fd, int64_t* type, std::vector* buffer) { sizeof(length_temp)), *type = DISCONNECT_CLIENT); // The length must be read as an int64_t, but it should be used as a size_t. - size_t length = std::static_cast(length_temp); + size_t length = static_cast(length_temp); if (length > buffer->size()) { buffer->resize(length); }