From b7692c2fa69496049113bba478fa58537e9bf3be Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 27 Jul 2024 16:04:09 -0500 Subject: [PATCH] use specific stringstream types --- src/game/boe.actions.cpp | 2 +- src/game/boe.main.cpp | 2 +- src/game/boe.startup.cpp | 3 +-- test/replay_parse.cpp | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index de830940d..2d24905a8 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -502,7 +502,7 @@ static void handle_look(location destination, bool& need_redraw, bool& need_repr void handle_move(location destination, bool& did_something, bool& need_redraw, bool& need_reprint) { if(recording) { // record the action - std::stringstream out; + std::ostringstream out; out << destination; record_action("move", out.str()); } diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 01fe296f7..9fbcf3435 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -269,7 +269,7 @@ void replay_next_action() { finish_load_party(); }else if(t == "move"){ location l; - std::stringstream sstr(next_action->GetText()); + std::istringstream sstr(next_action->GetText()); sstr >> l; handle_move(l, did_something, need_redraw, need_reprint); } diff --git a/src/game/boe.startup.cpp b/src/game/boe.startup.cpp index bfe408396..946aeeefd 100644 --- a/src/game/boe.startup.cpp +++ b/src/game/boe.startup.cpp @@ -30,7 +30,6 @@ using std::vector; #include -using std::stringstream; extern bool party_in_memory; extern long register_flag; @@ -43,7 +42,7 @@ enum_map(eStartButton, rectangle) startup_button; void handle_startup_button_click(eStartButton btn) { if(recording){ - stringstream sstr; + std::ostringstream sstr; sstr << btn; record_action("startup_button_click", sstr.str()); } diff --git a/test/replay_parse.cpp b/test/replay_parse.cpp index 3f3b0186d..8e7195df8 100644 --- a/test/replay_parse.cpp +++ b/test/replay_parse.cpp @@ -6,13 +6,13 @@ TEST_CASE("Parsing and stringifying locations") { SECTION("Stringifying") { location l(27, 923); - std::stringstream out; + std::ostringstream out; out << l; CHECK(out.str() == "(27,923)"); } SECTION("Parsing") { location l; - std::stringstream in("(27,923)"); + std::istringstream in("(27,923)"); in >> l; CHECK(l.x == 27); CHECK(l.y == 923);