From a0717853dfec33bcc08d32896cd884b0b35ca355 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 16 May 2026 15:16:57 +0200 Subject: [PATCH] Reduce warnings stemming from libslic3r/Config.hpp (#13533) https://github.com/prusa3d/PrusaSlicer/pull/15106 --- src/libslic3r/Config.hpp | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index a77946cc9b..fe57e92d2d 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -330,6 +330,8 @@ public: size_t hash() const throw() override { return std::hash{}(this->value); } + // Warning mitigation: Indicate that virtual serialize() is not forgotten + using ConfigOption::serialize; private: friend class cereal::access; template void serialize(Archive & ar) { ar(this->value); } @@ -752,6 +754,8 @@ public: return modified; } + // Warning mitigation: Indicate that virtual serialize() is not forgotten + using ConfigOptionVectorBase::serialize; private: friend class cereal::access; template void serialize(Archive & ar) { ar(this->values); } @@ -770,6 +774,9 @@ public: bool operator==(const ConfigOptionFloat &rhs) const throw() { return is_approx(this->value, rhs.value); } bool operator< (const ConfigOptionFloat &rhs) const throw() { return this->value < rhs.value; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -838,6 +845,9 @@ public: this->values[i] = nil_value(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -961,6 +971,9 @@ public: ConfigOption* clone() const override { return new ConfigOptionInt(*this); } bool operator==(const ConfigOptionInt &rhs) const throw() { return this->value == rhs.value; } + // Warning mitigation: Indicate that virtual operator == is not forgotten. + using ConfigOptionSingle::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1016,6 +1029,9 @@ public: this->values[i] = nil_value(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1094,6 +1110,9 @@ public: bool operator< (const ConfigOptionString &rhs) const throw() { return this->value < rhs.value; } bool empty() const { return this->value.empty(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { return escape_string_cstyle(this->value); @@ -1128,6 +1147,9 @@ public: bool operator< (const ConfigOptionStrings &rhs) const throw() { return this->values < rhs.values; } bool is_nil(size_t) const override { return false; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { return escape_strings_cstyle(this->values); @@ -1173,6 +1195,9 @@ public: double get_abs_value(double ratio_over) const { return ratio_over * this->value / 100; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionFloat::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1213,6 +1238,9 @@ public: bool operator==(const ConfigOptionPercentsTempl &rhs) const throw() { return ConfigOptionFloatsTempl::vectors_equal(this->values, rhs.values); } bool operator< (const ConfigOptionPercentsTempl &rhs) const throw() { return ConfigOptionFloatsTempl::vectors_lower(this->values, rhs.values); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionFloatsTempl::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1287,6 +1315,9 @@ public: *this = *static_cast(rhs); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionPercent::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1345,6 +1376,9 @@ public: this->values[i] = nil_value(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1458,6 +1492,9 @@ public: bool operator==(const ConfigOptionPoint &rhs) const throw() { return this->value == rhs.value; } bool operator< (const ConfigOptionPoint &rhs) const throw() { return this->value < rhs.value; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1497,6 +1534,9 @@ public: { return std::lexicographical_compare(this->values.begin(), this->values.end(), rhs.values.begin(), rhs.values.end(), [](const auto &l, const auto &r){ return l < r; }); } bool is_nil(size_t) const override { return false; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1574,6 +1614,9 @@ public: bool operator< (const ConfigOptionPoint3 &rhs) const throw() { return this->value.x() < rhs.value.x() || (this->value.x() == rhs.value.x() && (this->value.y() < rhs.value.y() || (this->value.y() == rhs.value.y() && this->value.z() < rhs.value.z()))); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1620,6 +1663,9 @@ public: bool nullable() const override { return false; } bool is_nil(size_t) const override { return false; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize()const override { std::ostringstream ss; @@ -1733,6 +1779,9 @@ public: bool nullable() const override { return false; } bool is_nil(size_t) const override { return false; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector>::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1816,6 +1865,9 @@ public: bool operator==(const ConfigOptionBool &rhs) const throw() { return this->value == rhs.value; } bool operator< (const ConfigOptionBool &rhs) const throw() { return int(this->value) < int(rhs.value); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { return std::string(this->value ? "1" : "0"); @@ -1887,6 +1939,9 @@ public: //FIXME this smells, the parent class has the method declared returning (unsigned char&). bool get_at(size_t i) const { return ((i < this->values.size()) ? this->values[i] : this->values.front()) != 0; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionVector::operator ==; + std::string serialize() const override { std::ostringstream ss; @@ -1999,6 +2054,9 @@ public: this->value = (T)rhs->getInt(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionSingle::operator ==; + std::string serialize() const override { const t_config_enum_names& names = ConfigOptionEnum::get_enum_names(); @@ -2069,6 +2127,9 @@ public: this->value = rhs->getInt(); } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionInt::operator ==; + std::string serialize() const override { for (const auto &kvp : *this->keys_map) @@ -2126,6 +2187,9 @@ public: this->values = dynamic_cast(rhs)->values; } + // Warning mitigation: Indicate that virtual operator == is not forgotten + using ConfigOptionInts::operator ==; + std::string serialize() const override { std::ostringstream ss;