mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +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:
@@ -33,32 +33,44 @@ void Robot::StartCompetition() {
|
||||
m_ds.InDisabled(true);
|
||||
Disabled();
|
||||
m_ds.InDisabled(false);
|
||||
while (IsDisabled()) m_ds.WaitForData();
|
||||
while (IsDisabled()) {
|
||||
m_ds.WaitForData();
|
||||
}
|
||||
} else if (IsAutonomous()) {
|
||||
m_ds.InAutonomous(true);
|
||||
Autonomous();
|
||||
m_ds.InAutonomous(false);
|
||||
while (IsAutonomousEnabled()) m_ds.WaitForData();
|
||||
while (IsAutonomousEnabled()) {
|
||||
m_ds.WaitForData();
|
||||
}
|
||||
} else if (IsTest()) {
|
||||
lw.SetEnabled(true);
|
||||
frc::Shuffleboard::EnableActuatorWidgets();
|
||||
m_ds.InTest(true);
|
||||
Test();
|
||||
m_ds.InTest(false);
|
||||
while (IsTest() && IsEnabled()) m_ds.WaitForData();
|
||||
while (IsTest() && IsEnabled()) {
|
||||
m_ds.WaitForData();
|
||||
}
|
||||
lw.SetEnabled(false);
|
||||
frc::Shuffleboard::DisableActuatorWidgets();
|
||||
} else {
|
||||
m_ds.InOperatorControl(true);
|
||||
Teleop();
|
||||
m_ds.InOperatorControl(false);
|
||||
while (IsOperatorControlEnabled()) m_ds.WaitForData();
|
||||
while (IsOperatorControlEnabled()) {
|
||||
m_ds.WaitForData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Robot::EndCompetition() { m_exit = true; }
|
||||
void Robot::EndCompetition() {
|
||||
m_exit = true;
|
||||
}
|
||||
|
||||
#ifndef RUNNING_FRC_TESTS
|
||||
int main() { return frc::StartRobot<Robot>(); }
|
||||
int main() {
|
||||
return frc::StartRobot<Robot>();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user