Use std::istringstream or std::ostringstream instead of std::stringstream where possible.

This removes std::iostream from the inheritance chain, which reduces
overhead slightly.
This commit is contained in:
David Korth 2019-09-14 16:40:34 -04:00
commit c2dd2e8a2e
14 changed files with 20 additions and 20 deletions

View file

@ -307,7 +307,7 @@ static void RunSIBuffer(u64 user_data, s64 cycles_late)
s_com_csr.CHANNEL, request_length, expected_response_length, actual_response_length);
if (expected_response_length != actual_response_length)
{
std::stringstream ss;
std::ostringstream ss;
for (u8 b : request_copy)
{
ss << std::hex << std::setw(2) << std::setfill('0') << (int)b << ' ';

View file

@ -512,7 +512,7 @@ void BluetoothReal::LoadLinkKeys()
for (size_t i = 0; i < key_string.length(); i = i + 2)
{
int value;
std::stringstream(key_string.substr(i, 2)) >> std::hex >> value;
std::istringstream(key_string.substr(i, 2)) >> std::hex >> value;
key[pos++] = value;
}

View file

@ -18,7 +18,7 @@ namespace IOS::HLE::Device
{
static void GetVidPidFromDevicePath(const std::string& device_path, u16& vid, u16& pid)
{
std::stringstream stream{device_path};
std::istringstream stream{device_path};
std::string segment;
std::vector<std::string> list;
while (std::getline(stream, segment, '/'))

View file

@ -50,7 +50,7 @@ void MemoryWatcher::ParseLine(const std::string& line)
m_values[line] = 0;
m_addresses[line] = std::vector<u32>();
std::stringstream offsets(line);
std::istringstream offsets(line);
offsets >> std::hex;
u32 offset;
while (offsets >> offset)
@ -76,7 +76,7 @@ u32 MemoryWatcher::ChasePointer(const std::string& line)
std::string MemoryWatcher::ComposeMessages()
{
std::stringstream message_stream;
std::ostringstream message_stream;
message_stream << std::hex;
for (auto& entry : m_values)

View file

@ -185,7 +185,7 @@ std::string GetRTCDisplay()
const time_t current_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
const tm* const gm_time = gmtime(&current_time);
std::stringstream format_time;
std::ostringstream format_time;
format_time << std::put_time(gm_time, "Date/Time: %c\n");
return format_time.str();
}

View file

@ -37,7 +37,7 @@ BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const
{
if (!bp.is_temporary)
{
std::stringstream ss;
std::ostringstream ss;
ss << std::hex << bp.address << " " << (bp.is_enabled ? "n" : "");
bp_strings.push_back(ss.str());
}
@ -130,7 +130,7 @@ MemChecks::TMemChecksStr MemChecks::GetStrings() const
TMemChecksStr mc_strings;
for (const TMemCheck& mc : m_mem_checks)
{
std::stringstream ss;
std::ostringstream ss;
ss << std::hex << mc.start_address;
ss << " " << (mc.is_ranged ? mc.end_address : mc.start_address) << " "
<< (mc.is_ranged ? "n" : "") << (mc.is_break_on_read ? "r" : "")

View file

@ -1193,7 +1193,7 @@ void LogGeneratedX86(size_t size, const PPCAnalyst::CodeBuffer& code_buffer, con
if (b->codeSize <= 250)
{
std::stringstream ss;
std::ostringstream ss;
ss << std::hex;
for (u8 i = 0; i <= b->codeSize; i++)
{