Cleanup warnings. (#5247)

From clang-tidy-9 and gcc-7: Invalid case style, narrowing definition, wrong
initialization order, unused variables.
This commit is contained in:
Jiaming Yuan
2020-01-31 14:52:15 +08:00
committed by GitHub
parent adc795929a
commit fe8d72b50b
8 changed files with 260 additions and 262 deletions

View File

@@ -257,7 +257,7 @@ XGB_DLL int XGDMatrixCreateFromMat(const bst_float* data,
xgboost::bst_ulong ncol, bst_float missing,
DMatrixHandle* out) {
API_BEGIN();
data::DenseAdapter adapter(data, nrow, nrow * ncol, ncol);
data::DenseAdapter adapter(data, nrow, ncol);
*out = new std::shared_ptr<DMatrix>(DMatrix::Create(&adapter, missing, 1));
API_END();
}
@@ -268,7 +268,7 @@ XGB_DLL int XGDMatrixCreateFromMat_omp(const bst_float* data, // NOLINT
bst_float missing, DMatrixHandle* out,
int nthread) {
API_BEGIN();
data::DenseAdapter adapter(data, nrow, nrow * ncol, ncol);
data::DenseAdapter adapter(data, nrow, ncol);
*out = new std::shared_ptr<DMatrix>(DMatrix::Create(&adapter, missing, nthread));
API_END();
}