From 704878ca5e76a5d56f411557dbab8e83f9a44581 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:01:13 -0400 Subject: [PATCH 1/2] Remove unneeded static_cast for xexp We can just check for 0 since -0 is just 0 --- stl/src/xdscale.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/src/xdscale.cpp b/stl/src/xdscale.cpp index f6a6702dee..e893a61bc1 100644 --- a/stl/src/xdscale.cpp +++ b/stl/src/xdscale.cpp @@ -47,7 +47,8 @@ short _Dscale(double* px, long lexp) { // scale *px by 2^xexp with checking ps->_Sh[_D1] = ps->_Sh[_D0]; ps->_Sh[_D0] = 0; } - if ((xexp = static_cast(-xexp)) != 0) { // scale by bits + if (xexp != 0) { // scale by bits + xexp = -xexp; psx = (ps->_Sh[_D3] << (16 - xexp)) | (psx != 0 ? 1 : 0); ps->_Sh[_D3] = static_cast(ps->_Sh[_D3] >> xexp | ps->_Sh[_D2] << (16 - xexp)); ps->_Sh[_D2] = static_cast(ps->_Sh[_D2] >> xexp | ps->_Sh[_D1] << (16 - xexp)); From bbfaf755d3ee257a08ce27679d3ea47fd8a33a4f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 8 Sep 2022 17:59:55 -0700 Subject: [PATCH 2/2] Mirror change to xfdscale.cpp. --- stl/src/xfdscale.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/src/xfdscale.cpp b/stl/src/xfdscale.cpp index b6492d3397..15cc63d1eb 100644 --- a/stl/src/xfdscale.cpp +++ b/stl/src/xfdscale.cpp @@ -42,7 +42,8 @@ short _FDscale(float* px, long lexp) { // scale *px by 2^xexp with checking ps->_Sh[_F0] = 0; xexp += 16; } - if ((xexp = static_cast(-xexp)) != 0) { // scale by bits + if (xexp != 0) { // scale by bits + xexp = -xexp; psx = (ps->_Sh[_F1] << (16 - xexp)) | (psx != 0 ? 1 : 0); ps->_Sh[_F1] = static_cast(ps->_Sh[_F1] >> xexp | ps->_Sh[_F0] << (16 - xexp)); ps->_Sh[_F0] >>= xexp;