From 3d7375e3ad3c63c00c61a249a8d91913a3026380 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 2 Nov 2023 13:43:52 +0100 Subject: [PATCH] Material: fix compiler warnings * unused parameter 'parent' [-Wunused-parameter] * reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to false [-Wtautological-undefined-compare] --- src/Mod/Material/App/Materials.cpp | 4 ++-- src/Mod/Material/App/Model.cpp | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Mod/Material/App/Materials.cpp b/src/Mod/Material/App/Materials.cpp index 050b2147f6..b567d9fad3 100644 --- a/src/Mod/Material/App/Materials.cpp +++ b/src/Mod/Material/App/Materials.cpp @@ -1377,7 +1377,7 @@ QStringList Material::normalizeModels(const QStringList& models) * Set or change the base material for the current material, updating the properties as * required. */ -void Material::updateInheritance(const QString& parent) +void Material::updateInheritance([[maybe_unused]]const QString& parent) {} /* @@ -1413,5 +1413,5 @@ QStringList Material::inheritedAddedModels(const Material& parent) /* * Return a list of properties that have different values from the parent material */ -void Material::inheritedPropertyDiff(const QString& parent) +void Material::inheritedPropertyDiff([[maybe_unused]]const QString& parent) {} diff --git a/src/Mod/Material/App/Model.cpp b/src/Mod/Material/App/Model.cpp index c9b95e85f8..2d30bdadc3 100644 --- a/src/Mod/Material/App/Model.cpp +++ b/src/Mod/Material/App/Model.cpp @@ -90,10 +90,6 @@ bool ModelProperty::operator==(const ModelProperty& other) const return true; } - if (&other == nullptr) { - return false; - } - return (_name == other._name) && (_propertyType == other._propertyType) && (_units == other._units) && (_url == other._url) && (_description == other._description) && (_inheritance == other._inheritance);