The open source OpenXR runtime

d/vive: clang-tidy

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
c9259093 5772f862

+10 -8
+10 -8
src/xrt/drivers/vive/vive_device.c
··· 216 216 // Must lock thread before check in while. 217 217 os_thread_helper_lock(&d->mainboard_thread); 218 218 continue; 219 - } else if (ret < 0) { 219 + } 220 + if (ret < 0) { 220 221 VIVE_ERROR("Failed to read device '%i'!", ret); 221 222 return false; 222 223 } ··· 268 269 { 269 270 if (a == (uint8_t)(b + 2)) 270 271 return 1; 271 - else if (b == (uint8_t)(c + 2)) 272 + if (b == (uint8_t)(c + 2)) 272 273 return 2; 273 - else 274 - return 0; 274 + 275 + return 0; 275 276 } 276 277 277 278 static void ··· 409 410 // Must lock thread before check in while. 410 411 os_thread_helper_lock(&d->sensors_thread); 411 412 continue; 412 - } else if (ret < 0) { 413 + } 414 + if (ret < 0) { 413 415 VIVE_ERROR("Failed to read device '%i'!", ret); 414 416 return false; 415 417 } ··· 418 420 if (ret != 52) { 419 421 VIVE_ERROR("Wrong IMU report size: %d", ret); 420 422 return false; 421 - } else { 422 - update_imu(d, (struct vive_imu_report *)buffer); 423 423 } 424 + update_imu(d, (struct vive_imu_report *)buffer); 425 + 424 426 } else 425 427 VIVE_ERROR("Unknown message type %d", buffer[0]); 426 428 ··· 535 537 536 538 537 539 static void 538 - _array_to_vec3(float array[3], struct xrt_vec3 *result) 540 + _array_to_vec3(const float array[3], struct xrt_vec3 *result) 539 541 { 540 542 result->x = array[0]; 541 543 result->y = array[1];