From 2251a7a74b8f07378764704b180de0f243faf70c Mon Sep 17 00:00:00 2001 From: Bert Melis Date: Tue, 14 May 2024 16:41:56 +0200 Subject: [PATCH] Silence cppcheck a bit --- .github/workflows/cppcheck.yml | 2 +- src/MemoryPool/src/Fixed.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index b80aa1c..cd02b46 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -19,4 +19,4 @@ jobs: pip install platformio - name: Cppcheck run: | - pio check --fail-on-defect=medium --fail-on-defect=high --flags "--enable=warning --enable=style --enable=performance --suppress=unusedFunction --suppress=preprocessorErrorDirective" --skip-packages \ No newline at end of file + pio check --fail-on-defect=medium --fail-on-defect=high --flags "--inline-suppr --enable=warning --enable=style --enable=performance --suppress=unusedFunction --suppress=preprocessorErrorDirective" --skip-packages \ No newline at end of file diff --git a/src/MemoryPool/src/Fixed.h b/src/MemoryPool/src/Fixed.h index 66427ed..e826b92 100644 --- a/src/MemoryPool/src/Fixed.h +++ b/src/MemoryPool/src/Fixed.h @@ -21,7 +21,7 @@ namespace MemoryPool { template class Fixed { public: - Fixed() + Fixed() // cppcheck-suppress uninitMemberVar : _buffer{0} , _head(_buffer) { unsigned char* b = _head; @@ -88,7 +88,7 @@ class Fixed { std::cout << "+--------------------" << std::endl; } - bool _isFree(unsigned char* ptr) { + bool _isFree(const unsigned char* ptr) { unsigned char* b = _head; while (b) { if (b == ptr) return true; @@ -104,4 +104,4 @@ class Fixed { std::mutex _mutex; }; -} // end namespace MemoryPool +} // end namespace MemoryPool \ No newline at end of file