From 6407ca51cd9d3e6abb7e9c05f1199aa77f7d981d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 12 Jan 2023 16:17:39 +0100 Subject: [PATCH] Fix region-fade, time-stretch and other scaling operations (#9057) This resolves an ambiguity between abs(int) and std::abs(T) which depends on context and compiler version and optimization. In context of #9057, (gcc-6.3 -O3) math.h `abs(int)` was used. This truncated the superclock value to 31 bit in ControlList::extend_to. --- libs/temporal/temporal/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/temporal/temporal/types.h b/libs/temporal/temporal/types.h index f2d8cd48ae..5f308fd937 100644 --- a/libs/temporal/temporal/types.h +++ b/libs/temporal/temporal/types.h @@ -67,8 +67,8 @@ class _ratio_t { public: /* do not allow negative values, this is just a ratio */ - _ratio_t (T n, T d) : _numerator (abs (n)), _denominator (abs(d)) { assert (_denominator != 0); } - _ratio_t (T n) : _numerator (abs (n)), _denominator (1) {} + _ratio_t (T n, T d) : _numerator (std::abs (n)), _denominator (std::abs(d)) { assert (_denominator != 0); } + _ratio_t (T n) : _numerator (std::abs (n)), _denominator (1) {} T numerator() const { return _numerator; } T denominator() const { return _denominator; }