diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2019-02-20 10:24:10 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2019-02-20 07:18:25 +0100 |
commit | b95fa8525d42574ecce2c04f92b602c022adbd92 (patch) | |
tree | b7400caf780363f279ea1f9034a3618fe43ad89f /sc/source | |
parent | 6a143985bdc5d12d1f9e8cf8592440282986c099 (diff) |
try fix MSVC compiler warning on bit shift operations
Change-Id: Idde4236cc63f301e3df92db4025cf2e7175bd580
Reviewed-on: https://gerrit.libreoffice.org/68040
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/interpr3.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index fd13b7085307..9366ac16a90b 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 ? (nPow2 << 1) : 1; + nNum = nPow2 ? static_cast<SCSIZE>(nPow2 << 1) : 1; else --nNumBits; } @@ -4798,7 +4798,7 @@ private: SCSIZE getTFactorIndex(SCSIZE nPtIndex, SCSIZE nTfIdxScaleBits) { - return ( ( nPtIndex << nTfIdxScaleBits ) & ( mnPoints - 1 ) ); // (x & (N-1)) is same as (x % N) but faster. + return ( static_cast<SCSIZE>( 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 = mnPoints >> 2; + const SCSIZE nQSize = static_cast<SCSIZE>(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 = nQ1End << 1; + const SCSIZE nQ2End = static_cast<SCSIZE>(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 = nQSize << 1; + const SCSIZE nQ3End = static_cast<SCSIZE>(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 = 1<<nStage; + const SCSIZE nFliesInGroup = static_cast<SCSIZE>(1<<nStage); const SCSIZE nGroups = nFliesInStage/nFliesInGroup; const SCSIZE nFlyWidth = nFliesInGroup; for (SCSIZE nGroup = 0, nFlyTopIdx = 0; nGroup < nGroups; ++nGroup) |