From 56ef31a1d820439102da69c82ff79e098ce20721 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:31:36 -0400 Subject: [PATCH 1/2] Move assignment of xchar to declaration This follows best practices without changing behavior --- stl/src/xfdnorm.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stl/src/xfdnorm.cpp b/stl/src/xfdnorm.cpp index c9f8322cc8..46f7e287eb 100644 --- a/stl/src/xfdnorm.cpp +++ b/stl/src/xfdnorm.cpp @@ -8,10 +8,9 @@ _EXTERN_C_UNLESS_PURE short _FDnorm(_Fval* ps) { // normalize float fraction - short xchar; + short xchar = 1; unsigned short sign = static_cast(ps->_Sh[_F0] & _FSIGN); - xchar = 1; if ((ps->_Sh[_F0] &= _FFRAC) != 0 || ps->_Sh[_F1]) { // nonzero, scale if (ps->_Sh[_F0] == 0) { ps->_Sh[_F0] = ps->_Sh[_F1]; From ea759fbc1f5b2d46749239e977fd09b550b658f1 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 8 Sep 2022 18:10:27 -0700 Subject: [PATCH 2/2] Mirror change to xdnorm.cpp. --- stl/src/xdnorm.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stl/src/xdnorm.cpp b/stl/src/xdnorm.cpp index aa4bfbfcba..73c3e0e17c 100644 --- a/stl/src/xdnorm.cpp +++ b/stl/src/xdnorm.cpp @@ -8,10 +8,9 @@ _EXTERN_C_UNLESS_PURE short _Dnorm(_Dval* ps) { // normalize double fraction - short xchar; + short xchar = 1; unsigned short sign = static_cast(ps->_Sh[_D0] & _DSIGN); - xchar = 1; if ((ps->_Sh[_D0] &= _DFRAC) != 0 || ps->_Sh[_D1] || ps->_Sh[_D2] || ps->_Sh[_D3]) { // nonzero, scale for (; ps->_Sh[_D0] == 0; xchar -= 16) { // shift left by 16 ps->_Sh[_D0] = ps->_Sh[_D1];