summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/OpenCL.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-12-05 09:04:34 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-12-05 09:04:34 +0000
commit9da4fe086b3f7c0c2e310c3b6438ed131fb13ff2 (patch)
tree5867e2b49f5413d130d6d9c41479001dbd43a3d7 /Source/Core/Common/Src/OpenCL.cpp
parent3e4aa2060185d6122b838d166a3c3cb254ba8844 (diff)
allow gcc to check the format of args being passed to MsgAlert and GenericLog. Fixed nearly all warnings that arose from this, as well as some preexisting ones (some were actually crashes and/or bugs...)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6522 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/OpenCL.cpp')
-rw-r--r--Source/Core/Common/Src/OpenCL.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp
index 451d43ab48..c1a6e7166b 100644
--- a/Source/Core/Common/Src/OpenCL.cpp
+++ b/Source/Core/Common/Src/OpenCL.cpp
@@ -78,7 +78,8 @@ bool Initialize()
}
char pbuf[100];
- err = clGetPlatformInfo(platforms[0], CL_PLATFORM_VENDOR, sizeof(pbuf), pbuf, NULL);
+ err = clGetPlatformInfo(platforms[0], CL_PLATFORM_VENDOR, sizeof(pbuf),
+ pbuf, NULL);
if (err != CL_SUCCESS)
{
@@ -95,7 +96,8 @@ bool Initialize()
return false;
}
- cl_context_properties cps[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platform, 0};
+ cl_context_properties cps[3] = {CL_CONTEXT_PLATFORM,
+ (cl_context_properties)platform, 0};
cl_context_properties* cprops = (NULL == platform) ? NULL : cps;
@@ -143,9 +145,10 @@ cl_command_queue GetCommandQueue()
cl_program CompileProgram(const char *Kernel)
{
u32 compileStart = Common::Timer::GetTimeMs();
- int err;
+ cl_int err;
cl_program program;
- program = clCreateProgramWithSource(OpenCL::g_context, 1, (const char **) & Kernel, NULL, &err);
+ program = clCreateProgramWithSource(OpenCL::g_context, 1,
+ (const char **) & Kernel, NULL, &err);
if (!program)
{
HandleCLError(err, "Error: Failed to create compute program!");
@@ -156,13 +159,14 @@ cl_program CompileProgram(const char *Kernel)
err = clBuildProgram(program , 0, NULL, NULL, NULL, NULL);
if(err != CL_SUCCESS) {
char *errors[16384] = {0};
- err = clGetProgramBuildInfo(program, OpenCL::device_id, CL_PROGRAM_BUILD_LOG, sizeof(errors),
- errors, NULL);
- ERROR_LOG(COMMON, "Error log:\n%s\n", errors);
+ err = clGetProgramBuildInfo(program, OpenCL::device_id,
+ CL_PROGRAM_BUILD_LOG, sizeof(*errors), errors, NULL);
+ ERROR_LOG(COMMON, "Error log:\n%s\n", *errors);
return NULL;
}
- NOTICE_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds", (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
+ NOTICE_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds",
+ (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return program;
}
@@ -180,7 +184,8 @@ cl_kernel CompileKernel(cl_program program, const char *Function)
HandleCLError(err, buffer);
return NULL;
}
- NOTICE_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds", (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
+ NOTICE_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds",
+ (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return kernel;
}
#endif