From d16b2c9670d1849a360b94d581250aa1796d4abd Mon Sep 17 00:00:00 2001 From: tqchen Date: Sat, 25 Apr 2015 21:24:54 -0700 Subject: [PATCH] Squashed 'subtree/rabit/' changes from 27340f9..fed1683 fed1683 minor c01520f change git-subtree-dir: subtree/rabit git-subtree-split: fed1683b9bb031041cc2bf113633cfd40c9faf46 --- include/dmlc/io.h | 10 ++++++---- windows/rabit/rabit.vcxproj | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/dmlc/io.h b/include/dmlc/io.h index 8caf2a1f7..3db41c109 100644 --- a/include/dmlc/io.h +++ b/include/dmlc/io.h @@ -310,9 +310,10 @@ template inline bool Stream::Read(std::vector *out_vec) { uint64_t sz; if (this->Read(&sz, sizeof(sz)) == 0) return false; - out_vec->resize(static_cast(sz)); + size_t size = static_cast(sz); + out_vec->resize(size); if (sz != 0) { - if (this->Read(&(*out_vec)[0], sizeof(T) * sz) == 0) return false; + if (this->Read(&(*out_vec)[0], sizeof(T) * size) == 0) return false; } return true; } @@ -326,9 +327,10 @@ inline void Stream::Write(const std::string &str) { inline bool Stream::Read(std::string *out_str) { uint64_t sz; if (this->Read(&sz, sizeof(sz)) == 0) return false; - out_str->resize(static_cast(sz)); + size_t size = static_cast(sz); + out_str->resize(size); if (sz != 0) { - if (this->Read(&(*out_str)[0], sizeof(char) * sz) == 0) { + if (this->Read(&(*out_str)[0], sizeof(char) * size) == 0) { return false; } } diff --git a/windows/rabit/rabit.vcxproj b/windows/rabit/rabit.vcxproj index 12cb43e07..5948e4c17 100644 --- a/windows/rabit/rabit.vcxproj +++ b/windows/rabit/rabit.vcxproj @@ -34,7 +34,7 @@ MultiByte - DynamicLibrary + StaticLibrary false true MultiByte