Skip to content

Commit

Permalink
use specific stringstream types
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios authored and CelticMinstrel committed Jul 28, 2024
1 parent 6d2e8a8 commit b7692c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/game/boe.actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/boe.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/game/boe.startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
using std::vector;

#include <sstream>
using std::stringstream;

extern bool party_in_memory;
extern long register_flag;
Expand All @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions test/replay_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b7692c2

Please sign in to comment.