From 66e80234e69a59193e91b0f9e2ea90fca36e1c67 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 5 Feb 2026 20:21:33 +0100 Subject: fix(gpu): Resolve typeid warning by using .get() on shared_ptr Fixed warning: "expression with side effects will be evaluated despite being used as an operand to 'typeid'" Changed from: typeid(*item.effect).name() To: Effect* effect_ptr = item.effect.get(); typeid(*effect_ptr).name() This avoids potential side effects from dereferencing the shared_ptr directly in typeid expression. All 20 tests pass (100%). --- src/gpu/effect.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc index 8ae5835..b95c4ce 100644 --- a/src/gpu/effect.cc +++ b/src/gpu/effect.cc @@ -61,7 +61,8 @@ void Sequence::update_active_list(float seq_time) { if (should_be_active && !item.active) { #if !defined(STRIP_ALL) - const char* effect_name = typeid(*item.effect).name(); + Effect* effect_ptr = item.effect.get(); + const char* effect_name = typeid(*effect_ptr).name(); printf(" [EFFECT START] %s (priority=%d, time=%.2f-%.2f)\n", effect_name, item.priority, item.start_time, item.end_time); #endif @@ -69,7 +70,8 @@ void Sequence::update_active_list(float seq_time) { item.active = true; } else if (!should_be_active && item.active) { #if !defined(STRIP_ALL) - const char* effect_name = typeid(*item.effect).name(); + Effect* effect_ptr = item.effect.get(); + const char* effect_name = typeid(*effect_ptr).name(); printf(" [EFFECT END] %s (priority=%d)\n", effect_name, item.priority); #endif item.effect->end(); -- cgit v1.2.3