Fix C++ floating point literal formatting (#2114)

Found formatting errors with this regex
"([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false
positives.

Fixes #2112.
This commit is contained in:
Tyler Veness
2019-11-20 21:48:16 -08:00
committed by Peter Johnson
parent 3d1ca856b2
commit ffa4b907c0
40 changed files with 82 additions and 82 deletions

View File

@@ -35,7 +35,7 @@ void DriveSubsystem::ResetEncoders() {
}
double DriveSubsystem::GetAverageEncoderDistance() {
return (m_leftEncoder.GetDistance() + m_rightEncoder.GetDistance()) / 2.;
return (m_leftEncoder.GetDistance() + m_rightEncoder.GetDistance()) / 2.0;
}
frc::Encoder& DriveSubsystem::GetLeftEncoder() { return m_leftEncoder; }

View File

@@ -44,7 +44,7 @@ constexpr int kHatchSolenoidPorts[]{0, 1};
namespace AutoConstants {
constexpr double kAutoDriveDistanceInches = 60;
constexpr double kAutoBackupDistanceInches = 20;
constexpr double kAutoDriveSpeed = .5;
constexpr double kAutoDriveSpeed = 0.5;
} // namespace AutoConstants
namespace OIConstants {

View File

@@ -63,7 +63,7 @@ class RobotContainer {
frc2::InstantCommand m_grabHatch{[this] { m_hatch.GrabHatch(); }, {&m_hatch}};
frc2::InstantCommand m_releaseHatch{[this] { m_hatch.ReleaseHatch(); },
{&m_hatch}};
frc2::InstantCommand m_driveHalfSpeed{[this] { m_drive.SetMaxOutput(.5); },
frc2::InstantCommand m_driveHalfSpeed{[this] { m_drive.SetMaxOutput(0.5); },
{}};
frc2::InstantCommand m_driveFullSpeed{[this] { m_drive.SetMaxOutput(1); },
{}};