Skip to content

Commit 89a6e73

Browse files
committed
Fix a bunch of msvc warnings regarding empty switch statements in the reflection methods
1 parent a5107b9 commit 89a6e73

File tree

4 files changed

+331
-329
lines changed

4 files changed

+331
-329
lines changed

src/ifcexpressparser/IfcExpressParser.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,24 @@ def __str__(self):
259259
s += "\n virtual unsigned int getArgumentCount() const { return %(n_arguments)d; }" % dict(class_name=self.class_name, n_arguments=len(self.l) + argument_start(self.class_name))
260260

261261
s += "\n virtual ArgumentType getArgumentType(unsigned int i) const {"
262-
s += " switch (i) {"
263-
for i, a in enumerate(self.l):
264-
s += "case %d: " % (i + argument_start(self.class_name))
265-
s += "return %s; " % a.type.type_enum()
266-
s += "}"
262+
if len(self.l):
263+
s += " switch (i) {"
264+
for i, a in enumerate(self.l):
265+
s += "case %d: " % (i + argument_start(self.class_name))
266+
s += "return %s; " % a.type.type_enum()
267+
s += "}"
267268
if self.parent_class is not None:
268269
s += " return %s::getArgumentType(i); }" % self.parent_class
269270
else:
270271
s += " throw IfcException(\"argument out of range\"); }"
271272

272273
s += "\n virtual const char* getArgumentName(unsigned int i) const {"
273-
s += " switch (i) {"
274-
for i, a in enumerate(self.l):
275-
s += "case %d: " % (i + argument_start(self.class_name))
276-
s += "return \"%s\"; " % a.name
277-
s += "}"
274+
if len(self.l):
275+
s += " switch (i) {"
276+
for i, a in enumerate(self.l):
277+
s += "case %d: " % (i + argument_start(self.class_name))
278+
s += "return \"%s\"; " % a.name
279+
s += "}"
278280
if self.parent_class is not None:
279281
s += " return %s::getArgumentName(i); }" % self.parent_class
280282
else:

src/ifcparse/Ifc2x3.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/********************************************************************************
2121
* *
22-
* This file has been generated from /tmp/IFC2X3_FINAL.exp. Do not make modifications *
22+
* This file has been generated from IFC2X3_TC1.exp. Do not make modifications *
2323
* but instead modify the python script that has been used to generate this. *
2424
* *
2525
********************************************************************************/
@@ -6283,11 +6283,11 @@ IfcElectricalElement::IfcElectricalElement(IfcAbstractEntityPtr e) { if (!is(Typ
62836283
// Function implementations for IfcElement
62846284
bool IfcElement::hasTag() { return !entity->getArgument(7)->isNull(); }
62856285
IfcIdentifier IfcElement::Tag() { return *entity->getArgument(7); }
6286+
IfcRelConnectsStructuralElement::list IfcElement::HasStructuralMember() { RETURN_INVERSE(IfcRelConnectsStructuralElement) }
62866287
IfcRelFillsElement::list IfcElement::FillsVoids() { RETURN_INVERSE(IfcRelFillsElement) }
62876288
IfcRelConnectsElements::list IfcElement::ConnectedTo() { RETURN_INVERSE(IfcRelConnectsElements) }
62886289
IfcRelCoversBldgElements::list IfcElement::HasCoverings() { RETURN_INVERSE(IfcRelCoversBldgElements) }
62896290
IfcRelProjectsElement::list IfcElement::HasProjections() { RETURN_INVERSE(IfcRelProjectsElement) }
6290-
IfcRelConnectsStructuralElement::list IfcElement::HasStructuralMember() { RETURN_INVERSE(IfcRelConnectsStructuralElement) }
62916291
IfcRelReferencedInSpatialStructure::list IfcElement::ReferencedInStructures() { RETURN_INVERSE(IfcRelReferencedInSpatialStructure) }
62926292
IfcRelConnectsPortToElement::list IfcElement::HasPorts() { RETURN_INVERSE(IfcRelConnectsPortToElement) }
62936293
IfcRelVoidsElement::list IfcElement::HasOpenings() { RETURN_INVERSE(IfcRelVoidsElement) }
@@ -9071,7 +9071,7 @@ IfcLoadGroupTypeEnum::IfcLoadGroupTypeEnum IfcStructuralLoadGroup::PredefinedTyp
90719071
IfcActionTypeEnum::IfcActionTypeEnum IfcStructuralLoadGroup::ActionType() { return IfcActionTypeEnum::FromString(*entity->getArgument(6)); }
90729072
IfcActionSourceTypeEnum::IfcActionSourceTypeEnum IfcStructuralLoadGroup::ActionSource() { return IfcActionSourceTypeEnum::FromString(*entity->getArgument(7)); }
90739073
bool IfcStructuralLoadGroup::hasCoefficient() { return !entity->getArgument(8)->isNull(); }
9074-
IfcPositiveRatioMeasure IfcStructuralLoadGroup::Coefficient() { return *entity->getArgument(8); }
9074+
IfcRatioMeasure IfcStructuralLoadGroup::Coefficient() { return *entity->getArgument(8); }
90759075
bool IfcStructuralLoadGroup::hasPurpose() { return !entity->getArgument(9)->isNull(); }
90769076
IfcLabel IfcStructuralLoadGroup::Purpose() { return *entity->getArgument(9); }
90779077
IfcStructuralResultGroup::list IfcStructuralLoadGroup::SourceOfResultGroup() { RETURN_INVERSE(IfcStructuralResultGroup) }

0 commit comments

Comments
 (0)