Skip to content

Commit 999f013

Browse files
committed
Reduce SWIG warnings.
1 parent cb19544 commit 999f013

15 files changed

+29
-14
lines changed

Bindings/Python/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ macro(OpenSimAddPythonModule)
118118
# 4114: "const const T"
119119
set(_COMPILE_FLAGS "/wd4996 /wd4114")
120120
endif()
121+
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND
122+
NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "10"))
123+
# SWIG uses the register keyword, which is deprecated in C++17.
124+
set(_COMPILE_FLAGS "${_COMPILE_FLAGS} -Wno-deprecated-register")
125+
endif()
126+
121127
set_source_files_properties("${_output_cxx_file}"
122128
PROPERTIES COMPILE_FLAGS "${_COMPILE_FLAGS}")
123129

Bindings/common.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
%include <OpenSim/Common/Array.h>
1414
%include <OpenSim/Common/ArrayPtrs.h>
1515
%include <OpenSim/Common/AbstractProperty.h>
16+
%ignore OpenSim::Property<std::string>::appendValue(std::string const *);
1617
%include <OpenSim/Common/Property.h>
1718
%include <OpenSim/Common/PropertyGroup.h>
1819
%template(ArrayPtrsPropertyGroup) OpenSim::ArrayPtrs<OpenSim::PropertyGroup>;
@@ -383,6 +384,7 @@ namespace OpenSim {
383384
%template(STOFileAdapterSpatialVec) OpenSim::STOFileAdapter_<SimTK::SpatialVec>;
384385

385386
%include <OpenSim/Common/CSVFileAdapter.h>
387+
386388
%include <OpenSim/Common/C3DFileAdapter.h>
387389

388390
%extend OpenSim::C3DFileAdapter {

Bindings/simulation.i

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ OpenSim::ModelComponentSet<OpenSim::Body>;
4747
%include <OpenSim/Simulation/Model/BodyScaleSet.h>
4848

4949
%include <OpenSim/Simulation/SimbodyEngine/SimbodyEngine.h>
50+
%warnfilter(509) OpenSim::TransformAxis;
51+
namespace OpenSim {
52+
%warnfilter(509) TransformAxis::setFunction;
53+
}
5054
%include <OpenSim/Simulation/SimbodyEngine/TransformAxis.h>
5155
%include <OpenSim/Simulation/SimbodyEngine/SpatialTransform.h>
5256
%include <OpenSim/Simulation/SimbodyEngine/Coordinate.h>
@@ -91,6 +95,9 @@ OpenSim::ModelComponentSet<OpenSim::Constraint>;
9195
%include <OpenSim/Simulation/SimbodyEngine/WeldConstraint.h>
9296
%include <OpenSim/Simulation/SimbodyEngine/PointConstraint.h>
9397
%include <OpenSim/Simulation/SimbodyEngine/ConstantDistanceConstraint.h>
98+
namespace OpenSim {
99+
%warnfilter(509) CoordinateCouplerConstraint::setFunction;
100+
}
94101
%include <OpenSim/Simulation/SimbodyEngine/CoordinateCouplerConstraint.h>
95102
%include <OpenSim/Simulation/SimbodyEngine/PointOnLineConstraint.h>
96103

@@ -338,11 +345,11 @@ EXPOSE_SET_CONSTRUCTORS_HELPER(ModelComponentSet);
338345
EXPOSE_SET_CONSTRUCTORS_HELPER(BodySet);
339346
EXPOSE_SET_CONSTRUCTORS_HELPER(JointSet);
340347
EXPOSE_SET_CONSTRUCTORS_HELPER(ConstraintSet);
341-
EXPOSE_SET_CONSTRUCTORS_HELPER(ForcesSet);
348+
EXPOSE_SET_CONSTRUCTORS_HELPER(ForceSet);
342349
EXPOSE_SET_CONSTRUCTORS_HELPER(ControllerSet);
343350
EXPOSE_SET_CONSTRUCTORS_HELPER(ContactGeometrySet);
344351
EXPOSE_SET_CONSTRUCTORS_HELPER(PathPointSet);
345352
EXPOSE_SET_CONSTRUCTORS_HELPER(ProbeSet);
346353
EXPOSE_SET_CONSTRUCTORS_HELPER(MarkerSet);
347354
EXPOSE_SET_CONSTRUCTORS_HELPER(WrapObjectSet);
348-
EXPOSE_SET_CONSTRUCTORS_HELPER(CoordinateSet);
355+
EXPOSE_SET_CONSTRUCTORS_HELPER(CoordinateSet);

OpenSim/Simulation/Model/BodySet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(BodySet, ModelComponentSet<Body>);
4040

4141
public:
4242
/** Use Super's constructors. @see ModelComponentSet */
43-
using Super::ModelComponentSet;
43+
using Super::Super;
4444

4545
// default copy, assignment operator, and destructor
4646

OpenSim/Simulation/Model/ComponentSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ComponentSet,
4343

4444
public:
4545
/** Use Super's constructors. @see ModelComponentSet */
46-
using Super::ModelComponentSet;
46+
using Super::Super;
4747

4848
// default copy, assignment operator, and destructor
4949

OpenSim/Simulation/Model/ConstraintSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ConstraintSet, ModelComponentSet<Constraint>);
4040

4141
public:
4242
/** Use Super's constructors. @see ModelComponentSet */
43-
using Super::ModelComponentSet;
43+
using Super::Super;
4444

4545
// default copy, assignment operator, and destructor
4646

OpenSim/Simulation/Model/ContactGeometrySet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ContactGeometrySet,
4141

4242
public:
4343
/** Use Super's constructors. @see ModelComponentSet */
44-
using Super::ModelComponentSet;
44+
using Super::Super;
4545

4646
// default copy, assignment operator, and destructor
4747

OpenSim/Simulation/Model/ControllerSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ControllerSet, ModelComponentSet<Controller>);
5353
// CONSTRUCTION
5454
//--------------------------------------------------------------------------
5555
/** Use Super's constructors. @see ModelComponentSet */
56-
using Super::ModelComponentSet;
56+
using Super::Super;
5757

