]> git.tdb.fi Git - r2c2.git/commitdiff
Cosmetic fixes
authorMikko Rasa <tdb@tdb.fi>
Fri, 6 Feb 2015 21:58:10 +0000 (23:58 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 6 Feb 2015 21:59:02 +0000 (23:59 +0200)
source/libr2c2/signal.cpp
source/libr2c2/timetable.cpp
source/libr2c2/timetable.h
source/libr2c2/trainrouteplanner.h

index 3ec1623bf4249f5f652ed39a890568c57bbfa36d..7aa999438055f4fa31fd6d73ee052f556eeab9ef 100644 (file)
@@ -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;
 
index 7ce8127d433b7995a6b9ff91aa9f1f0f53909f60..2fadcd54b4f55d210b7c3bee6eab58a382f2f4e0 100644 (file)
@@ -116,7 +116,7 @@ void Timetable::save(list<DataFile::Statement> &st) const
        }
 }
 
-void Timetable::check_update(list<Row>::const_iterator i)
+void Timetable::check_update(const list<Row>::const_iterator &i)
 {
        for(list<Row>::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(dt<Time::zero)
                                dt += Time::day;
-                       dt /= clock.get_rate();
-                       train.ai_message(Message("set-departure-delay", dt));
+                       train.ai_message(Message("set-departure-delay", dt/clock.get_rate()));
                }
                else if(i->type==THROUGH)
                        train.ai_message(Message("add-waypoint", i->target));
index 3385a8eeaf97de6a3142d868a436d01d0125f22e..9ec804e0692d02834c72fa2de50bdb4fc6f0c795 100644 (file)
@@ -91,7 +91,7 @@ public:
        void save(std::list<Msp::DataFile::Statement> &) const;
 
 private:
-       void check_update(std::list<Row>::const_iterator);
+       void check_update(const std::list<Row>::const_iterator &);
        std::list<Row>::iterator find_trip(const std::list<Row>::iterator &, std::list<Row>::iterator *);
        void update_route();
        void event(TrainAI &, const Message &);
index 0ed2e118e7bb4e5ef503769f7ef3c765848752e2..34dcce69daeddb8a5f8d20255497eca8a453fcef 100644 (file)
@@ -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<Route *> &get_routes_for(const Train &) const;
        const std::list<TrainRouter::SequencePoint> &get_sequence_for(const Train &) const;
 private: