fix platform dependent thing

This commit is contained in:
Tianqi Chen
2015-04-25 20:40:43 -07:00
parent 84515cd2a8
commit afdebe8d8f
4 changed files with 8 additions and 7 deletions

View File

@@ -166,12 +166,12 @@ class BoostLearner : public rabit::Serializable {
{
// backward compatibility code for compatible with old model type
// for new model, Read(&name_obj_) is suffice
size_t len;
uint64_t len;
utils::Check(fi.Read(&len, sizeof(len)) != 0, "BoostLearner: wrong model format");
if (len >= std::numeric_limits<unsigned>::max()) {
int gap;
utils::Check(fi.Read(&gap, sizeof(gap)) != 0, "BoostLearner: wrong model format");
len = len >> 32UL;
len = len >> static_cast<uint64_t>(32UL);
}
if (len != 0) {
name_obj_.resize(len);