Compiler warnings (#6286)

* Fix warnings for json.h

* Fix warnings for metric.h

* Fix warnings for updater_quantile_hist.cc.

* Fix warnings for updater_histmaker.cc.

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
vcarpani 2020-10-28 21:46:15 +01:00 committed by GitHub
parent e8884c4637
commit 671971e12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -250,7 +250,7 @@ class JsonNull : public Value {
public: public:
JsonNull() : Value(ValueKind::kNull) {} JsonNull() : Value(ValueKind::kNull) {}
JsonNull(std::nullptr_t) : Value(ValueKind::kNull) {} // NOLINT JsonNull(std::nullptr_t) : Value(ValueKind::kNull) {} // NOLINT
JsonNull(JsonNull&& that) : Value(ValueKind::kNull) {} JsonNull(JsonNull&&) : Value(ValueKind::kNull) {}
void Save(JsonWriter* writer) override; void Save(JsonWriter* writer) override;

View File

@ -34,7 +34,7 @@ class Metric : public Configurable {
* \param args arguments to the objective function. * \param args arguments to the objective function.
*/ */
virtual void Configure( virtual void Configure(
const std::vector<std::pair<std::string, std::string> >& args) {} const std::vector<std::pair<std::string, std::string> >&) {}
/*! /*!
* \brief Load configuration from JSON object * \brief Load configuration from JSON object
* By default, metric has no internal configuration; * By default, metric has no internal configuration;

View File

@ -146,7 +146,7 @@ class HistMaker: public BaseMaker {
const std::vector <bst_feature_t> &fset, const std::vector <bst_feature_t> &fset,
const RegTree &tree) = 0; const RegTree &tree) = 0;
// initialize the current working set of features in this round // initialize the current working set of features in this round
virtual void InitWorkSet(DMatrix *p_fmat, virtual void InitWorkSet(DMatrix *,
const RegTree &tree, const RegTree &tree,
std::vector<bst_feature_t> *p_fset) { std::vector<bst_feature_t> *p_fset) {
p_fset->resize(tree.param.num_feature); p_fset->resize(tree.param.num_feature);

View File

@ -127,12 +127,12 @@ bool QuantileHistMaker::UpdatePredictionCache(
template <typename GradientSumT> template <typename GradientSumT>
void BatchHistSynchronizer<GradientSumT>::SyncHistograms(BuilderT *builder, void BatchHistSynchronizer<GradientSumT>::SyncHistograms(BuilderT *builder,
int starting_index, int,
int sync_count, int,
RegTree *p_tree) { RegTree *p_tree) {
builder->builder_monitor_.Start("SyncHistograms"); builder->builder_monitor_.Start("SyncHistograms");
const size_t nbins = builder->hist_builder_.GetNumBins(); const size_t nbins = builder->hist_builder_.GetNumBins();
common::BlockedSpace2d space(builder->nodes_for_explicit_hist_build_.size(), [&](size_t node) { common::BlockedSpace2d space(builder->nodes_for_explicit_hist_build_.size(), [&](size_t) {
return nbins; return nbins;
}, 1024); }, 1024);
@ -159,7 +159,7 @@ void DistributedHistSynchronizer<GradientSumT>::SyncHistograms(BuilderT* builder
RegTree *p_tree) { RegTree *p_tree) {
builder->builder_monitor_.Start("SyncHistograms"); builder->builder_monitor_.Start("SyncHistograms");
const size_t nbins = builder->hist_builder_.GetNumBins(); const size_t nbins = builder->hist_builder_.GetNumBins();
common::BlockedSpace2d space(builder->nodes_for_explicit_hist_build_.size(), [&](size_t node) { common::BlockedSpace2d space(builder->nodes_for_explicit_hist_build_.size(), [&](size_t) {
return nbins; return nbins;
}, 1024); }, 1024);
common::ParallelFor2d(space, builder->nthread_, [&](size_t node, common::Range1d r) { common::ParallelFor2d(space, builder->nthread_, [&](size_t node, common::Range1d r) {
@ -188,7 +188,7 @@ void DistributedHistSynchronizer<GradientSumT>::SyncHistograms(BuilderT* builder
ParallelSubtractionHist(builder, space, builder->nodes_for_explicit_hist_build_, p_tree); ParallelSubtractionHist(builder, space, builder->nodes_for_explicit_hist_build_, p_tree);
common::BlockedSpace2d space2(builder->nodes_for_subtraction_trick_.size(), [&](size_t node) { common::BlockedSpace2d space2(builder->nodes_for_subtraction_trick_.size(), [&](size_t) {
return nbins; return nbins;
}, 1024); }, 1024);
ParallelSubtractionHist(builder, space2, builder->nodes_for_subtraction_trick_, p_tree); ParallelSubtractionHist(builder, space2, builder->nodes_for_subtraction_trick_, p_tree);
@ -219,7 +219,7 @@ template <typename GradientSumT>
void BatchHistRowsAdder<GradientSumT>::AddHistRows(BuilderT *builder, void BatchHistRowsAdder<GradientSumT>::AddHistRows(BuilderT *builder,
int *starting_index, int *starting_index,
int *sync_count, int *sync_count,
RegTree *p_tree) { RegTree *) {
builder->builder_monitor_.Start("AddHistRows"); builder->builder_monitor_.Start("AddHistRows");
for (auto const& entry : builder->nodes_for_explicit_hist_build_) { for (auto const& entry : builder->nodes_for_explicit_hist_build_) {