mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java. Also update clang-format settings to always add a line break (even if no braces are used).
This commit is contained in:
@@ -99,7 +99,9 @@ void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
|
||||
int32_t* status) {
|
||||
auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
|
||||
analogTriggerHandles->Free(analogTriggerHandle);
|
||||
if (trigger == nullptr) return;
|
||||
if (trigger == nullptr) {
|
||||
return;
|
||||
}
|
||||
SimAnalogTriggerData[trigger->index].initialized = false;
|
||||
// caller owns the analog input handle.
|
||||
}
|
||||
@@ -128,10 +130,14 @@ void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
|
||||
|
||||
double trigLower =
|
||||
GetAnalogValueToVoltage(trigger->analogHandle, lower, status);
|
||||
if (status != 0) return;
|
||||
if (status != 0) {
|
||||
return;
|
||||
}
|
||||
double trigUpper =
|
||||
GetAnalogValueToVoltage(trigger->analogHandle, upper, status);
|
||||
if (status != 0) return;
|
||||
if (status != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
SimAnalogTriggerData[trigger->index].triggerUpperBound = trigUpper;
|
||||
SimAnalogTriggerData[trigger->index].triggerLowerBound = trigLower;
|
||||
|
||||
Reference in New Issue
Block a user