Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stl/src/xdscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<short>(-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<unsigned short>(ps->_Sh[_D3] >> xexp | ps->_Sh[_D2] << (16 - xexp));
ps->_Sh[_D2] = static_cast<unsigned short>(ps->_Sh[_D2] >> xexp | ps->_Sh[_D1] << (16 - xexp));
Expand Down
3 changes: 2 additions & 1 deletion stl/src/xfdscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<short>(-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<unsigned short>(ps->_Sh[_F1] >> xexp | ps->_Sh[_F0] << (16 - xexp));
ps->_Sh[_F0] >>= xexp;
Expand Down