From 73ddea269b927770a338d352a0d0db20aad87624 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 2 Jan 2024 20:11:59 +0100 Subject: [PATCH] Fix potential wrong-over-optimization in math utilities Signed-off-by: falkTX --- source/utils/CarlaMathUtils.hpp | 6 +++--- source/utils/CarlaUtils.hpp | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/utils/CarlaMathUtils.hpp b/source/utils/CarlaMathUtils.hpp index 7fdd55ab9..9867ea607 100644 --- a/source/utils/CarlaMathUtils.hpp +++ b/source/utils/CarlaMathUtils.hpp @@ -179,7 +179,7 @@ void carla_addFloats(float dest[], const float src[], const std::size_t count) n if (!std::isfinite(src[i])) __builtin_unreachable(); #endif - *dest++ += *src++; + dest[i] += src[i]; } } @@ -217,7 +217,7 @@ void carla_fillFloatsWithSingleValue(float data[], const float& value, const std if (!std::isfinite(data[i])) __builtin_unreachable(); #endif - *data++ = value; + data[i] = value; } } } @@ -302,7 +302,7 @@ void carla_multiply(float data[], const float& multiplier, const std::size_t cou if (!std::isfinite(data[i])) __builtin_unreachable(); #endif - *data++ *= multiplier; + data[i] *= multiplier; } } } diff --git a/source/utils/CarlaUtils.hpp b/source/utils/CarlaUtils.hpp index 9b563aa96..7346b5117 100644 --- a/source/utils/CarlaUtils.hpp +++ b/source/utils/CarlaUtils.hpp @@ -406,7 +406,7 @@ void carla_add(T dest[], const T src[], const std::size_t count) noexcept CARLA_SAFE_ASSERT_RETURN(count > 0,); for (std::size_t i=0; i 0,); for (std::size_t i=0; i 0,); for (std::size_t i=0; i