From c7c632d2b296881c3260d33a8a6aba1dcf4921da Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 16 Oct 2024 09:25:19 +0100 Subject: [PATCH] cppcheck fixes --- cmake/cppcheck-suppression-list.txt | 5 +++++ src/vsg/text/StandardLayout.cpp | 6 +++--- src/vsg/vk/Device.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/cppcheck-suppression-list.txt b/cmake/cppcheck-suppression-list.txt index f3b2a8cb0..b694b8bab 100644 --- a/cmake/cppcheck-suppression-list.txt +++ b/cmake/cppcheck-suppression-list.txt @@ -225,6 +225,11 @@ constParameterReference:*/src/vsg/app/RecordAndSubmitTask.cpp // suppress inappropriate warning constVariableReference:*/src/vsg/app/RecordTraversal.cpp +constVariableReference:*/src/vsg/utils/ShaderSet.cpp // suppress inappropriate warning constVariablePointer:*/src/vsg/app/SecondaryCommandGraph.cpp + +// suppress inappropriate warning +passedByValue:*/src/vsg/vk/Device.cpp +passedByValue:*/src/vsg/vk/Instance.cpp diff --git a/src/vsg/text/StandardLayout.cpp b/src/vsg/text/StandardLayout.cpp index d83c2b462..1929c6cba 100644 --- a/src/vsg/text/StandardLayout.cpp +++ b/src/vsg/text/StandardLayout.cpp @@ -288,7 +288,7 @@ void StandardLayout::layout(const Data* text, const Font& font, TextQuads& quads void apply(const ubyteArray& text) override { reserve(text.size()); - for (auto& c : text) + for (const auto& c : text) { character(c); } @@ -296,7 +296,7 @@ void StandardLayout::layout(const Data* text, const Font& font, TextQuads& quads void apply(const ushortArray& text) override { reserve(text.size()); - for (auto& c : text) + for (const auto& c : text) { character(c); } @@ -304,7 +304,7 @@ void StandardLayout::layout(const Data* text, const Font& font, TextQuads& quads void apply(const uintArray& text) override { reserve(text.size()); - for (auto& c : text) + for (const auto& c : text) { character(c); } diff --git a/src/vsg/vk/Device.cpp b/src/vsg/vk/Device.cpp index b07bcf536..b1eda06d8 100644 --- a/src/vsg/vk/Device.cpp +++ b/src/vsg/vk/Device.cpp @@ -76,7 +76,7 @@ Device::Device(PhysicalDevice* physicalDevice, const QueueSettings& queueSetting // check to see if the queueFamilyIndex has already been referenced or is unique bool unique = true; - for (auto& existingInfo : queueCreateInfos) + for (const auto& existingInfo : queueCreateInfos) { if (existingInfo.queueFamilyIndex == static_cast(queueSetting.queueFamilyIndex)) unique = false; }