Skip to content

Commit cf5159b

Browse files
committed
run clang-format on touched files
1 parent f6f599b commit cf5159b

File tree

2 files changed

+39
-32
lines changed

2 files changed

+39
-32
lines changed

test_conformance/gl/main.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ int main(int argc, const char *argv[])
253253
// At least one device supports CL-GL interop, so init the test.
254254
if (glEnv->Init(&argc, (char **)argv, CL_FALSE))
255255
{
256-
log_error(
257-
"Failed to initialize the GL environment for this test.\n");
256+
log_error("Failed to initialize the GL environment for this test.\n");
258257
return -1;
259258
}
260259

@@ -333,7 +332,7 @@ int main(int argc, const char *argv[])
333332

334333
// OpenGL 3.2 tests.
335334
// ////////////////////////////////////////////////////////
336-
if ((argc == 1) || first_32_testname)
335+
if ((argc == 1) || first_32_testname)
337336
{
338337
// Create a context to use and then grab a device (or devices) from it
339338
sCurrentContext = glEnv->CreateCLContext();

test_conformance/gles/main.cpp

+37-29
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ int main(int argc, const char *argv[])
172172
}
173173

174174
// At least one device supports CL-GL interop, so init the test.
175-
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
175+
if (glEnv->Init(&argc, (char **)argv, CL_FALSE))
176+
{
176177
log_error("Failed to initialize the GL environment for this test.\n");
177178
error = -1;
178179
goto cleanup;
@@ -282,38 +283,45 @@ int main(int argc, const char *argv[])
282283
}
283284

284285
// OpenGL 3.2 tests. ////////////////////////////////////////////////////////
285-
if ((argc==1) || first_32_testname) {
286-
// Create a context to use and then grab a device (or devices) from it
287-
sCurrentContext = glEnv->CreateCLContext();
288-
if( sCurrentContext == NULL ) {
289-
log_error( "ERROR: Unable to obtain CL context from GL\n" );
290-
error = -1;
291-
goto cleanup;
292-
}
286+
if ((argc == 1) || first_32_testname)
287+
{
288+
// Create a context to use and then grab a device (or devices) from it
289+
sCurrentContext = glEnv->CreateCLContext();
290+
if (sCurrentContext == NULL)
291+
{
292+
log_error("ERROR: Unable to obtain CL context from GL\n");
293+
error = -1;
294+
goto cleanup;
295+
}
293296

294-
size_t numDevices = 0;
295-
cl_device_id deviceIDs[ 16 ];
297+
size_t numDevices = 0;
298+
cl_device_id deviceIDs[16];
296299

297-
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
298-
if( error != CL_SUCCESS ) {
299-
print_error( error, "Unable to get device count from context" );
300-
error = -1;
301-
goto cleanup;
302-
}
303-
numDevices /= sizeof(cl_device_id);
300+
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL,
301+
&numDevices);
302+
if (error != CL_SUCCESS)
303+
{
304+
print_error(error, "Unable to get device count from context");
305+
error = -1;
306+
goto cleanup;
307+
}
308+
numDevices /= sizeof(cl_device_id);
304309

305-
if (numDevices < 1) {
306-
log_error("No devices found.\n");
307-
error = -1;
308-
goto cleanup;
309-
}
310+
if (numDevices < 1)
311+
{
312+
log_error("No devices found.\n");
313+
error = -1;
314+
goto cleanup;
315+
}
310316

311-
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
312-
if( error != CL_SUCCESS ) {
313-
print_error( error, "Unable to get device list from context" );
314-
error = -1;
315-
goto cleanup;
316-
}
317+
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES,
318+
sizeof(deviceIDs), deviceIDs, NULL);
319+
if (error != CL_SUCCESS)
320+
{
321+
print_error(error, "Unable to get device list from context");
322+
error = -1;
323+
goto cleanup;
324+
}
317325

318326
#ifdef GLES3
319327
int argc_ = (first_32_testname) ? 1 + (argc - first_32_testname) : argc;

0 commit comments

Comments
 (0)