From 3cae287deadf72c8d07640d1d6a765cbc9ecff88 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 14 Jul 2020 18:34:19 +0800 Subject: [PATCH] Fix NDK Build. (#5886) * Explicit cast for slice. --- src/c_api/c_api.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc index c3d814d445eb..aa6ecf43a784 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -227,7 +227,8 @@ XGB_DLL int XGDMatrixSliceDMatrixEx(DMatrixHandle handle, << "slice does not support group structure"; } DMatrix* dmat = static_cast*>(handle)->get(); - *out = new std::shared_ptr(dmat->Slice({idxset, len})); + *out = new std::shared_ptr( + dmat->Slice({idxset, static_cast(len)})); API_END(); }