From 1756b2eee0d5883f50ec595b18e7571bffb33178 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Wed, 20 Feb 2019 15:27:48 +0530 Subject: fix MSVC compiler warning on bit-shift of int32 literal... and assigning to a 64 bit integer variable. This would have caused a big problem here if we increase MAXROWCOUNT above 2^32. Also remove un-necessary casts introduced in the commit b4df9b0b4c7411f257b0a397687587114a53208e Thanks to @sberg who pointed out the real meaning of the MSVC compiler warning reported @ https://lists.freedesktop.org/archives/libreoffice/2019-February/082078.html Change-Id: Ieedad5ba478e5162abbdfdc79820cf001c2a85f2 Reviewed-on: https://gerrit.libreoffice.org/68068 Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- sc/source/core/tool/interpr3.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 9366ac16a90b..5d9b1327c998 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -4737,7 +4737,7 @@ static void lcl_roundUpNearestPow2(SCSIZE& nNum, SCSIZE& nNumBits) } if (nPow2 != nNum) - nNum = nPow2 ? static_cast(nPow2 << 1) : 1; + nNum = nPow2 ? (nPow2 << 1) : 1; else --nNumBits; } @@ -4798,7 +4798,7 @@ private: SCSIZE getTFactorIndex(SCSIZE nPtIndex, SCSIZE nTfIdxScaleBits) { - return ( static_cast( nPtIndex << nTfIdxScaleBits ) & ( mnPoints - 1 ) ); // (x & (N-1)) is same as (x % N) but faster. + return ( ( nPtIndex << nTfIdxScaleBits ) & ( mnPoints - 1 ) ); // (x & (N-1)) is same as (x % N) but faster. } void computeFly(SCSIZE nTopIdx, SCSIZE nBottomIdx, SCSIZE nWIdx1, SCSIZE nWIdx2, SCSIZE nStage) @@ -4907,7 +4907,7 @@ void ScFFT2::computeTFactors() } else { - const SCSIZE nQSize = static_cast(mnPoints >> 2); + const SCSIZE nQSize = mnPoints >> 2; // Compute cos of the start quadrant. // This is the first quadrant if mbInverse == true, else it is the fourth quadrant. for (SCSIZE nIdx = 0; nIdx <= nQSize; ++nIdx) @@ -4921,7 +4921,7 @@ void ScFFT2::computeTFactors() mfWImag[nIdx] = mfWReal[nQ1End-nIdx]; // Second quadrant - const SCSIZE nQ2End = static_cast(nQ1End << 1); + const SCSIZE nQ2End = nQ1End << 1; for (SCSIZE nIdx = nQ1End+1; nIdx <= nQ2End; ++nIdx) { mfWReal[nIdx] = -mfWReal[nQ2End - nIdx]; @@ -4946,7 +4946,7 @@ void ScFFT2::computeTFactors() else { const SCSIZE nQ4End = nQSize; - const SCSIZE nQ3End = static_cast(nQSize << 1); + const SCSIZE nQ3End = nQSize << 1; const SCSIZE nQ2End = nQ3End + nQSize; // Fourth quadrant. @@ -5015,7 +5015,7 @@ void ScFFT2::Compute() for (SCSIZE nStage = 0; nStage < mnStages; ++nStage) { const SCSIZE nTFIdxScaleBits = mnStages - nStage - 1; // Twiddle factor index's scale factor in bits. - const SCSIZE nFliesInGroup = static_cast(1<