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

Michael Stahl mstahl at redhat.com
Sun Sep 22 02:12:45 PDT 2013


 sc/source/core/opencl/openclwrapper.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a451a69908028a9cecbaddf1f18c428d1d43a71c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Sep 22 11:01:03 2013 +0200

    warning C4305: 'return' : truncation from 'int' to 'bool'
    
    ... also only deleting an object if it _is_ null is surely an error?
    And if the condition were inverted it would be unnecessary too
    since operator delete[] handles null fine.
    
    Change-Id: Ib644447437864f9c6f34d13c75598f0e06d86f65

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index d273463..bc51148 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -2112,7 +2112,7 @@ bool OclCalc::oclGroundWaterGroup( uint *eOp, uint eOpNum, const double *pOpArra
     {
         float *afBuffer = new float[nElements];
         if ( !afBuffer )
-            return -1;
+            return false;
         clStatus = clEnqueueReadBuffer(kEnv.mpkCmdQueue,
                                        outputCl,
                                        CL_TRUE,0,
@@ -2124,8 +2124,7 @@ bool OclCalc::oclGroundWaterGroup( uint *eOp, uint eOpNum, const double *pOpArra
         {
             dpResult[i] = (double)afBuffer[i];
         }
-        if ( !afBuffer )
-            delete [] afBuffer;
+        delete [] afBuffer;
     }
 
     clStatus = clFinish( kEnv.mpkCmdQueue );


More information about the Libreoffice-commits mailing list