Use int32_t explicitly when serializing version (#2389)

Use int32_t explicitly when serializing version field of dmatrix in binary
format. On ILP64 architectures, although very little, size of int is 64 bits.
This commit is contained in:
Xiaoguang Sun 2017-06-08 01:03:42 +08:00 committed by Tianqi Chen
parent 85b2fb3eee
commit 2ae56ca84f

View File

@ -33,7 +33,7 @@ void MetaInfo::Clear() {
}
void MetaInfo::SaveBinary(dmlc::Stream *fo) const {
int version = kVersion;
int32_t version = kVersion;
fo->Write(&version, sizeof(version));
fo->Write(&num_row, sizeof(num_row));
fo->Write(&num_col, sizeof(num_col));