mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Fix clang-tidy warnings (#4359)
The warnings included recommendations of braces for if statement readability, a recommendation for default initialization of an int array, and include-what-you-use (indirectly through clang-tidy reporting undefined symbols).
This commit is contained in:
@@ -113,8 +113,9 @@ static void notifierThreadMain() {
|
||||
if (!notifierRunning) {
|
||||
break;
|
||||
}
|
||||
if (triggeredMask == 0)
|
||||
if (triggeredMask == 0) {
|
||||
continue;
|
||||
}
|
||||
alarmCallback();
|
||||
}
|
||||
}
|
||||
@@ -195,8 +196,9 @@ void HAL_SetNotifierName(HAL_NotifierHandle notifierHandle, const char* name,
|
||||
|
||||
void HAL_StopNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
|
||||
auto notifier = notifierHandles->Get(notifierHandle);
|
||||
if (!notifier)
|
||||
if (!notifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
std::scoped_lock lock(notifier->mutex);
|
||||
@@ -209,8 +211,9 @@ void HAL_StopNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
|
||||
|
||||
void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
|
||||
auto notifier = notifierHandles->Free(notifierHandle);
|
||||
if (!notifier)
|
||||
if (!notifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Just in case HAL_StopNotifier() wasn't called...
|
||||
{
|
||||
@@ -244,8 +247,9 @@ void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
|
||||
void HAL_UpdateNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
uint64_t triggerTime, int32_t* status) {
|
||||
auto notifier = notifierHandles->Get(notifierHandle);
|
||||
if (!notifier)
|
||||
if (!notifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
std::scoped_lock lock(notifier->mutex);
|
||||
@@ -270,8 +274,9 @@ void HAL_UpdateNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
int32_t* status) {
|
||||
auto notifier = notifierHandles->Get(notifierHandle);
|
||||
if (!notifier)
|
||||
if (!notifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
std::scoped_lock lock(notifier->mutex);
|
||||
@@ -282,8 +287,9 @@ void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
|
||||
int32_t* status) {
|
||||
auto notifier = notifierHandles->Get(notifierHandle);
|
||||
if (!notifier)
|
||||
if (!notifier) {
|
||||
return 0;
|
||||
}
|
||||
std::unique_lock lock(notifier->mutex);
|
||||
notifier->cond.wait(lock, [&] {
|
||||
return !notifier->active || notifier->triggeredTime != UINT64_MAX;
|
||||
|
||||
Reference in New Issue
Block a user