mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +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:
@@ -44,7 +44,9 @@ std::unique_ptr<CallbackStore> PWMSim::RegisterRawValueCallback(
|
||||
return store;
|
||||
}
|
||||
|
||||
int PWMSim::GetRawValue() const { return HALSIM_GetPWMRawValue(m_index); }
|
||||
int PWMSim::GetRawValue() const {
|
||||
return HALSIM_GetPWMRawValue(m_index);
|
||||
}
|
||||
|
||||
void PWMSim::SetRawValue(int rawValue) {
|
||||
HALSIM_SetPWMRawValue(m_index, rawValue);
|
||||
@@ -59,9 +61,13 @@ std::unique_ptr<CallbackStore> PWMSim::RegisterSpeedCallback(
|
||||
return store;
|
||||
}
|
||||
|
||||
double PWMSim::GetSpeed() const { return HALSIM_GetPWMSpeed(m_index); }
|
||||
double PWMSim::GetSpeed() const {
|
||||
return HALSIM_GetPWMSpeed(m_index);
|
||||
}
|
||||
|
||||
void PWMSim::SetSpeed(double speed) { HALSIM_SetPWMSpeed(m_index, speed); }
|
||||
void PWMSim::SetSpeed(double speed) {
|
||||
HALSIM_SetPWMSpeed(m_index, speed);
|
||||
}
|
||||
|
||||
std::unique_ptr<CallbackStore> PWMSim::RegisterPositionCallback(
|
||||
NotifyCallback callback, bool initialNotify) {
|
||||
@@ -72,7 +78,9 @@ std::unique_ptr<CallbackStore> PWMSim::RegisterPositionCallback(
|
||||
return store;
|
||||
}
|
||||
|
||||
double PWMSim::GetPosition() const { return HALSIM_GetPWMPosition(m_index); }
|
||||
double PWMSim::GetPosition() const {
|
||||
return HALSIM_GetPWMPosition(m_index);
|
||||
}
|
||||
|
||||
void PWMSim::SetPosition(double position) {
|
||||
HALSIM_SetPWMPosition(m_index, position);
|
||||
@@ -87,7 +95,9 @@ std::unique_ptr<CallbackStore> PWMSim::RegisterPeriodScaleCallback(
|
||||
return store;
|
||||
}
|
||||
|
||||
int PWMSim::GetPeriodScale() const { return HALSIM_GetPWMPeriodScale(m_index); }
|
||||
int PWMSim::GetPeriodScale() const {
|
||||
return HALSIM_GetPWMPeriodScale(m_index);
|
||||
}
|
||||
|
||||
void PWMSim::SetPeriodScale(int periodScale) {
|
||||
HALSIM_SetPWMPeriodScale(m_index, periodScale);
|
||||
@@ -102,10 +112,14 @@ std::unique_ptr<CallbackStore> PWMSim::RegisterZeroLatchCallback(
|
||||
return store;
|
||||
}
|
||||
|
||||
bool PWMSim::GetZeroLatch() const { return HALSIM_GetPWMZeroLatch(m_index); }
|
||||
bool PWMSim::GetZeroLatch() const {
|
||||
return HALSIM_GetPWMZeroLatch(m_index);
|
||||
}
|
||||
|
||||
void PWMSim::SetZeroLatch(bool zeroLatch) {
|
||||
HALSIM_SetPWMZeroLatch(m_index, zeroLatch);
|
||||
}
|
||||
|
||||
void PWMSim::ResetData() { HALSIM_ResetPWMData(m_index); }
|
||||
void PWMSim::ResetData() {
|
||||
HALSIM_ResetPWMData(m_index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user