Skip to content

Commit 5dcb224

Browse files
committed
cppcheck fixes
1 parent 9438840 commit 5dcb224

12 files changed

Lines changed: 20 additions & 15 deletions

cmake/cppcheck-suppression-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ arrayIndexOutOfBounds:*/include/vsg/vk/State.h
152152
// suppress warnings about intentional code usage or where cppcheck just hasn't got a clue about how templates are used...
153153
knownConditionTrueFalse:*/src/vsg/utils/Builder.cpp
154154
knownConditionTrueFalse:*/include/vsg/utils/CommandLine.h
155+
knownConditionTrueFalse:*/include/vsg/utils/Inherit.h
155156

156157
// suppress warning about initializtion.
157158
useInitializationList:*/include/vsg/core/ScratchMemory.h

include/vsg/core/IntrusiveAllocator.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ namespace vsg
104104
next(static_cast<Offset>(in_next)),
105105
status(in_status) {}
106106

107-
Element() = default;
108-
Element(const Element&) = default;
109-
Element& operator=(const Element&) = default;
107+
Element() : index(0) {}
108+
Element(const Element& rhs) : index(rhs.index) {}
109+
Element& operator=(const Element& rhs)
110+
{
111+
index = rhs.index;
112+
return *this;
113+
}
110114
};
111115

112116
struct FreeList

include/vsg/lighting/AmbientLight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace vsg
3333
void write(Output& output) const override;
3434

3535
protected:
36-
virtual ~AmbientLight() {}
36+
~AmbientLight() override {}
3737
};
3838
VSG_type_name(vsg::AmbientLight);
3939

include/vsg/lighting/DirectionalLight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace vsg
3737
void write(Output& output) const override;
3838

3939
protected:
40-
virtual ~DirectionalLight() {}
40+
~DirectionalLight() override {}
4141
};
4242
VSG_type_name(vsg::DirectionalLight);
4343

include/vsg/lighting/Light.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace vsg
4141
void write(Output& output) const override;
4242

4343
protected:
44-
virtual ~Light() {}
44+
~Light() override {}
4545
};
4646
VSG_type_name(vsg::Light);
4747

include/vsg/lighting/PointLight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace vsg
3737
void write(Output& output) const override;
3838

3939
protected:
40-
virtual ~PointLight() {}
40+
~PointLight() override {}
4141
};
4242
VSG_type_name(vsg::PointLight);
4343

include/vsg/lighting/ShadowSettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace vsg
3333
void write(Output& output) const override;
3434

3535
protected:
36-
virtual ~ShadowSettings() {}
36+
~ShadowSettings() override {}
3737
};
3838
VSG_type_name(vsg::ShadowSettings);
3939

include/vsg/lighting/SpotLight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace vsg
4040
void write(Output& output) const override;
4141

4242
protected:
43-
virtual ~SpotLight() {}
43+
~SpotLight() override {}
4444
};
4545
VSG_type_name(vsg::SpotLight);
4646

include/vsg/raytracing/AccelerationStructure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace vsg
3737
VkDeviceSize requiredScratchSize() const { return _requiredBuildScratchSize; }
3838

3939
protected:
40-
virtual ~AccelerationStructure();
40+
~AccelerationStructure() override;
4141

4242
VkAccelerationStructureKHR _accelerationStructure;
4343
VkAccelerationStructureCreateInfoKHR _accelerationStructureInfo;

include/vsg/raytracing/RayTracingPipeline.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ namespace vsg
5656
VkPipeline vk(uint32_t deviceID) const { return _implementation[deviceID]->_pipeline; }
5757

5858
protected:
59-
virtual ~RayTracingPipeline();
59+
~RayTracingPipeline() override;
6060

6161
struct Implementation : public Inherit<Object, Implementation>
6262
{
6363
Implementation(Context& context, RayTracingPipeline* rayTracingPipeline);
64-
virtual ~Implementation();
64+
~Implementation() override;
6565

6666
VkPipeline _pipeline;
6767

@@ -103,7 +103,7 @@ namespace vsg
103103
virtual void release();
104104

105105
public:
106-
virtual ~BindRayTracingPipeline();
106+
~BindRayTracingPipeline() override;
107107

108108
ref_ptr<RayTracingPipeline> _pipeline;
109109
};

0 commit comments

Comments
 (0)