diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-18 12:45:37 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-09-19 17:03:26 +0200 |
commit | ee19608f940d0985f4ba4cd918bc53aaf25f0301 (patch) | |
tree | 150a5c9d63d9daacfae94f48f0b821589089cf8c /sc | |
parent | 5b0bc1bee668ab670044ecd564c84583c261c07e (diff) |
void* is dangerous
no idea how that ever worked
Change-Id: Ie14c86a241a2fa7e1963385987245cd0ee965fcf
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 1a1945164230..f469aac7655e 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -437,17 +437,19 @@ int OpenclDevice::compileKernelFile( GPUEnv *gpuInfo, const char *buildOption ) if (aGeneratedFiles.size() == numDevices) { bBinaryExisted = true; - boost::scoped_array<char*> pBinary(new char*[numDevices]); + boost::scoped_array<unsigned char*> pBinary(new unsigned char*[numDevices]); for(size_t i = 0; i < numDevices; ++i) { sal_uInt64 nSize; aGeneratedFiles[i]->getSize(nSize); - char* binary = new char[nSize]; + unsigned char* binary = new unsigned char[nSize]; sal_uInt64 nBytesRead; aGeneratedFiles[i]->read(binary, nSize, nBytesRead); if(nSize != nBytesRead) assert(false); + length = nBytesRead; + pBinary[i] = binary; } @@ -467,7 +469,7 @@ int OpenclDevice::compileKernelFile( GPUEnv *gpuInfo, const char *buildOption ) fprintf(stderr, "Create kernel from binary\n"); gpuInfo->mpArryPrograms[idx] = clCreateProgramWithBinary( gpuInfo->mpContext,numDevices, - mpArryDevsID.get(), &length, (const unsigned char**) &pBinary, + mpArryDevsID.get(), &length, (const unsigned char**) pBinary.get(), &binary_status, &clStatus ); if(clStatus != CL_SUCCESS) { |