Reduce warnings stemming from libslic3r/Config.hpp (#13533)

https://github.com/prusa3d/PrusaSlicer/pull/15106
This commit is contained in:
Andrei
2026-05-16 15:16:57 +02:00
committed by GitHub
parent 82cedc0316
commit a0717853df

View File

@@ -330,6 +330,8 @@ public:
size_t hash() const throw() override { return std::hash<T>{}(this->value); }
// Warning mitigation: Indicate that virtual serialize() is not forgotten
using ConfigOption::serialize;
private:
friend class cereal::access;
template<class Archive> 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<class Archive> 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<double>::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<double>::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<int>::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<int>::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<std::string>::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<std::string>::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<NULLABLE>::vectors_equal(this->values, rhs.values); }
bool operator< (const ConfigOptionPercentsTempl &rhs) const throw() { return ConfigOptionFloatsTempl<NULLABLE>::vectors_lower(this->values, rhs.values); }
// Warning mitigation: Indicate that virtual operator == is not forgotten
using ConfigOptionFloatsTempl<NULLABLE>::operator ==;
std::string serialize() const override
{
std::ostringstream ss;
@@ -1287,6 +1315,9 @@ public:
*this = *static_cast<const ConfigOptionFloatOrPercent*>(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<FloatOrPercent>::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<Vec2d>::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<Vec2d>::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<Vec3d>::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<Vec2ds>::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<std::vector<int>>::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<bool>::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<unsigned char>::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<T>::operator ==;
std::string serialize() const override
{
const t_config_enum_names& names = ConfigOptionEnum<T>::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<const ConfigOptionEnumsGenericTempl *>(rhs)->values;
}
// Warning mitigation: Indicate that virtual operator == is not forgotten
using ConfigOptionInts::operator ==;
std::string serialize() const override
{
std::ostringstream ss;