[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 20 13:23:59 UTC 2019


 sc/source/core/tool/interpr3.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 1756b2eee0d5883f50ec595b18e7571bffb33178
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Wed Feb 20 15:27:48 2019 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Wed Feb 20 14:23:34 2019 +0100

    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 <sbergman at redhat.com>
    Tested-by: Jenkins

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<SCSIZE>(nPow2 << 1) : 1;
+        nNum = nPow2 ? (nPow2 << 1) : 1;
     else
         --nNumBits;
 }
@@ -4798,7 +4798,7 @@ private:
 
     SCSIZE getTFactorIndex(SCSIZE nPtIndex, SCSIZE nTfIdxScaleBits)
     {
-        return ( static_cast<SCSIZE>( 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<SCSIZE>(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<SCSIZE>(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<SCSIZE>(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<SCSIZE>(1<<nStage);
+        const SCSIZE nFliesInGroup = SCSIZE(1) << nStage;
         const SCSIZE nGroups = nFliesInStage/nFliesInGroup;
         const SCSIZE nFlyWidth = nFliesInGroup;
         for (SCSIZE nGroup = 0, nFlyTopIdx = 0; nGroup < nGroups; ++nGroup)


More information about the Libreoffice-commits mailing list