From c7b94e6c9551f6e1f4ee769a5f083594c83fd723 Mon Sep 17 00:00:00 2001 From: fis Date: Wed, 21 Apr 2021 16:06:15 +0800 Subject: [PATCH] Fix warning on Windows. --- src/c_api/c_api.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc index 0ccb63100498..58d4dba15dc6 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -734,8 +734,9 @@ XGB_DLL int XGBoosterPredictFromCSR(BoosterHandle handle, char const *indptr, API_BEGIN(); CHECK_HANDLE(); std::shared_ptr x{ - new xgboost::data::CSRArrayAdapter{ - StringView{indptr}, StringView{indices}, StringView{data}, cols}}; + new xgboost::data::CSRArrayAdapter{StringView{indptr}, + StringView{indices}, StringView{data}, + static_cast(cols)}}; std::shared_ptr p_m {nullptr}; if (m) { p_m = *static_cast *>(m);