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
This commit is contained in:
Shawn Hoffman
2010-12-05 09:04:34 +00:00
parent 3e4aa20601
commit 9da4fe086b
35 changed files with 88 additions and 71 deletions

View File

@ -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