Skip to content

Commit

Permalink
Cleanup warnings. (#5247)
Browse files Browse the repository at this point in the history
From clang-tidy-9 and gcc-7: Invalid case style, narrowing definition, wrong
initialization order, unused variables.
  • Loading branch information
trivialfis authored Jan 31, 2020
1 parent adc7959 commit fe8d72b
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 262 deletions.
2 changes: 2 additions & 0 deletions include/xgboost/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace xgboost {
class Json;

struct Model {
virtual ~Model() = default;
/*!
* \brief load the model from a json object
* \param in json object where to load the model from
Expand All @@ -28,6 +29,7 @@ struct Model {
};

struct Configurable {
virtual ~Configurable() = default;
/*!
* \brief Load configuration from JSON object
* \param in JSON object containing the configuration
Expand Down
4 changes: 2 additions & 2 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down
Loading

0 comments on commit fe8d72b

Please sign in to comment.