From 693058abb7a4bce2ff0c73ba60a79ada8c764196 Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Tue, 19 Mar 2024 14:25:07 -0400 Subject: [PATCH] Eliminate gcc13 warnings. --- 3rdparty/json11/json11.cpp | 16 ++++++++-------- common/place/parallel_refine.cc | 2 -- common/place/placer1.cc | 2 -- common/place/placer_static.cc | 6 ------ 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/3rdparty/json11/json11.cpp b/3rdparty/json11/json11.cpp index faa6cf64..a0fcf866 100644 --- a/3rdparty/json11/json11.cpp +++ b/3rdparty/json11/json11.cpp @@ -152,7 +152,7 @@ protected: // Constructors explicit Value(const T &value) : m_value(value) {} - explicit Value(T &&value) : m_value(move(value)) {} + explicit Value(T &&value) : m_value(std::move(value)) {} // Get type tag Json::Type type() const override { @@ -199,7 +199,7 @@ class JsonString final : public Value { const string &string_value() const override { return m_value; } public: explicit JsonString(const string &value) : Value(value) {} - explicit JsonString(string &&value) : Value(move(value)) {} + explicit JsonString(string &&value) : Value(std::move(value)) {} }; class JsonArray final : public Value { @@ -207,7 +207,7 @@ class JsonArray final : public Value { const Json & operator[](size_t i) const override; public: explicit JsonArray(const Json::array &value) : Value(value) {} - explicit JsonArray(Json::array &&value) : Value(move(value)) {} + explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} }; class JsonObject final : public Value { @@ -215,7 +215,7 @@ class JsonObject final : public Value { const Json & operator[](const string &key) const override; public: explicit JsonObject(const Json::object &value) : Value(value) {} - explicit JsonObject(Json::object &&value) : Value(move(value)) {} + explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} }; class JsonNull final : public Value { @@ -257,12 +257,12 @@ Json::Json(double value) : m_ptr(make_shared(value)) { Json::Json(int value) : m_ptr(make_shared(value)) {} Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} Json::Json(const string &value) : m_ptr(make_shared(value)) {} -Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} Json::Json(const char * value) : m_ptr(make_shared(value)) {} Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} /* * * * * * * * * * * * * * * * * * * * * Accessors @@ -360,7 +360,7 @@ struct JsonParser final { * Mark this parse as failed. */ Json fail(string &&msg) { - return fail(move(msg), Json()); + return fail(std::move(msg), Json()); } template diff --git a/common/place/parallel_refine.cc b/common/place/parallel_refine.cc index da8ed4fc..dab45eba 100644 --- a/common/place/parallel_refine.cc +++ b/common/place/parallel_refine.cc @@ -177,7 +177,6 @@ struct ThreadState : DetailPlacerThreadState { IdString targetType = cell->type; Loc curr_loc = ctx->getBelLocation(cell->bel); - int count = 0; int dx = g.radius, dy = g.radius; if (cell->region != nullptr && cell->region->constr_bels) { @@ -217,7 +216,6 @@ struct ThreadState : DetailPlacerThreadState } if (!cell->testRegion(bel)) continue; - count++; return bel; } } diff --git a/common/place/placer1.cc b/common/place/placer1.cc index 057f0106..b2009e08 100644 --- a/common/place/placer1.cc +++ b/common/place/placer1.cc @@ -732,7 +732,6 @@ class SAPlacer { IdString targetType = cell->type; Loc curr_loc = ctx->getBelLocation(cell->bel); - int count = 0; int dx = diameter, dy = diameter; if (cell->region != nullptr && cell->region->constr_bels) { @@ -772,7 +771,6 @@ class SAPlacer continue; if (locked_bels.find(bel) != locked_bels.end()) continue; - count++; return bel; } } diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index 9b3d8556..56e46032 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -917,7 +917,6 @@ class StaticPlacer { float coord_dist = 0; float grad_dist = 0; - int n = 0; for (auto &cell : mcells) { coord_dist += (cell.ref_pos.x - cell.last_ref_pos.x) * (cell.ref_pos.x - cell.last_ref_pos.x); coord_dist += (cell.ref_pos.y - cell.last_ref_pos.y) * (cell.ref_pos.y - cell.last_ref_pos.y); @@ -925,8 +924,6 @@ class StaticPlacer (cell.ref_total_grad.x - cell.last_total_grad.x) * (cell.ref_total_grad.x - cell.last_total_grad.x); grad_dist += (cell.ref_total_grad.y - cell.last_total_grad.y) * (cell.ref_total_grad.y - cell.last_total_grad.y); - // keep track of N separately, because we might exclude some cells - ++n; } coord_dist = std::sqrt(coord_dist / (2 * float(mcells.size()))); grad_dist = std::sqrt(grad_dist / (2 * float(mcells.size()))); @@ -1155,7 +1152,6 @@ class StaticPlacer int radius = 0; int iter = 0; int iter_at_radius = 0; - int total_iters_for_cell = 0; bool placed = false; BelId bestBel; int best_inp_len = std::numeric_limits::max(); @@ -1374,8 +1370,6 @@ class StaticPlacer break; } } - - total_iters_for_cell++; } } }