From 5d80a4e766d07786856e8a8c96476c9c3de8d9c4 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 5 May 2024 23:28:16 +0300 Subject: opal.c: Put content of Mult32To64 into MulDivR --- src/chips/opal/opal.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/chips') diff --git a/src/chips/opal/opal.c b/src/chips/opal/opal.c index 4994e85..23cb4ff 100644 --- a/src/chips/opal/opal.c +++ b/src/chips/opal/opal.c @@ -500,14 +500,9 @@ void Opal_Pan(Opal *self, uint16_t reg_num, uint8_t pan) } -static inline int64_t s_opal_Mul32To64(int32_t a, int32_t b) -{ - return (int64_t)(a) * b; -} - static inline int32_t s_opal_MulDivR(int32_t a, int32_t b, int32_t c) { - int64_t ret = (s_opal_Mul32To64(a, b) + ( c / 2 )) / c; + int64_t ret = (((int64_t)(a) * b) + ( c / 2 )) / c; if(ret > INT_MAX) return INT_MAX; -- cgit v1.2.3