diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-09-22 11:01:03 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-09-22 11:08:26 +0200 |
commit | a451a69908028a9cecbaddf1f18c428d1d43a71c (patch) | |
tree | 0089223e7d965b19625caaff68ba5300f75c7bcd | |
parent | a727e93d10e7514bf9d962059fb91e36e362e0cc (diff) |
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
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index d273463beeb3..bc51148c5ce7 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 ); |