Silence obvious compiler warnings

Generated with the assistance of an AI coding tool.
This commit is contained in:
Thomas Krijnen
2026-08-08 17:08:26 +02:00
parent b706121f53
commit 61f30dd200
28 changed files with 175 additions and 150 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ class json_serializer : public ifcopenshell::geom::serializer {
Dialect dialect_;
public:
json_serializer(ifcopenshell::file* file, const std::string& json_filename, Dialect dialect = Dialect::JSON_DIALECT_CREOOX, ifcopenshell::logger& logger = ifcopenshell::logger::root())
json_serializer(ifcopenshell::file* file, const std::string& json_filename, Dialect dialect = Dialect::JSON_DIALECT_CREOOX, ifcopenshell::logger& = ifcopenshell::logger::root())
: json_filename(json_filename)
, dialect_(dialect)
{
@@ -60,7 +60,7 @@ class get_type_visitor : public boost::static_visitor<std::string> {
get_type_visitor() = default;
template <typename T>
std::string operator()(const T& t) const {
std::string operator()(const T&) const {
// @todo more types
return "number";
}
@@ -416,7 +416,7 @@ void POSTFIX_SCHEMA(json_serializer)::finalize() {
}
#ifdef SCHEMA_HAS_IfcPreDefinedPropertySet
// ifc2x3 does not have this type yet, just inherits from IfcPropertySetDefinition
} else if (auto pset = inst.as<IfcSchema::IfcPreDefinedPropertySet>()) {
} else if (auto predefined_pset = inst.as<IfcSchema::IfcPreDefinedPropertySet>()) {
#else
} else {
#endif
@@ -132,8 +132,8 @@ std::optional<std::string> format_attribute(ifcopenshell::geom::abstract_mapping
// Appends to a node with possibly existing attributes
ptree* format_entity_instance(ifcopenshell::logger& log, ifcopenshell::geom::abstract_mapping* mapping, const express::base& instance, ptree& child, ptree& tree, bool as_link = false) {
const unsigned n = instance.declaration().as_entity()->attribute_count();
for (unsigned i = 0; i < n; ++i) {
const std::size_t n = instance.declaration().as_entity()->attribute_count();
for (std::size_t i = 0; i < n; ++i) {
try {
instance.get_attribute_value(i);
} catch (const std::exception&) {
@@ -792,9 +792,9 @@ void POSTFIX_SCHEMA(xml_serializer)::finalize() {
}
} else if (auto matlist = mat.concrete().as<IfcSchema::IfcMaterialList>()) {
auto mats = matlist.Materials();
for (auto& mat : mats) {
for (auto& list_material : mats) {
ptree subnode;
format_entity_instance(log, mapping_, mat, subnode, node);
format_entity_instance(log, mapping_, list_material, subnode, node);
}
}
format_entity_instance(log, mapping_, mat.concrete(), node, materials);
+1 -1
View File
@@ -19,7 +19,7 @@ protected:
std::string xml_filename;
public:
xml_serializer(ifcopenshell::file* file, const std::string& xml_filename, ifcopenshell::logger& logger = ifcopenshell::logger::root())
xml_serializer(ifcopenshell::file* file, const std::string& xml_filename, ifcopenshell::logger& = ifcopenshell::logger::root())
: xml_filename(xml_filename)
{
if (!file) {