diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-07-04 13:37:35 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-07-04 15:48:34 +0300 |
commit | c5922978c87e246c1bc2ae6111415ec0764d6865 (patch) | |
tree | bcd0ed7ef8e5bee0f99065c05df4776189f91e64 | |
parent | e79ccf01ec79849aeebeed9a024a1d1cd5d7a6e9 (diff) |
sizeof(char) is 1 by definition
Change-Id: Ibd6f74a84b49e609c8771080984832eb61949a68
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 7a1103d9b9e9..fcb6c02cdac2 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -150,7 +150,7 @@ int OpenclDevice::ConvertToString(const char *filename, char **source) { file_size = ftell(file); rewind(file); - *source = (char*) malloc(sizeof(char) * file_size + 1); + *source = (char*) malloc(file_size + 1); if (*source == (char*) NULL) { return 0; } @@ -209,7 +209,7 @@ int OpenclDevice::WriteBinaryToFile(const char* fileName, const char* birary, return 0; } - fwrite(birary, sizeof(char), numBytes, output); + fwrite(birary, 1, numBytes, output); fclose(output); return 1; @@ -252,7 +252,7 @@ int OpenclDevice::GeneratBinFromKernelSource(cl_program program, for (i = 0; i < numDevices; i++) { if (binarySizes[i] != 0) { - binaries[i] = (char*) malloc(sizeof(char) * binarySizes[i]); + binaries[i] = (char*) malloc(binarySizes[i]); if (binaries[i] == NULL) { return 0; } @@ -519,7 +519,7 @@ int OpenclDevice::CompileKernelFile(GPUEnv *gpuInfo, const char *buildOption) { fd1 = fopen("kernel-build.log", "w+"); if (fd1 != NULL) { - fwrite(buildLog, sizeof(char), length, fd1); + fwrite(buildLog, 1, length, fd1); fclose(fd1); } |