From 02eb16cd1e69c32470b6e0534fc038b9b8f50793 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:38:49 -0400 Subject: [PATCH 1/2] Remove unneeded static_cast of return values. It just makes more noise were it should not happen. --- stl/src/xdtest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stl/src/xdtest.cpp b/stl/src/xdtest.cpp index 4886b0fade..b5ec78c2ba 100644 --- a/stl/src/xdtest.cpp +++ b/stl/src/xdtest.cpp @@ -11,9 +11,8 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double* px) { // categorize * const auto ps = reinterpret_cast<_Dval*>(px); if ((ps->_Sh[_D0] & _DMASK) == _DMAX << _DOFF) { - return static_cast( - (ps->_Sh[_D0] & _DFRAC) != 0 || ps->_Sh[_D1] != 0 || ps->_Sh[_D2] != 0 || ps->_Sh[_D3] != 0 ? _NANCODE - : _INFCODE); + return (ps->_Sh[_D0] & _DFRAC) != 0 || ps->_Sh[_D1] != 0 || ps->_Sh[_D2] != 0 || ps->_Sh[_D3] != 0 ? _NANCODE + : _INFCODE; } else if ((ps->_Sh[_D0] & ~_DSIGN) != 0 || ps->_Sh[_D1] != 0 || ps->_Sh[_D2] != 0 || ps->_Sh[_D3] != 0) { return (ps->_Sh[_D0] & _DMASK) == 0 ? _DENORM : _FINITE; } else { From b3fb6284c11313bc4f952dba2e926a3006d5e75f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 8 Sep 2022 19:12:09 -0700 Subject: [PATCH 2/2] Change more occurrences. --- stl/src/xdscale.cpp | 5 ++--- stl/src/xfdscale.cpp | 2 +- stl/src/xfdtest.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stl/src/xdscale.cpp b/stl/src/xdscale.cpp index f6a6702dee..1b6755e6b4 100644 --- a/stl/src/xdscale.cpp +++ b/stl/src/xdscale.cpp @@ -12,9 +12,8 @@ short _Dscale(double* px, long lexp) { // scale *px by 2^xexp with checking short xchar = static_cast((ps->_Sh[_D0] & _DMASK) >> _DOFF); if (xchar == _DMAX) { - return static_cast( - (ps->_Sh[_D0] & _DFRAC) != 0 || ps->_Sh[_D1] != 0 || ps->_Sh[_D2] != 0 || ps->_Sh[_D3] != 0 ? _NANCODE - : _INFCODE); + return (ps->_Sh[_D0] & _DFRAC) != 0 || ps->_Sh[_D1] != 0 || ps->_Sh[_D2] != 0 || ps->_Sh[_D3] != 0 ? _NANCODE + : _INFCODE; } else if (xchar == 0 && 0 < (xchar = _Dnorm(ps))) { return 0; } diff --git a/stl/src/xfdscale.cpp b/stl/src/xfdscale.cpp index b6492d3397..70b5001b9d 100644 --- a/stl/src/xfdscale.cpp +++ b/stl/src/xfdscale.cpp @@ -12,7 +12,7 @@ short _FDscale(float* px, long lexp) { // scale *px by 2^xexp with checking short xchar = static_cast((ps->_Sh[_F0] & _FMASK) >> _FOFF); if (xchar == _FMAX) { - return static_cast((ps->_Sh[_F0] & _FFRAC) != 0 || ps->_Sh[_F1] != 0 ? _NANCODE : _INFCODE); + return (ps->_Sh[_F0] & _FFRAC) != 0 || ps->_Sh[_F1] != 0 ? _NANCODE : _INFCODE; } else if (xchar == 0 && 0 < (xchar = _FDnorm(ps))) { return 0; } diff --git a/stl/src/xfdtest.cpp b/stl/src/xfdtest.cpp index 63909f7bd4..2970d0ba02 100644 --- a/stl/src/xfdtest.cpp +++ b/stl/src/xfdtest.cpp @@ -11,7 +11,7 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float* px) { // categorize * const auto ps = reinterpret_cast<_Fval*>(px); if ((ps->_Sh[_F0] & _FMASK) == _FMAX << _FOFF) { - return static_cast((ps->_Sh[_F0] & _FFRAC) != 0 || ps->_Sh[_F1] != 0 ? _NANCODE : _INFCODE); + return (ps->_Sh[_F0] & _FFRAC) != 0 || ps->_Sh[_F1] != 0 ? _NANCODE : _INFCODE; } else if ((ps->_Sh[_F0] & ~_FSIGN) != 0 || ps->_Sh[_F1] != 0) { return (ps->_Sh[_F0] & _FMASK) == 0 ? _DENORM : _FINITE; } else {