From 93d6b30c02fc4df7d512e4f16b8d68da7c96c4d5 Mon Sep 17 00:00:00 2001 From: pifopi Date: Thu, 19 Jun 2025 00:36:15 +0200 Subject: [PATCH] Rework warning supression --- 3rdParty/dpp/DPP_SilenceWarnings.h | 26 ------------------- 3rdParty/opencv-4.11.0/opencv2/core/types.hpp | 6 ++--- SerialPrograms/CMakeLists.txt | 2 +- .../Source/CommonFramework/Main.cpp | 1 - .../Notifications/ProgramNotifications.cpp | 1 - .../CommonFramework/Panels/PanelInstance.h | 2 +- .../DiscordIntegrationSettings.cpp | 3 +-- .../Integrations/DppIntegration/DppClient.cpp | 1 - .../DppIntegration/DppCommandHandler.cpp | 1 - .../DppIntegration/DppUtility.cpp | 1 - .../Source/ML/Programs/ML_LabelImages.cpp | 4 +-- vcpkg | 1 + 12 files changed, 8 insertions(+), 41 deletions(-) delete mode 100644 3rdParty/dpp/DPP_SilenceWarnings.h create mode 160000 vcpkg diff --git a/3rdParty/dpp/DPP_SilenceWarnings.h b/3rdParty/dpp/DPP_SilenceWarnings.h deleted file mode 100644 index 04f06770db..0000000000 --- a/3rdParty/dpp/DPP_SilenceWarnings.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Silence Warnings for DPP Headers - * - * From: https://github.com/PokemonAutomation/ - * - * Include this before every DPP header to silence warnings in those headers. - * - */ - -#ifndef PokemonAutomation_3rdParty_DPP_SilenceWarnings_H -#define PokemonAutomation_3rdParty_DPP_SilenceWarnings_H - - -#if 0 -#elif _MSC_VER - -#pragma warning(disable:4100) // Unreferenced Formal Parameter -#pragma warning(disable:4251) // dll-interface - -#elif __GNUC__ - -#pragma GCC diagnostic ignored "-Wunused-parameter" - -#endif - - -#endif diff --git a/3rdParty/opencv-4.11.0/opencv2/core/types.hpp b/3rdParty/opencv-4.11.0/opencv2/core/types.hpp index 64de0b2809..df4fd21885 100644 --- a/3rdParty/opencv-4.11.0/opencv2/core/types.hpp +++ b/3rdParty/opencv-4.11.0/opencv2/core/types.hpp @@ -1851,10 +1851,8 @@ template inline _Tp Rect_<_Tp>::area() const { const _Tp result = width * height; - if constexpr (std::numeric_limits<_Tp>::is_integer) - { - CV_DbgAssert(width == 0 || result / width == height); // make sure the result fits in the return value - } + CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer + || width == 0 || result / width == height); // make sure the result fits in the return value return result; } diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index 741fd545e1..a656c08582 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -2449,7 +2449,7 @@ if (MSVC) PA_DPP ) - target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /utf-8) + target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /external:anglebrackets /external:W0 /utf-8) target_compile_options(SerialPrograms PRIVATE /wd5054) # Deprecated enum arithemtic target_compile_options(SerialPrograms PRIVATE /wd4505) # unreferenced local function has been removed diff --git a/SerialPrograms/Source/CommonFramework/Main.cpp b/SerialPrograms/Source/CommonFramework/Main.cpp index 1989dd1af7..6765e5177b 100644 --- a/SerialPrograms/Source/CommonFramework/Main.cpp +++ b/SerialPrograms/Source/CommonFramework/Main.cpp @@ -4,7 +4,6 @@ #include //#include #include -#include #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/ImageResolution.h" diff --git a/SerialPrograms/Source/CommonFramework/Notifications/ProgramNotifications.cpp b/SerialPrograms/Source/CommonFramework/Notifications/ProgramNotifications.cpp index 7935ab6c05..76aecde236 100644 --- a/SerialPrograms/Source/CommonFramework/Notifications/ProgramNotifications.cpp +++ b/SerialPrograms/Source/CommonFramework/Notifications/ProgramNotifications.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include "Common/Cpp/PrettyPrint.h" #include "Common/Cpp/Json/JsonValue.h" diff --git a/SerialPrograms/Source/CommonFramework/Panels/PanelInstance.h b/SerialPrograms/Source/CommonFramework/Panels/PanelInstance.h index 5d18591b23..830d0d9d57 100644 --- a/SerialPrograms/Source/CommonFramework/Panels/PanelInstance.h +++ b/SerialPrograms/Source/CommonFramework/Panels/PanelInstance.h @@ -38,7 +38,7 @@ class PanelInstance{ public: // Serialization void from_json(); - virtual void from_json(const JsonValue& json){} + virtual void from_json([[maybe_unused]] const JsonValue& json){} virtual JsonValue to_json() const; protected: diff --git a/SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp b/SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp index 6f058a4c8a..4ed3c7223c 100644 --- a/SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp +++ b/SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include "Common/Qt/StringToolsQt.h" //#include "CommonFramework/Globals.h" //#include "CommonFramework/GlobalSettingsPanel.h" @@ -122,7 +121,7 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption() this->add_listener(*this); library0.add_listener(*this); } -void DiscordIntegrationSettingsOption::on_config_value_changed(void* object){ +void DiscordIntegrationSettingsOption::on_config_value_changed([[maybe_unused]] void* object){ // cout << this->enabled() << endl; #if (defined PA_SLEEPY || defined PA_DPP) bool options_enabled = this->enabled(); diff --git a/SerialPrograms/Source/Integrations/DppIntegration/DppClient.cpp b/SerialPrograms/Source/Integrations/DppIntegration/DppClient.cpp index feb3313cb5..8b3e0329c0 100644 --- a/SerialPrograms/Source/Integrations/DppIntegration/DppClient.cpp +++ b/SerialPrograms/Source/Integrations/DppIntegration/DppClient.cpp @@ -1,7 +1,6 @@ #ifdef PA_DPP #include -#include #include #include #include diff --git a/SerialPrograms/Source/Integrations/DppIntegration/DppCommandHandler.cpp b/SerialPrograms/Source/Integrations/DppIntegration/DppCommandHandler.cpp index d992bad3ed..5169e477a8 100644 --- a/SerialPrograms/Source/Integrations/DppIntegration/DppCommandHandler.cpp +++ b/SerialPrograms/Source/Integrations/DppIntegration/DppCommandHandler.cpp @@ -1,7 +1,6 @@ #ifdef PA_DPP #include -#include #include #include "Common/Cpp/Concurrency/ScheduledTaskRunner.h" #include "CommonFramework/Globals.h" diff --git a/SerialPrograms/Source/Integrations/DppIntegration/DppUtility.cpp b/SerialPrograms/Source/Integrations/DppIntegration/DppUtility.cpp index 7d36fe2d63..17ca8153da 100644 --- a/SerialPrograms/Source/Integrations/DppIntegration/DppUtility.cpp +++ b/SerialPrograms/Source/Integrations/DppIntegration/DppUtility.cpp @@ -1,6 +1,5 @@ #ifdef PA_DPP -#include #include #include #include "CommonFramework/GlobalSettingsPanel.h" diff --git a/SerialPrograms/Source/ML/Programs/ML_LabelImages.cpp b/SerialPrograms/Source/ML/Programs/ML_LabelImages.cpp index c61e350b38..73c51480d5 100644 --- a/SerialPrograms/Source/ML/Programs/ML_LabelImages.cpp +++ b/SerialPrograms/Source/ML/Programs/ML_LabelImages.cpp @@ -251,7 +251,7 @@ void LabelImages::load_image_related_data(const std::string& image_path, size_t return; // no embedding, then no way for us to annotate } // see if we can load the previously created labels - const std::string anno_filename = std::filesystem::path(image_path).filename().replace_extension(".json"); + const std::string anno_filename = std::filesystem::path(image_path).filename().replace_extension(".json").string(); // ensure the folder exists std::filesystem::create_directory(ML_ANNOTATION_PATH()); @@ -284,7 +284,7 @@ void LabelImages::load_image_related_data(const std::string& image_path, size_t try{ ObjectAnnotation anno_obj = json_to_object_annotation((*json_array)[i]); m_annotated_objects.emplace_back(std::move(anno_obj)); - } catch(JsonParseException & e){ + } catch([[maybe_unused]] JsonParseException & e){ m_fail_to_load_annotation_file = true; QMessageBox box; box.warning(nullptr, "Unable to Load Annotation", diff --git a/vcpkg b/vcpkg new file mode 160000 index 0000000000..6b973816fb --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit 6b973816fb727bd4b2d8c7865c499feeeba35e75