From 8a2b5c1ac2fc07e280dc678165d2ca58f7d07e32 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 6 Feb 2015 23:58:10 +0200 Subject: [PATCH] Cosmetic fixes --- source/libr2c2/signal.cpp | 2 +- source/libr2c2/timetable.cpp | 5 ++--- source/libr2c2/timetable.h | 2 +- source/libr2c2/trainrouteplanner.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/libr2c2/signal.cpp b/source/libr2c2/signal.cpp index 3ec1623..7aa9994 100644 --- a/source/libr2c2/signal.cpp +++ b/source/libr2c2/signal.cpp @@ -112,7 +112,7 @@ void Signal::tick(const Time::TimeDelta &) { if(iter->get_sensor_address()) ++n_blocks; - iter=iter.next(); + iter = iter.next(); } check_allocated_blocks = false; diff --git a/source/libr2c2/timetable.cpp b/source/libr2c2/timetable.cpp index 7ce8127..2fadcd5 100644 --- a/source/libr2c2/timetable.cpp +++ b/source/libr2c2/timetable.cpp @@ -116,7 +116,7 @@ void Timetable::save(list &st) const } } -void Timetable::check_update(list::const_iterator i) +void Timetable::check_update(const list::const_iterator &i) { for(list::const_iterator j=current_row; (j!=rows.end() && j!=i); ++j) if(j->type==ARRIVE) @@ -186,8 +186,7 @@ void Timetable::update_route() Time::TimeDelta dt = i->time-clock.get_current_time(); while(dttype==THROUGH) train.ai_message(Message("add-waypoint", i->target)); diff --git a/source/libr2c2/timetable.h b/source/libr2c2/timetable.h index 3385a8e..9ec804e 100644 --- a/source/libr2c2/timetable.h +++ b/source/libr2c2/timetable.h @@ -91,7 +91,7 @@ public: void save(std::list &) const; private: - void check_update(std::list::const_iterator); + void check_update(const std::list::const_iterator &); std::list::iterator find_trip(const std::list::iterator &, std::list::iterator *); void update_route(); void event(TrainAI &, const Message &); diff --git a/source/libr2c2/trainrouteplanner.h b/source/libr2c2/trainrouteplanner.h index 0ed2e11..34dcce6 100644 --- a/source/libr2c2/trainrouteplanner.h +++ b/source/libr2c2/trainrouteplanner.h @@ -147,7 +147,7 @@ public: Result plan(); void plan_async(); Result check(); - Result get_result() { return result; } + Result get_result() const { return result; } const std::list &get_routes_for(const Train &) const; const std::list &get_sequence_for(const Train &) const; private: -- 2.45.2