Skip to content

Commit 209518c

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

File tree

2 files changed

+49
-40
lines changed

2 files changed

+49
-40
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

+47-37
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,21 @@ 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 ) ) {
176-
log_error("Failed to initialize the GL environment for this test.\n");
177-
error = -1;
178-
goto cleanup;
175+
if (glEnv->Init(&argc, (char **)argv, CL_FALSE))
176+
{
177+
log_error("Failed to initialize the GL environment for this test.\n");
178+
error = -1;
179+
goto cleanup;
179180
}
180181

181-
// OpenGL tests for non-3.2 ////////////////////////////////////////////////////////
182-
if ((argc == 1) || (first_32_testname != 1)) {
182+
// OpenGL tests for non-3.2
183+
// ////////////////////////////////////////////////////////
184+
if ((argc == 1) || (first_32_testname != 1))
185+
{
183186

184-
// Create a context to use and then grab a device (or devices) from it
185-
sCurrentContext = glEnv->CreateCLContext();
186-
if( sCurrentContext == NULL )
187+
// Create a context to use and then grab a device (or devices) from it
188+
sCurrentContext = glEnv->CreateCLContext();
189+
if (sCurrentContext == NULL)
187190
{
188191
log_error( "ERROR: Unable to obtain CL context from GL\n" );
189192
error = -1;
@@ -282,38 +285,45 @@ int main(int argc, const char *argv[])
282285
}
283286

284287
// 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-
}
288+
if ((argc == 1) || first_32_testname)
289+
{
290+
// Create a context to use and then grab a device (or devices) from it
291+
sCurrentContext = glEnv->CreateCLContext();
292+
if (sCurrentContext == NULL)
293+
{
294+
log_error("ERROR: Unable to obtain CL context from GL\n");
295+
error = -1;
296+
goto cleanup;
297+
}
293298

294-
size_t numDevices = 0;
295-
cl_device_id deviceIDs[ 16 ];
299+
size_t numDevices = 0;
300+
cl_device_id deviceIDs[16];
296301

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);
302+
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL,
303+
&numDevices);
304+
if (error != CL_SUCCESS)
305+
{
306+
print_error(error, "Unable to get device count from context");
307+
error = -1;
308+
goto cleanup;
309+
}
310+
numDevices /= sizeof(cl_device_id);
304311

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

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-
}
319+
error = clGetContextInfo(sCurrentContext, CL_CONTEXT_DEVICES,
320+
sizeof(deviceIDs), deviceIDs, NULL);
321+
if (error != CL_SUCCESS)
322+
{
323+
print_error(error, "Unable to get device list from context");
324+
error = -1;
325+
goto cleanup;
326+
}
317327

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

0 commit comments

Comments
 (0)