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

@@ -25,7 +25,7 @@ Counter::Counter(Mode mode) {
m_counter = HAL_InitializeCounter((HAL_Counter_Mode)mode, &m_index, &status);
wpi_setHALError(status);
SetMaxPeriod(.5);
SetMaxPeriod(0.5);
HAL_Report(HALUsageReporting::kResourceType_Counter, m_index + 1, mode + 1);
SendableRegistry::GetInstance().AddLW(this, "Counter", m_index);

View File

@@ -14,7 +14,7 @@
using namespace frc;
DMC60::DMC60(int channel) : PWMSpeedController(channel) {
SetBounds(2.004, 1.52, 1.50, 1.48, .997);
SetBounds(2.004, 1.52, 1.50, 1.48, 0.997);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
Jaguar::Jaguar(int channel) : PWMSpeedController(channel) {
SetBounds(2.31, 1.55, 1.507, 1.454, .697);
SetBounds(2.31, 1.55, 1.507, 1.454, 0.697);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
PWMSparkMax::PWMSparkMax(int channel) : PWMSpeedController(channel) {
SetBounds(2.003, 1.55, 1.50, 1.46, .999);
SetBounds(2.003, 1.55, 1.50, 1.46, 0.999);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
PWMTalonSRX::PWMTalonSRX(int channel) : PWMSpeedController(channel) {
SetBounds(2.004, 1.52, 1.50, 1.48, .997);
SetBounds(2.004, 1.52, 1.50, 1.48, 0.997);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
PWMVictorSPX::PWMVictorSPX(int channel) : PWMSpeedController(channel) {
SetBounds(2.004, 1.52, 1.50, 1.48, .997);
SetBounds(2.004, 1.52, 1.50, 1.48, 0.997);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -128,13 +128,13 @@ void RobotDrive::Drive(double outputMagnitude, double curve) {
if (curve < 0) {
double value = std::log(-curve);
double ratio = (value - m_sensitivity) / (value + m_sensitivity);
if (ratio == 0) ratio = .0000000001;
if (ratio == 0) ratio = 0.0000000001;
leftOutput = outputMagnitude / ratio;
rightOutput = outputMagnitude;
} else if (curve > 0) {
double value = std::log(curve);
double ratio = (value - m_sensitivity) / (value + m_sensitivity);
if (ratio == 0) ratio = .0000000001;
if (ratio == 0) ratio = 0.0000000001;
leftOutput = outputMagnitude;
rightOutput = outputMagnitude / ratio;
} else {

View File

@@ -14,7 +14,7 @@
using namespace frc;
SD540::SD540(int channel) : PWMSpeedController(channel) {
SetBounds(2.05, 1.55, 1.50, 1.44, .94);
SetBounds(2.05, 1.55, 1.50, 1.44, 0.94);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
Spark::Spark(int channel) : PWMSpeedController(channel) {
SetBounds(2.003, 1.55, 1.50, 1.46, .999);
SetBounds(2.003, 1.55, 1.50, 1.46, 0.999);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
Talon::Talon(int channel) : PWMSpeedController(channel) {
SetBounds(2.037, 1.539, 1.513, 1.487, .989);
SetBounds(2.037, 1.539, 1.513, 1.487, 0.989);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();

View File

@@ -14,7 +14,7 @@
using namespace frc;
VictorSP::VictorSP(int channel) : PWMSpeedController(channel) {
SetBounds(2.004, 1.52, 1.50, 1.48, .997);
SetBounds(2.004, 1.52, 1.50, 1.48, 0.997);
SetPeriodMultiplier(kPeriodMultiplier_1X);
SetSpeed(0.0);
SetZeroLatch();