Fix warning on Windows. (#6883)

This commit is contained in:
Jiaming Yuan 2021-04-22 02:57:23 +08:00 committed by GitHub
parent a347ef7c66
commit a6d1fbf8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -734,8 +734,9 @@ XGB_DLL int XGBoosterPredictFromCSR(BoosterHandle handle, char const *indptr,
API_BEGIN();
CHECK_HANDLE();
std::shared_ptr<xgboost::data::CSRArrayAdapter> x{
new xgboost::data::CSRArrayAdapter{
StringView{indptr}, StringView{indices}, StringView{data}, cols}};
new xgboost::data::CSRArrayAdapter{StringView{indptr},
StringView{indices}, StringView{data},
static_cast<size_t>(cols)}};
std::shared_ptr<DMatrix> p_m {nullptr};
if (m) {
p_m = *static_cast<std::shared_ptr<DMatrix> *>(m);