5858
void constructStorage();
5959
void storeControls( const SimTK::State& s, int step );

OpenSim/Simulation/Model/CoordinateSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(CoordinateSet, Set<Coordinate>);
3939

4040
public:
4141
/** Use Super's constructors. @see Set */
42-
using Super::Set;
42+
using Super::Super;
4343

4444
/**
4545
* Populate this %Set as a flat list of all Model Coordinates given

OpenSim/Simulation/Model/ForceSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ForceSet, ModelComponentSet<Force>);
6767
//--------------------------------------------------------------------------
6868
public:
6969
/** Use Super's constructors. @see ModelComponentSet */
70-
using Super::ModelComponentSet;
70+
using Super::Super;
7171

7272
private:
7373
void updateActuators();

OpenSim/Simulation/Model/MarkerSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OSIMSIMULATION_API MarkerSet : public ModelComponentSet<Marker> {
3939

4040
public:
4141
/** Use Super's constructors. @see ModelComponentSet */
42-
using Super::ModelComponentSet;
42+
using Super::Super;
4343

4444
// default copy, assignment operator, and destructor
4545

OpenSim/Simulation/Model/ModelComponentSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ModelComponentSet : public Set<T, ModelComponent> {
6161
// METHODS
6262
//=============================================================================
6363
public:
64-
using Set<T, ModelComponent>::Set;
64+
using Super::Super;
6565
void extendFinalizeFromProperties() override final {
6666
Super::extendFinalizeFromProperties();
6767
// ModelComponentSets are unnamed properties of models, but as

OpenSim/Simulation/Model/PathPointSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(PathPointSet, Set<AbstractPathPoint>);
4141

4242
public:
4343
/** Use Super's constructors. @see Set */
44-
using OpenSim::Set<OpenSim::AbstractPathPoint, OpenSim::Object>::Set;
44+
using Super::Super;
4545

4646
// default copy, assignment operator, and destructor
4747

OpenSim/Simulation/Model/ProbeSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ProbeSet, ModelComponentSet<Probe>);
4242

4343
public:
4444
/** Use Super's constructors. @see ModelComponentSet */
45-
using Super::ModelComponentSet;
45+
using Super::Super;
4646

4747
// default copy, assignment operator, and destructor
4848

OpenSim/Simulation/Wrap/WrapObjectSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(WrapObjectSet, ModelComponentSet<WrapObject>);
4242

4343
public:
4444
/** Use Super's constructors. @see ModelComponentSet */
45-
using Super::ModelComponentSet;
45+
using Super::Super;
4646

4747
// default copy, assignment operator, and destructor
4848
//=============================================================================

0 commit comments

Comments
 (0)