From 5f4c4e35fd9812974f0bae08456ddc6358e75d89 Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 31 Oct 2026 22:33:53 -0700 Subject: [PATCH 1/2] BDSP AutoStory: fix the Ubuntu gcc and Windows clang build errors Include for std::lround in the AutoStory tests, count the red pixels with an if instead of adding a bool (gcc -Wint-in-bool-context), and take the MoveOnlyFunction test file from common/move-only-function, which drops the noexcept move-assignment static assertion that fails on Windows clang. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- Common/Cpp/MoveOnlyFunction_Tests.cpp | 1 - .../Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp | 4 +++- .../Programs/AutoStory/PokemonBDSP_AutoStory_Tests.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/Cpp/MoveOnlyFunction_Tests.cpp b/Common/Cpp/MoveOnlyFunction_Tests.cpp index c133e8b8ec..72ed5998ae 100644 --- a/Common/Cpp/MoveOnlyFunction_Tests.cpp +++ b/Common/Cpp/MoveOnlyFunction_Tests.cpp @@ -21,7 +21,6 @@ namespace{ static_assert(!std::is_copy_constructible_v>); static_assert(!std::is_copy_assignable_v>); static_assert(std::is_nothrow_move_constructible_v>); -static_assert(std::is_nothrow_move_assignable_v>); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp index da3f7704b3..14bde37653 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp @@ -1483,7 +1483,9 @@ size_t bag_clear_tab_count(const ImageViewRGB32& frame){ for (size_t bx = 0; bx < badge.width(); bx++){ const uint32_t pixel = badge.pixel(bx, y); int rr = (pixel >> 16) & 255, gg = (pixel >> 8) & 255, bb = pixel & 255; - red += rr > 150 && rr > gg + 60 && rr > bb + 60; + if (rr > 150 && rr > gg + 60 && rr > bb + 60){ + red++; + } } } if (badge.width() * badge.height() && (double)red / (badge.width() * badge.height()) > .45){ diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Tests.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Tests.cpp index c261f8ff19..5f3efbe0da 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStory_Tests.cpp @@ -4,6 +4,7 @@ * */ +#include #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/Filesystem/Filesystem.h" From 4e2ffa8ea49aa939a9356a2378092f4af6d9627a Mon Sep 17 00:00:00 2001 From: dayfine Date: Sat, 31 Oct 2026 22:45:55 -0700 Subject: [PATCH 2/2] BDSP AutoStory: compare the badge area to zero, for gcc -Wint-in-bool-context The Ubuntu gcc error was on the area check two lines further down, not on the counter: a product used as a condition. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- .../Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp index 14bde37653..f2a1bfe6cf 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/PokemonBDSP_AutoStoryTools.cpp @@ -1488,7 +1488,8 @@ size_t bag_clear_tab_count(const ImageViewRGB32& frame){ } } } - if (badge.width() * badge.height() && (double)red / (badge.width() * badge.height()) > .45){ + const size_t badge_area = badge.width() * badge.height(); + if (badge_area > 0 && (double)red / badge_area > .45){ continue; } const ImageFloatBox box{x, .06, .038, .072};