From 8cd0977a3688fa705c83867c57505a47b9269369 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Jan 2023 16:34:43 +0000 Subject: Fix up all the static analyzer warnings --- lib/enumDetails.hpp | 5 ++++- lib/filesystem.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/enumDetails.hpp b/lib/enumDetails.hpp index 7234c6d..5966be2 100644 --- a/lib/enumDetails.hpp +++ b/lib/enumDetails.hpp @@ -79,7 +79,10 @@ private: constexpr static auto get_valids(std::integer_sequence) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" return std::array {EnumValueDetails(n)>::valid...}; +#pragma GCC diagnostic pop } template constexpr static auto @@ -103,7 +106,7 @@ private: -> std::optional::value_type> { if (const auto itr = std::find(search.begin(), search.end(), key); itr != search.end()) { - return out[std::distance(search.begin(), itr)]; + return out[static_cast(std::distance(search.begin(), itr))]; } return std::nullopt; } diff --git a/lib/filesystem.cpp b/lib/filesystem.cpp index 181fb07..0e19e8d 100644 --- a/lib/filesystem.cpp +++ b/lib/filesystem.cpp @@ -36,6 +36,7 @@ namespace filesystem { } } + // NOLINTNEXTLINE(hicpp-vararg) fh::fh(const char * path, int flags, int mode) : h {open(path, flags, mode)} { if (h == -1) { -- cgit v1.2.3