Run wpiformat on merged repo (#1021)

This commit is contained in:
Tyler Veness
2018-05-13 17:09:56 -07:00
committed by Peter Johnson
parent 0babbf317c
commit 6729a7d6b1
481 changed files with 9581 additions and 6828 deletions

View File

@@ -50,8 +50,7 @@ Command::Command(double timeout) : Command("", timeout) {}
* @param timeout the time (in seconds) before this command "times out"
* @see IsTimedOut()
*/
Command::Command(const wpi::Twine& name, double timeout)
: SendableBase(false) {
Command::Command(const wpi::Twine& name, double timeout) : SendableBase(false) {
// We use -1.0 to indicate no timeout.
if (timeout < 0.0 && timeout != -1.0)
wpi_setWPIErrorWithContext(ParameterOutOfRange, "timeout < 0.0");

View File

@@ -19,8 +19,7 @@ using namespace frc;
* @param i the integral value
* @param d the derivative value
*/
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i,
double d)
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i, double d)
: Subsystem(name) {
m_controller = std::make_shared<PIDController>(p, i, d, this, this);
AddChild("PIDController", m_controller);
@@ -35,8 +34,8 @@ PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i,
* @param d the derivative value
* @param f the feedforward value
*/
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i,
double d, double f)
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i, double d,
double f)
: Subsystem(name) {
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
AddChild("PIDController", m_controller);
@@ -55,8 +54,8 @@ PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i,
* @param f the feedfoward value
* @param period the time (in seconds) between calculations
*/
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i,
double d, double f, double period)
PIDSubsystem::PIDSubsystem(const wpi::Twine& name, double p, double i, double d,
double f, double period)
: Subsystem(name) {
m_controller =
std::make_shared<PIDController>(p, i, d, f, this, this, period);

View File

@@ -42,9 +42,8 @@ DoubleSolenoid::DoubleSolenoid(int moduleNumber, int forwardChannel,
m_forwardChannel(forwardChannel),
m_reverseChannel(reverseChannel) {
if (!SensorBase::CheckSolenoidModule(m_moduleNumber)) {
wpi_setWPIErrorWithContext(
ModuleIndexOutOfRange,
"Solenoid Module " + wpi::Twine(m_moduleNumber));
wpi_setWPIErrorWithContext(ModuleIndexOutOfRange,
"Solenoid Module " + wpi::Twine(m_moduleNumber));
return;
}
if (!SensorBase::CheckSolenoidChannel(m_forwardChannel)) {

View File

@@ -41,7 +41,8 @@ void RobotDriveBase::SetDeadband(double deadband) { m_deadband = deadband; }
void RobotDriveBase::SetMaxOutput(double maxOutput) { m_maxOutput = maxOutput; }
/**
* Feed the motor safety object. Resets the timer that will stop the motors if it completes.
* Feed the motor safety object. Resets the timer that will stop the motors if
* it completes.
*
* @see MotorSafetyHelper::Feed()
*/

View File

@@ -50,8 +50,8 @@ void ErrorBase::ClearError() const { m_error.Clear(); }
* @param lineNumber Line number of the error source
*/
void ErrorBase::SetErrnoError(const wpi::Twine& contextMessage,
wpi::StringRef filename,
wpi::StringRef function, int lineNumber) const {
wpi::StringRef filename, wpi::StringRef function,
int lineNumber) const {
wpi::SmallString<128> buf;
wpi::raw_svector_ostream err(buf);
int errNo = errno;
@@ -141,8 +141,8 @@ void ErrorBase::SetError(Error::Code code, const wpi::Twine& contextMessage,
void ErrorBase::SetErrorRange(Error::Code code, int32_t minRange,
int32_t maxRange, int32_t requestedValue,
const wpi::Twine& contextMessage,
wpi::StringRef filename,
wpi::StringRef function, int lineNumber) const {
wpi::StringRef filename, wpi::StringRef function,
int lineNumber) const {
// If there was an error
if (code != 0) {
// Set the current error information for this object.
@@ -197,8 +197,8 @@ bool ErrorBase::StatusIsFatal() const { return m_error.GetCode() < 0; }
void ErrorBase::SetGlobalError(Error::Code code,
const wpi::Twine& contextMessage,
wpi::StringRef filename,
wpi::StringRef function, int lineNumber) {
wpi::StringRef filename, wpi::StringRef function,
int lineNumber) {
// If there was an error
if (code != 0) {
std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);

View File

@@ -115,8 +115,7 @@ void LiveWindow::SetEnabled(bool enabled) {
* @brief Use a STL smart pointer to share ownership of component.
* @deprecated Use Sendable::SetName() instead.
*/
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
const wpi::Twine& name,
void LiveWindow::AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
std::shared_ptr<Sendable> component) {
Add(component);
component->SetName(subsystem, name);
@@ -126,8 +125,8 @@ void LiveWindow::AddSensor(const wpi::Twine& subsystem,
* @brief Pass a reference to LiveWindow and retain ownership of the component.
* @deprecated Use Sendable::SetName() instead.
*/
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
const wpi::Twine& name, Sendable& component) {
void LiveWindow::AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable& component) {
Add(&component);
component.SetName(subsystem, name);
}
@@ -136,8 +135,8 @@ void LiveWindow::AddSensor(const wpi::Twine& subsystem,
* @brief Use a raw pointer to the LiveWindow.
* @deprecated Use Sendable::SetName() instead.
*/
void LiveWindow::AddSensor(const wpi::Twine& subsystem,
const wpi::Twine& name, Sendable* component) {
void LiveWindow::AddSensor(const wpi::Twine& subsystem, const wpi::Twine& name,
Sendable* component) {
Add(component);
component->SetName(subsystem, name);
}

View File

@@ -311,8 +311,7 @@ void SPI::FreeAuto() {
* @param dataToSend data to send (maximum 16 bytes)
* @param zeroSize number of zeros to send after the data
*/
void SPI::SetAutoTransmitData(wpi::ArrayRef<uint8_t> dataToSend,
int zeroSize) {
void SPI::SetAutoTransmitData(wpi::ArrayRef<uint8_t> dataToSend, int zeroSize) {
int32_t status = 0;
HAL_SetSPIAutoTransmitData(m_port, dataToSend.data(), dataToSend.size(),
zeroSize, &status);

View File

@@ -71,8 +71,7 @@ void SendableBase::AddChild(void* child) {
* @param channel The channel number the device is plugged into
*/
void SendableBase::SetName(const wpi::Twine& moduleType, int channel) {
SetName(moduleType + wpi::Twine('[') + wpi::Twine(channel) +
wpi::Twine(']'));
SetName(moduleType + wpi::Twine('[') + wpi::Twine(channel) + wpi::Twine(']'));
}
/**

View File

@@ -304,8 +304,7 @@ bool SmartDashboard::PutNumber(wpi::StringRef keyName, double value) {
* @param defaultValue The default value to set if key doesn't exist.
* @returns False if the table key exists with a different type
*/
bool SmartDashboard::SetDefaultNumber(wpi::StringRef key,
double defaultValue) {
bool SmartDashboard::SetDefaultNumber(wpi::StringRef key, double defaultValue) {
return Singleton::GetInstance().table->GetEntry(key).SetDefaultDouble(
defaultValue);
}
@@ -435,8 +434,8 @@ bool SmartDashboard::PutNumberArray(wpi::StringRef key,
* @param defaultValue The default value to set if key doesn't exist.
* @returns False if the table key exists with a different type
*/
bool SmartDashboard::SetDefaultNumberArray(
wpi::StringRef key, wpi::ArrayRef<double> defaultValue) {
bool SmartDashboard::SetDefaultNumberArray(wpi::StringRef key,
wpi::ArrayRef<double> defaultValue) {
return Singleton::GetInstance().table->GetEntry(key).SetDefaultDoubleArray(
defaultValue);
}

View File

@@ -34,9 +34,8 @@ Solenoid::Solenoid(int channel)
Solenoid::Solenoid(int moduleNumber, int channel)
: SolenoidBase(moduleNumber), m_channel(channel) {
if (!SensorBase::CheckSolenoidModule(m_moduleNumber)) {
wpi_setWPIErrorWithContext(
ModuleIndexOutOfRange,
"Solenoid Module " + wpi::Twine(m_moduleNumber));
wpi_setWPIErrorWithContext(ModuleIndexOutOfRange,
"Solenoid Module " + wpi::Twine(m_moduleNumber));
return;
}
if (!SensorBase::CheckSolenoidChannel(m_channel)) {

View File

@@ -127,9 +127,8 @@ bool wpi_assertEqual_impl(int valueA, int valueB,
bool wpi_assertNotEqual_impl(int valueA, int valueB,
const wpi::Twine& valueAString,
const wpi::Twine& valueBString,
const wpi::Twine& message,
wpi::StringRef fileName, int lineNumber,
wpi::StringRef funcName) {
const wpi::Twine& message, wpi::StringRef fileName,
int lineNumber, wpi::StringRef funcName) {
if (!(valueA != valueB)) {
wpi_assertEqual_common_impl(valueAString, valueBString, "!=", message,
fileName, lineNumber, funcName);