Replace std::stringstream with llvm::raw_svector_ostream (#345)

A few locations were changed to use std::ostringstream.
This commit is contained in:
Tyler Veness
2017-05-15 23:10:40 -07:00
committed by Peter Johnson
parent 7006672b06
commit b433d98c02
39 changed files with 242 additions and 174 deletions

View File

@@ -7,12 +7,12 @@
#include "MotorSafetyHelper.h"
#include <sstream>
#include "DriverStation.h"
#include "MotorSafety.h"
#include "Timer.h"
#include "WPIErrors.h"
#include "llvm/SmallString.h"
#include "llvm/raw_ostream.h"
using namespace frc;
@@ -95,10 +95,11 @@ void MotorSafetyHelper::Check() {
std::lock_guard<hal::priority_recursive_mutex> sync(m_syncMutex);
if (m_stopTime < Timer::GetFPGATimestamp()) {
std::ostringstream desc;
llvm::SmallString<128> buf;
llvm::raw_svector_ostream desc(buf);
m_safeObject->GetDescription(desc);
desc << "... Output not updated often enough.";
wpi_setWPIErrorWithContext(Timeout, desc.str().c_str());
wpi_setWPIErrorWithContext(Timeout, desc.str());
m_safeObject->StopMotor();
}
}