use specific stringstream types
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@
|
||||
using std::vector;
|
||||
|
||||
#include <sstream>
|
||||
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());
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user