From 75f5fe22e8913b686a19849332921341a70ae00c Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Fri, 11 Sep 2026 19:24:37 -0500 Subject: [PATCH] build: clear 12 platform-gated warnings the x64 census could not see (#15633) --- src/libslic3r/PresetBundle.cpp | 12 ++++++------ src/libslic3r/Thread.cpp | 9 +++++++-- src/slic3r/GUI/InstanceCheck.hpp | 1 - src/slic3r/GUI/SelectMachinePop.hpp | 2 ++ src/slic3r/GUI/TextureImportDialog.cpp | 2 ++ src/slic3r/Utils/Serial.cpp | 2 ++ 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index c90ebc756b..4b8fb03a02 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -4981,7 +4981,7 @@ static void apply_mixed_config_relocations(DynamicPrintConfig& case coBools: { auto* live = static_cast(opt); const auto* frozen = static_cast(snapshot.get()); - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const unsigned char cell = from < frozen->values.size() ? frozen->values[from] : 0; if (live->values.size() <= to) live->values.resize(to + 1, 0); @@ -4992,7 +4992,7 @@ static void apply_mixed_config_relocations(DynamicPrintConfig& case coStrings: { auto* live = static_cast(opt); const auto* frozen = static_cast(snapshot.get()); - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const std::string cell = from < frozen->values.size() ? frozen->values[from] : std::string(); if (live->values.size() <= to) live->values.resize(to + 1, std::string{}); @@ -5028,7 +5028,7 @@ static void apply_receiver_mix_relocations(DynamicPrintConfig& auto* live = static_cast(opt); std::unique_ptr snapshot(opt->clone()); const auto* frozen = static_cast(snapshot.get()); - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const bool cell = from < frozen->values.size() ? frozen->values[from] : false; if (live->values.size() <= to) live->values.resize(to + 1, false); @@ -5044,7 +5044,7 @@ static void apply_receiver_mix_relocations(DynamicPrintConfig& auto* live = static_cast(opt); std::unique_ptr snapshot(opt->clone()); const auto* frozen = static_cast(snapshot.get()); - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const std::string cell = from < frozen->values.size() ? frozen->values[from] : std::string(); if (live->values.size() <= to) live->values.resize(to + 1, std::string{}); @@ -5060,7 +5060,7 @@ static void apply_receiver_mix_relocations(DynamicPrintConfig& auto* live = static_cast(opt); std::unique_ptr snapshot(opt->clone()); const auto* frozen = static_cast(snapshot.get()); - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const int cell = from < frozen->values.size() ? frozen->values[from] : 0; if (live->values.size() <= to) live->values.resize(to + 1, 0); @@ -5087,7 +5087,7 @@ static void apply_receiver_mix_relocations(DynamicPrintConfig& move_ints("filament_volume_map"); { const std::vector> frozen = ams_multi_color_filment; - for (const auto [from, to] : moves) { + for (const auto& [from, to] : moves) { const std::vector cell = from < frozen.size() ? frozen[from] : std::vector(); if (ams_multi_color_filment.size() <= to) ams_multi_color_filment.resize(to + 1, std::vector{}); diff --git a/src/libslic3r/Thread.cpp b/src/libslic3r/Thread.cpp index 3030b6d194..edd7c2a3d0 100644 --- a/src/libslic3r/Thread.cpp +++ b/src/libslic3r/Thread.cpp @@ -30,6 +30,11 @@ static HMODULE s_hKernel32 = nullptr; static SetThreadDescriptionType s_fnSetThreadDescription = nullptr; static GetThreadDescriptionType s_fnGetThreadDescription = nullptr; +// Convert the FARPROC from GetProcAddress to Fn through a generic function pointer. +template static Fn load_proc(HMODULE module, const char* name) { + return reinterpret_cast(reinterpret_cast(::GetProcAddress(module, name))); +} + static bool WindowsGetSetThreadNameAPIInitialize() { if (! s_SetGetThreadDescriptionInitialized) { @@ -37,8 +42,8 @@ static bool WindowsGetSetThreadNameAPIInitialize() // to initialize s_hKernel32 = LoadLibraryW(L"Kernel32.dll"); if (s_hKernel32) { - s_fnSetThreadDescription = (SetThreadDescriptionType)::GetProcAddress(s_hKernel32, "SetThreadDescription"); - s_fnGetThreadDescription = (GetThreadDescriptionType)::GetProcAddress(s_hKernel32, "GetThreadDescription"); + s_fnSetThreadDescription = load_proc(s_hKernel32, "SetThreadDescription"); + s_fnGetThreadDescription = load_proc(s_hKernel32, "GetThreadDescription"); } s_SetGetThreadDescriptionInitialized = true; } diff --git a/src/slic3r/GUI/InstanceCheck.hpp b/src/slic3r/GUI/InstanceCheck.hpp index 5f26f1e48f..9bfb3e2500 100644 --- a/src/slic3r/GUI/InstanceCheck.hpp +++ b/src/slic3r/GUI/InstanceCheck.hpp @@ -87,7 +87,6 @@ private: std::condition_variable m_thread_stop_condition; mutable std::mutex m_thread_stop_mutex; bool m_stop{ false }; - bool m_start{ true }; // background thread method void listen(); diff --git a/src/slic3r/GUI/SelectMachinePop.hpp b/src/slic3r/GUI/SelectMachinePop.hpp index 76d38be522..e34a23708c 100644 --- a/src/slic3r/GUI/SelectMachinePop.hpp +++ b/src/slic3r/GUI/SelectMachinePop.hpp @@ -183,7 +183,9 @@ private: HyperLink* m_hyperlink{nullptr}; // ORCA wxBoxSizer * m_sizer_my_devices{nullptr}; wxBoxSizer * m_sizer_other_devices{nullptr}; +#if defined(__WINDOWS__) wxBoxSizer * m_sizer_search_bar{nullptr}; +#endif wxSearchCtrl* m_search_bar{nullptr}; wxScrolledWindow * m_scrolledWindow{nullptr}; wxTimer * m_refresh_timer{nullptr}; diff --git a/src/slic3r/GUI/TextureImportDialog.cpp b/src/slic3r/GUI/TextureImportDialog.cpp index 1bf52d792c..2e5c1145e1 100644 --- a/src/slic3r/GUI/TextureImportDialog.cpp +++ b/src/slic3r/GUI/TextureImportDialog.cpp @@ -134,7 +134,9 @@ public: } private: +#if defined(__WXMSW__) || defined(__APPLE__) int m_suspended_count = 0; +#endif }; static bool needs_filament_swatch_border(const wxColour& colour) diff --git a/src/slic3r/Utils/Serial.cpp b/src/slic3r/Utils/Serial.cpp index 4db1acc6b6..f8c03ceb26 100644 --- a/src/slic3r/Utils/Serial.cpp +++ b/src/slic3r/Utils/Serial.cpp @@ -331,7 +331,9 @@ void Serial::set_baud_rate(unsigned baud_rate) speed_t c_ispeed; speed_t c_ospeed; }; +#ifndef BOTHER #define BOTHER CBAUDEX +#endif termios2 ios; handle_errno(::ioctl(handle, TCGETS2, &ios));