diff --git a/cscore/src/main/native/cpp/cscore_c.cpp b/cscore/src/main/native/cpp/cscore_c.cpp index bc1e63c1c0..ffbc1640ad 100644 --- a/cscore/src/main/native/cpp/cscore_c.cpp +++ b/cscore/src/main/native/cpp/cscore_c.cpp @@ -352,11 +352,11 @@ void CS_ReleaseSink(CS_Sink sink, CS_Status* status) { } void CS_SetListenerOnStart(void (*onStart)(void* data), void* data) { - cs::SetListenerOnStart([=]() { onStart(data); }); + cs::SetListenerOnStart([=] { onStart(data); }); } void CS_SetListenerOnExit(void (*onExit)(void* data), void* data) { - cs::SetListenerOnExit([=]() { onExit(data); }); + cs::SetListenerOnExit([=] { onExit(data); }); } CS_Listener CS_AddListener(void* data, diff --git a/cscore/src/main/native/windows/WindowsMessagePump.cpp b/cscore/src/main/native/windows/WindowsMessagePump.cpp index 4ebcc84571..e0d78d7713 100644 --- a/cscore/src/main/native/windows/WindowsMessagePump.cpp +++ b/cscore/src/main/native/windows/WindowsMessagePump.cpp @@ -90,7 +90,7 @@ WindowsMessagePump::WindowsMessagePump( std::function callback) { m_callback = callback; auto handle = CreateEvent(NULL, true, false, NULL); - m_mainThread = std::thread([=]() { ThreadMain(handle); }); + m_mainThread = std::thread([=] { ThreadMain(handle); }); auto waitResult = WaitForSingleObject(handle, 1000); if (waitResult == WAIT_OBJECT_0) { CloseHandle(handle); diff --git a/wpilibOldCommands/src/main/native/cpp/PIDBase.cpp b/wpilibOldCommands/src/main/native/cpp/PIDBase.cpp index 26b7d1e41b..65bb471ddf 100644 --- a/wpilibOldCommands/src/main/native/cpp/PIDBase.cpp +++ b/wpilibOldCommands/src/main/native/cpp/PIDBase.cpp @@ -230,17 +230,17 @@ void PIDBase::PIDWrite(double output) { void PIDBase::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("PIDController"); - builder.SetSafeState([=]() { Reset(); }); + builder.SetSafeState([=] { Reset(); }); builder.AddDoubleProperty( - "p", [=]() { return GetP(); }, [=](double value) { SetP(value); }); + "p", [=] { return GetP(); }, [=](double value) { SetP(value); }); builder.AddDoubleProperty( - "i", [=]() { return GetI(); }, [=](double value) { SetI(value); }); + "i", [=] { return GetI(); }, [=](double value) { SetI(value); }); builder.AddDoubleProperty( - "d", [=]() { return GetD(); }, [=](double value) { SetD(value); }); + "d", [=] { return GetD(); }, [=](double value) { SetD(value); }); builder.AddDoubleProperty( - "f", [=]() { return GetF(); }, [=](double value) { SetF(value); }); + "f", [=] { return GetF(); }, [=](double value) { SetF(value); }); builder.AddDoubleProperty( - "setpoint", [=]() { return GetSetpoint(); }, + "setpoint", [=] { return GetSetpoint(); }, [=](double value) { SetSetpoint(value); }); } diff --git a/wpilibOldCommands/src/main/native/cpp/PIDController.cpp b/wpilibOldCommands/src/main/native/cpp/PIDController.cpp index 8879dc97a4..5adbe1cdf8 100644 --- a/wpilibOldCommands/src/main/native/cpp/PIDController.cpp +++ b/wpilibOldCommands/src/main/native/cpp/PIDController.cpp @@ -78,6 +78,6 @@ void PIDController::Reset() { void PIDController::InitSendable(SendableBuilder& builder) { PIDBase::InitSendable(builder); builder.AddBooleanProperty( - "enabled", [=]() { return IsEnabled(); }, + "enabled", [=] { return IsEnabled(); }, [=](bool value) { SetEnabled(value); }); } diff --git a/wpilibOldCommands/src/main/native/cpp/buttons/Trigger.cpp b/wpilibOldCommands/src/main/native/cpp/buttons/Trigger.cpp index 40afef8bf8..6739aa2839 100644 --- a/wpilibOldCommands/src/main/native/cpp/buttons/Trigger.cpp +++ b/wpilibOldCommands/src/main/native/cpp/buttons/Trigger.cpp @@ -64,8 +64,8 @@ void Trigger::ToggleWhenActive(Command* command) { void Trigger::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Button"); - builder.SetSafeState([=]() { m_sendablePressed = false; }); + builder.SetSafeState([=] { m_sendablePressed = false; }); builder.AddBooleanProperty( - "pressed", [=]() { return Grab(); }, + "pressed", [=] { return Grab(); }, [=](bool value) { m_sendablePressed = value; }); } diff --git a/wpilibOldCommands/src/main/native/cpp/commands/Command.cpp b/wpilibOldCommands/src/main/native/cpp/commands/Command.cpp index 8e9b35bc59..2f662bad42 100644 --- a/wpilibOldCommands/src/main/native/cpp/commands/Command.cpp +++ b/wpilibOldCommands/src/main/native/cpp/commands/Command.cpp @@ -295,10 +295,10 @@ void Command::SetSubsystem(std::string_view name) { void Command::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Command"); builder.AddStringProperty( - ".name", [=]() { return SendableRegistry::GetInstance().GetName(this); }, + ".name", [=] { return SendableRegistry::GetInstance().GetName(this); }, nullptr); builder.AddBooleanProperty( - "running", [=]() { return IsRunning(); }, + "running", [=] { return IsRunning(); }, [=](bool value) { if (value) { if (!IsRunning()) { @@ -311,5 +311,5 @@ void Command::InitSendable(SendableBuilder& builder) { } }); builder.AddBooleanProperty( - ".isParented", [=]() { return IsParented(); }, nullptr); + ".isParented", [=] { return IsParented(); }, nullptr); } diff --git a/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp b/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp index 8baa62f5c3..b28da54770 100644 --- a/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp +++ b/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp @@ -162,7 +162,7 @@ void Scheduler::InitSendable(SendableBuilder& builder) { auto namesEntry = builder.GetEntry("Names"); auto idsEntry = builder.GetEntry("Ids"); auto cancelEntry = builder.GetEntry("Cancel"); - builder.SetUpdateTable([=]() { + builder.SetUpdateTable([=] { // Get the list of possible commands to cancel auto new_toCancel = cancelEntry.GetValue(); wpi::span toCancel; diff --git a/wpilibOldCommands/src/main/native/cpp/commands/Subsystem.cpp b/wpilibOldCommands/src/main/native/cpp/commands/Subsystem.cpp index ffb02788f3..5b9e888cb8 100644 --- a/wpilibOldCommands/src/main/native/cpp/commands/Subsystem.cpp +++ b/wpilibOldCommands/src/main/native/cpp/commands/Subsystem.cpp @@ -125,12 +125,12 @@ void Subsystem::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Subsystem"); builder.AddBooleanProperty( - ".hasDefault", [=]() { return m_defaultCommand != nullptr; }, nullptr); + ".hasDefault", [=] { return m_defaultCommand != nullptr; }, nullptr); builder.AddStringProperty( - ".default", [=]() { return GetDefaultCommandName(); }, nullptr); + ".default", [=] { return GetDefaultCommandName(); }, nullptr); builder.AddBooleanProperty( - ".hasCommand", [=]() { return m_currentCommand != nullptr; }, nullptr); + ".hasCommand", [=] { return m_currentCommand != nullptr; }, nullptr); builder.AddStringProperty( - ".command", [=]() { return GetCurrentCommandName(); }, nullptr); + ".command", [=] { return GetCurrentCommandName(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp b/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp index 8d651a6201..222c78b05a 100644 --- a/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp +++ b/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp @@ -89,7 +89,7 @@ void ADXL345_I2C::InitSendable(SendableBuilder& builder) { auto x = builder.GetEntry("X").GetHandle(); auto y = builder.GetEntry("Y").GetHandle(); auto z = builder.GetEntry("Z").GetHandle(); - builder.SetUpdateTable([=]() { + builder.SetUpdateTable([=] { auto data = GetAccelerations(); nt::NetworkTableEntry(x).SetDouble(data.XAxis); nt::NetworkTableEntry(y).SetDouble(data.YAxis); diff --git a/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp b/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp index be7bf31dd0..958cadf083 100644 --- a/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp +++ b/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp @@ -120,7 +120,7 @@ void ADXL345_SPI::InitSendable(SendableBuilder& builder) { auto x = builder.GetEntry("X").GetHandle(); auto y = builder.GetEntry("Y").GetHandle(); auto z = builder.GetEntry("Z").GetHandle(); - builder.SetUpdateTable([=]() { + builder.SetUpdateTable([=] { auto data = GetAccelerations(); nt::NetworkTableEntry(x).SetDouble(data.XAxis); nt::NetworkTableEntry(y).SetDouble(data.YAxis); diff --git a/wpilibc/src/main/native/cpp/ADXL362.cpp b/wpilibc/src/main/native/cpp/ADXL362.cpp index 3730b83a98..ae60f9d4f9 100644 --- a/wpilibc/src/main/native/cpp/ADXL362.cpp +++ b/wpilibc/src/main/native/cpp/ADXL362.cpp @@ -183,7 +183,7 @@ void ADXL362::InitSendable(SendableBuilder& builder) { auto x = builder.GetEntry("X").GetHandle(); auto y = builder.GetEntry("Y").GetHandle(); auto z = builder.GetEntry("Z").GetHandle(); - builder.SetUpdateTable([=]() { + builder.SetUpdateTable([=] { auto data = GetAccelerations(); nt::NetworkTableEntry(x).SetDouble(data.XAxis); nt::NetworkTableEntry(y).SetDouble(data.YAxis); diff --git a/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp b/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp index d3a7e03c4a..e9ad1bcabe 100644 --- a/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp +++ b/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp @@ -139,5 +139,5 @@ int ADXRS450_Gyro::GetPort() const { void ADXRS450_Gyro::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Gyro"); builder.AddDoubleProperty( - "Value", [=]() { return GetAngle(); }, nullptr); + "Value", [=] { return GetAngle(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp b/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp index db291cebb8..34b01573f6 100644 --- a/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp +++ b/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp @@ -49,7 +49,7 @@ void AnalogAccelerometer::SetZero(double zero) { void AnalogAccelerometer::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Accelerometer"); builder.AddDoubleProperty( - "Value", [=]() { return GetAcceleration(); }, nullptr); + "Value", [=] { return GetAcceleration(); }, nullptr); } void AnalogAccelerometer::InitAccelerometer() { diff --git a/wpilibc/src/main/native/cpp/AnalogGyro.cpp b/wpilibc/src/main/native/cpp/AnalogGyro.cpp index eaf8c52dde..2221f1a6df 100644 --- a/wpilibc/src/main/native/cpp/AnalogGyro.cpp +++ b/wpilibc/src/main/native/cpp/AnalogGyro.cpp @@ -141,5 +141,5 @@ std::shared_ptr AnalogGyro::GetAnalogInput() const { void AnalogGyro::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Gyro"); builder.AddDoubleProperty( - "Value", [=]() { return GetAngle(); }, nullptr); + "Value", [=] { return GetAngle(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/AnalogInput.cpp b/wpilibc/src/main/native/cpp/AnalogInput.cpp index 94aa2ca5bd..2b06d97f13 100644 --- a/wpilibc/src/main/native/cpp/AnalogInput.cpp +++ b/wpilibc/src/main/native/cpp/AnalogInput.cpp @@ -197,5 +197,5 @@ void AnalogInput::SetSimDevice(HAL_SimDeviceHandle device) { void AnalogInput::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Analog Input"); builder.AddDoubleProperty( - "Value", [=]() { return GetAverageVoltage(); }, nullptr); + "Value", [=] { return GetAverageVoltage(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/AnalogOutput.cpp b/wpilibc/src/main/native/cpp/AnalogOutput.cpp index 806433cb53..e853f5e44c 100644 --- a/wpilibc/src/main/native/cpp/AnalogOutput.cpp +++ b/wpilibc/src/main/native/cpp/AnalogOutput.cpp @@ -61,6 +61,6 @@ int AnalogOutput::GetChannel() const { void AnalogOutput::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Analog Output"); builder.AddDoubleProperty( - "Value", [=]() { return GetVoltage(); }, + "Value", [=] { return GetVoltage(); }, [=](double value) { SetVoltage(value); }); } diff --git a/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp b/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp index 2863adca64..f5d0880d35 100644 --- a/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp +++ b/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp @@ -46,5 +46,5 @@ double AnalogPotentiometer::Get() const { void AnalogPotentiometer::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Analog Input"); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, nullptr); + "Value", [=] { return Get(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp b/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp index fa39354a86..94fa33428b 100644 --- a/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp +++ b/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp @@ -47,9 +47,9 @@ double BuiltInAccelerometer::GetZ() { void BuiltInAccelerometer::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("3AxisAccelerometer"); builder.AddDoubleProperty( - "X", [=]() { return GetX(); }, nullptr); + "X", [=] { return GetX(); }, nullptr); builder.AddDoubleProperty( - "Y", [=]() { return GetY(); }, nullptr); + "Y", [=] { return GetY(); }, nullptr); builder.AddDoubleProperty( - "Z", [=]() { return GetZ(); }, nullptr); + "Z", [=] { return GetZ(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/Counter.cpp b/wpilibc/src/main/native/cpp/Counter.cpp index bc57ce3835..6ad7876a2c 100644 --- a/wpilibc/src/main/native/cpp/Counter.cpp +++ b/wpilibc/src/main/native/cpp/Counter.cpp @@ -309,5 +309,5 @@ bool Counter::GetDirection() const { void Counter::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Counter"); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, nullptr); + "Value", [=] { return Get(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/DigitalInput.cpp b/wpilibc/src/main/native/cpp/DigitalInput.cpp index 814294e901..f5c8f93e73 100644 --- a/wpilibc/src/main/native/cpp/DigitalInput.cpp +++ b/wpilibc/src/main/native/cpp/DigitalInput.cpp @@ -70,5 +70,5 @@ int DigitalInput::GetChannel() const { void DigitalInput::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Digital Input"); builder.AddBooleanProperty( - "Value", [=]() { return Get(); }, nullptr); + "Value", [=] { return Get(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/DigitalOutput.cpp b/wpilibc/src/main/native/cpp/DigitalOutput.cpp index 15817c0cdb..4dcd6bdc78 100644 --- a/wpilibc/src/main/native/cpp/DigitalOutput.cpp +++ b/wpilibc/src/main/native/cpp/DigitalOutput.cpp @@ -143,5 +143,5 @@ void DigitalOutput::SetSimDevice(HAL_SimDeviceHandle device) { void DigitalOutput::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Digital Output"); builder.AddBooleanProperty( - "Value", [=]() { return Get(); }, [=](bool value) { Set(value); }); + "Value", [=] { return Get(); }, [=](bool value) { Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp b/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp index bae03c7d02..5ec8ee86b0 100644 --- a/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp +++ b/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp @@ -118,7 +118,7 @@ bool DoubleSolenoid::IsRevSolenoidDisabled() const { void DoubleSolenoid::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Double Solenoid"); builder.SetActuator(true); - builder.SetSafeState([=]() { Set(kOff); }); + builder.SetSafeState([=] { Set(kOff); }); builder.AddSmallStringProperty( "Value", [=](wpi::SmallVectorImpl& buf) -> std::string_view { diff --git a/wpilibc/src/main/native/cpp/Encoder.cpp b/wpilibc/src/main/native/cpp/Encoder.cpp index fb12f095dc..7192176b8e 100644 --- a/wpilibc/src/main/native/cpp/Encoder.cpp +++ b/wpilibc/src/main/native/cpp/Encoder.cpp @@ -218,11 +218,11 @@ void Encoder::InitSendable(SendableBuilder& builder) { } builder.AddDoubleProperty( - "Speed", [=]() { return GetRate(); }, nullptr); + "Speed", [=] { return GetRate(); }, nullptr); builder.AddDoubleProperty( - "Distance", [=]() { return GetDistance(); }, nullptr); + "Distance", [=] { return GetDistance(); }, nullptr); builder.AddDoubleProperty( - "Distance per Tick", [=]() { return GetDistancePerPulse(); }, nullptr); + "Distance per Tick", [=] { return GetDistancePerPulse(); }, nullptr); } void Encoder::InitEncoder(bool reverseDirection, EncodingType encodingType) { diff --git a/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp b/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp index 32c449f675..a033fc1820 100644 --- a/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp +++ b/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp @@ -97,10 +97,10 @@ void PowerDistributionPanel::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("PowerDistributionPanel"); for (int i = 0; i < SensorUtil::kPDPChannels; ++i) { builder.AddDoubleProperty( - fmt::format("Chan{}", i), [=]() { return GetCurrent(i); }, nullptr); + fmt::format("Chan{}", i), [=] { return GetCurrent(i); }, nullptr); } builder.AddDoubleProperty( - "Voltage", [=]() { return GetVoltage(); }, nullptr); + "Voltage", [=] { return GetVoltage(); }, nullptr); builder.AddDoubleProperty( - "TotalCurrent", [=]() { return GetTotalCurrent(); }, nullptr); + "TotalCurrent", [=] { return GetTotalCurrent(); }, nullptr); } diff --git a/wpilibc/src/main/native/cpp/Relay.cpp b/wpilibc/src/main/native/cpp/Relay.cpp index accf120396..1dbc9092c1 100644 --- a/wpilibc/src/main/native/cpp/Relay.cpp +++ b/wpilibc/src/main/native/cpp/Relay.cpp @@ -175,7 +175,7 @@ std::string Relay::GetDescription() const { void Relay::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Relay"); builder.SetActuator(true); - builder.SetSafeState([=]() { Set(kOff); }); + builder.SetSafeState([=] { Set(kOff); }); builder.AddSmallStringProperty( "Value", [=](wpi::SmallVectorImpl& buf) -> std::string_view { diff --git a/wpilibc/src/main/native/cpp/SPI.cpp b/wpilibc/src/main/native/cpp/SPI.cpp index 74df512daf..e46697aba0 100644 --- a/wpilibc/src/main/native/cpp/SPI.cpp +++ b/wpilibc/src/main/native/cpp/SPI.cpp @@ -25,7 +25,7 @@ class SPI::Accumulator { public: Accumulator(HAL_SPIPort port, int xferSize, int validMask, int validValue, int dataShift, int dataSize, bool isSigned, bool bigEndian) - : m_notifier([=]() { + : m_notifier([=] { std::scoped_lock lock(m_mutex); Update(); }), diff --git a/wpilibc/src/main/native/cpp/Servo.cpp b/wpilibc/src/main/native/cpp/Servo.cpp index 7ab18f21f3..b1676410b5 100644 --- a/wpilibc/src/main/native/cpp/Servo.cpp +++ b/wpilibc/src/main/native/cpp/Servo.cpp @@ -65,7 +65,7 @@ double Servo::GetMinAngle() const { void Servo::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Servo"); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, [=](double value) { Set(value); }); + "Value", [=] { return Get(); }, [=](double value) { Set(value); }); } double Servo::GetServoAngleRange() const { diff --git a/wpilibc/src/main/native/cpp/Solenoid.cpp b/wpilibc/src/main/native/cpp/Solenoid.cpp index 9a8c7a9d48..1e499d470b 100644 --- a/wpilibc/src/main/native/cpp/Solenoid.cpp +++ b/wpilibc/src/main/native/cpp/Solenoid.cpp @@ -75,7 +75,7 @@ void Solenoid::StartPulse() { void Solenoid::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Solenoid"); builder.SetActuator(true); - builder.SetSafeState([=]() { Set(false); }); + builder.SetSafeState([=] { Set(false); }); builder.AddBooleanProperty( - "Value", [=]() { return Get(); }, [=](bool value) { Set(value); }); + "Value", [=] { return Get(); }, [=](bool value) { Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp b/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp index a9976d74a3..fb15695705 100644 --- a/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp +++ b/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp @@ -63,7 +63,7 @@ void SpeedControllerGroup::StopMotor() { void SpeedControllerGroup::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Speed Controller"); builder.SetActuator(true); - builder.SetSafeState([=]() { StopMotor(); }); + builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, [=](double value) { Set(value); }); + "Value", [=] { return Get(); }, [=](double value) { Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp index 187982d588..9024c48197 100644 --- a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp @@ -198,9 +198,9 @@ void DifferentialDrive::InitSendable(SendableBuilder& builder) { builder.SetActuator(true); builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Left Motor Speed", [=]() { return m_leftMotor->Get(); }, + "Left Motor Speed", [=] { return m_leftMotor->Get(); }, [=](double value) { m_leftMotor->Set(value); }); builder.AddDoubleProperty( - "Right Motor Speed", [=]() { return m_rightMotor->Get(); }, + "Right Motor Speed", [=] { return m_rightMotor->Get(); }, [=](double value) { m_rightMotor->Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/drive/KilloughDrive.cpp b/wpilibc/src/main/native/cpp/drive/KilloughDrive.cpp index 29213da992..88d6fad9bf 100644 --- a/wpilibc/src/main/native/cpp/drive/KilloughDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/KilloughDrive.cpp @@ -123,12 +123,12 @@ void KilloughDrive::InitSendable(SendableBuilder& builder) { builder.SetActuator(true); builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Left Motor Speed", [=]() { return m_leftMotor->Get(); }, + "Left Motor Speed", [=] { return m_leftMotor->Get(); }, [=](double value) { m_leftMotor->Set(value); }); builder.AddDoubleProperty( - "Right Motor Speed", [=]() { return m_rightMotor->Get(); }, + "Right Motor Speed", [=] { return m_rightMotor->Get(); }, [=](double value) { m_rightMotor->Set(value); }); builder.AddDoubleProperty( - "Back Motor Speed", [=]() { return m_backMotor->Get(); }, + "Back Motor Speed", [=] { return m_backMotor->Get(); }, [=](double value) { m_backMotor->Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp index 1bb2565b60..745494cd9d 100644 --- a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp @@ -118,13 +118,13 @@ void MecanumDrive::InitSendable(SendableBuilder& builder) { builder.SetActuator(true); builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Front Left Motor Speed", [=]() { return m_frontLeftMotor->Get(); }, + "Front Left Motor Speed", [=] { return m_frontLeftMotor->Get(); }, [=](double value) { m_frontLeftMotor->Set(value); }); builder.AddDoubleProperty( "Front Right Motor Speed", [=] { return m_frontRightMotor->Get(); }, [=](double value) { m_frontRightMotor->Set(value); }); builder.AddDoubleProperty( - "Rear Left Motor Speed", [=]() { return m_rearLeftMotor->Get(); }, + "Rear Left Motor Speed", [=] { return m_rearLeftMotor->Get(); }, [=](double value) { m_rearLeftMotor->Set(value); }); builder.AddDoubleProperty( "Rear Right Motor Speed", [=] { return m_rearRightMotor->Get(); }, diff --git a/wpilibc/src/main/native/cpp/motorcontrol/MotorControllerGroup.cpp b/wpilibc/src/main/native/cpp/motorcontrol/MotorControllerGroup.cpp index 54ec4d8a94..1303ee46fe 100644 --- a/wpilibc/src/main/native/cpp/motorcontrol/MotorControllerGroup.cpp +++ b/wpilibc/src/main/native/cpp/motorcontrol/MotorControllerGroup.cpp @@ -63,7 +63,7 @@ void MotorControllerGroup::StopMotor() { void MotorControllerGroup::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Motor Controller"); builder.SetActuator(true); - builder.SetSafeState([=]() { StopMotor(); }); + builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, [=](double value) { Set(value); }); + "Value", [=] { return Get(); }, [=](double value) { Set(value); }); } diff --git a/wpilibc/src/main/native/cpp/motorcontrol/NidecBrushless.cpp b/wpilibc/src/main/native/cpp/motorcontrol/NidecBrushless.cpp index 2eaf57dcf4..8e207b123e 100644 --- a/wpilibc/src/main/native/cpp/motorcontrol/NidecBrushless.cpp +++ b/wpilibc/src/main/native/cpp/motorcontrol/NidecBrushless.cpp @@ -75,7 +75,7 @@ int NidecBrushless::GetChannel() const { void NidecBrushless::InitSendable(SendableBuilder& builder) { builder.SetSmartDashboardType("Nidec Brushless"); builder.SetActuator(true); - builder.SetSafeState([=]() { StopMotor(); }); + builder.SetSafeState([=] { StopMotor(); }); builder.AddDoubleProperty( - "Value", [=]() { return Get(); }, [=](double value) { Set(value); }); + "Value", [=] { return Get(); }, [=](double value) { Set(value); }); } diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SendableChooser.inc b/wpilibc/src/main/native/include/frc/smartdashboard/SendableChooser.inc index d556ea3aad..13ec1b21a6 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SendableChooser.inc +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SendableChooser.inc @@ -49,7 +49,7 @@ void SendableChooser::InitSendable(SendableBuilder& builder) { builder.GetEntry(kInstance).SetDouble(m_instance); builder.AddStringArrayProperty( kOptions, - [=]() { + [=] { std::vector keys; for (const auto& choice : m_choices) { keys.emplace_back(choice.first()); diff --git a/wpiutil/src/main/native/cpp/TCPConnector_parallel.cpp b/wpiutil/src/main/native/cpp/TCPConnector_parallel.cpp index ff177bfc6f..26258cf197 100644 --- a/wpiutil/src/main/native/cpp/TCPConnector_parallel.cpp +++ b/wpiutil/src/main/native/cpp/TCPConnector_parallel.cpp @@ -82,7 +82,7 @@ std::unique_ptr TCPConnector::connect_parallel( ++num_workers; // start the worker - std::thread([=]() { + std::thread([=] { if (!result->done) { // add to global state { diff --git a/wpiutil/src/main/native/include/wpi/raw_uv_ostream.h b/wpiutil/src/main/native/include/wpi/raw_uv_ostream.h index 12580ac89d..463043c307 100644 --- a/wpiutil/src/main/native/include/wpi/raw_uv_ostream.h +++ b/wpiutil/src/main/native/include/wpi/raw_uv_ostream.h @@ -29,8 +29,7 @@ class raw_uv_ostream : public raw_ostream { * performed using Buffer::Allocate(). */ raw_uv_ostream(SmallVectorImpl& bufs, size_t allocSize) - : m_bufs(bufs), - m_alloc([=]() { return uv::Buffer::Allocate(allocSize); }) { + : m_bufs(bufs), m_alloc([=] { return uv::Buffer::Allocate(allocSize); }) { SetUnbuffered(); }