From ad2dd156b44275321977d15b9b0c1b7137e8926b Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:27:59 +0100 Subject: [PATCH] Fix megalinter CPP warnings (#83) * Fix megalinter CPP warnings * Increment version --- czicompress/CMakeLists.txt | 2 +- czicompress/capi/capi.cpp | 2 +- czicompress/lib/src/commandlineoptions.cpp | 4 ++++ czicompress/lib/src/consoleio.cpp | 1 + czicompress/lib/src/copyczi.cpp | 2 ++ .../lib/src/utils/utf8/platforms/posix/utf8converter.cpp | 1 + .../lib/src/utils/utf8/platforms/windows/utf8converter.cpp | 1 + czicompress/tests/libczi_utils.cpp | 1 + czicompress/tests/test_commandlineparsing.cpp | 1 + czicompress/tests/test_utf8_utils.cpp | 1 + 10 files changed, 14 insertions(+), 2 deletions(-) diff --git a/czicompress/CMakeLists.txt b/czicompress/CMakeLists.txt index 789f79e..f736e7a 100644 --- a/czicompress/CMakeLists.txt +++ b/czicompress/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_policy(SET CMP0091 NEW) # enable new "MSVC runtime library selection" (htt # Note that the CMake-variables _VERSION_MAJOR, _VERSION_MINOR, ... are defined by this statement, # which are used in the build (so that - if changing the name here, change also the usage of those variables). project ("czicompress" - VERSION 0.5.3) + VERSION 0.5.4) set(czicompress_VERSION_PATCH_FLAGS "") set(czicompress_VERSION_TWEAK_FLAGS "") diff --git a/czicompress/capi/capi.cpp b/czicompress/capi/capi.cpp index 1470bba..50fd443 100644 --- a/czicompress/capi/capi.cpp +++ b/czicompress/capi/capi.cpp @@ -105,7 +105,7 @@ class FileProcessor final total_progress = 95 + 4 + 1 * phase_progress; } - return progress_report((int32_t)total_progress); + return progress_report(static_cast(total_progress)); }); writer->Close(); diff --git a/czicompress/lib/src/commandlineoptions.cpp b/czicompress/lib/src/commandlineoptions.cpp index b72d968..81acd7e 100644 --- a/czicompress/lib/src/commandlineoptions.cpp +++ b/czicompress/lib/src/commandlineoptions.cpp @@ -7,7 +7,11 @@ #include #include +#include +#include #include +#include +#include #include "inc_libCZI.h" diff --git a/czicompress/lib/src/consoleio.cpp b/czicompress/lib/src/consoleio.cpp index c03fa00..8cc288e 100644 --- a/czicompress/lib/src/consoleio.cpp +++ b/czicompress/lib/src/consoleio.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #if CZICOMPRESS_WIN32_ENVIRONMENT #include diff --git a/czicompress/lib/src/copyczi.cpp b/czicompress/lib/src/copyczi.cpp index 123b9c3..1bf2e93 100644 --- a/czicompress/lib/src/copyczi.cpp +++ b/czicompress/lib/src/copyczi.cpp @@ -5,6 +5,8 @@ #include "copyczi.h" #include +#include +#include #include namespace diff --git a/czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp b/czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp index d4c1a5a..1b24590 100644 --- a/czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp +++ b/czicompress/lib/src/utils/utf8/platforms/posix/utf8converter.cpp @@ -6,6 +6,7 @@ #include #include +#include namespace utils::utf8 { diff --git a/czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp b/czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp index 9d92540..9206c14 100644 --- a/czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp +++ b/czicompress/lib/src/utils/utf8/platforms/windows/utf8converter.cpp @@ -7,6 +7,7 @@ #include #include +#include namespace utils::utf8 { diff --git a/czicompress/tests/libczi_utils.cpp b/czicompress/tests/libczi_utils.cpp index 9a33a12..021009a 100644 --- a/czicompress/tests/libczi_utils.cpp +++ b/czicompress/tests/libczi_utils.cpp @@ -7,6 +7,7 @@ #include #include +#include CMemOutputStream::CMemOutputStream(size_t initial_size) : ptr_(nullptr), allocated_size_(initial_size), used_size_(0) { diff --git a/czicompress/tests/test_commandlineparsing.cpp b/czicompress/tests/test_commandlineparsing.cpp index 8bccf60..cede255 100644 --- a/czicompress/tests/test_commandlineparsing.cpp +++ b/czicompress/tests/test_commandlineparsing.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/czicompress/tests/test_utf8_utils.cpp b/czicompress/tests/test_utf8_utils.cpp index d3ff142..27cd314 100644 --- a/czicompress/tests/test_utf8_utils.cpp +++ b/czicompress/tests/test_utf8_utils.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "catch2/catch_all.hpp" #include "libczi_utils.h"