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