From ccb6a38028cdda56cb8068ee80c680264e0bdf3d Mon Sep 17 00:00:00 2001 From: Pierre Anquez Date: Fri, 27 Mar 2026 17:20:41 +0100 Subject: [PATCH 1/2] fix(Basic): use static_cast of Singleton instance --- include/geode/basic/singleton.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/geode/basic/singleton.hpp b/include/geode/basic/singleton.hpp index cdef58d9b..87a5fee08 100644 --- a/include/geode/basic/singleton.hpp +++ b/include/geode/basic/singleton.hpp @@ -61,14 +61,13 @@ namespace geode { const auto& type = typeid( SingletonType ); const std::lock_guard< std::mutex > locking{ lock() }; - auto* singleton = - dynamic_cast< SingletonType* >( instance( type ) ); + auto* singleton = instance( type ); if( singleton == nullptr ) { singleton = new SingletonType{}; set_instance( type, singleton ); } - return *singleton; + return *static_cast< SingletonType* >( singleton ); } private: From 638f54ccce8d7d148650ac84c617c5570f23b053 Mon Sep 17 00:00:00 2001 From: panquez <32702237+panquez@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:21:43 +0000 Subject: [PATCH 2/2] Apply prepare changes --- .clang-tidy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index b0398498e..566fa5b22 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,7 +19,8 @@ Checks: > -readability-use-anyofallof, -readability-redundant-access-specifiers, -readability-convert-member-functions-to-static, - -cppcoreguidelines-avoid-const-or-ref-data-members + -cppcoreguidelines-avoid-const-or-ref-data-members, + -cppcoreguidelines-pro-bounds-constant-array-index CheckOptions: - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic