Changeset - r23969:2ae654a80e80
[Not reviewed]
master
0 3 0
glx - 5 years ago 2019-12-17 18:11:24
glx@openttd.org
Codechange: Replace FOR_ALL_ROADSTOPS with range-based for loops
3 files changed with 5 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/openttd.cpp
Show inline comments
 
@@ -1221,8 +1221,7 @@ static void CheckCaches()
 
	}
 

	
 
	/* Strict checking of the road stop cache entries */
 
	const RoadStop *rs;
 
	FOR_ALL_ROADSTOPS(rs) {
 
	for (const RoadStop *rs : RoadStop::Iterate()) {
 
		if (IsStandardRoadStopTile(rs->xy)) continue;
 

	
 
		assert(rs->GetEntry(DIAGDIR_NE) != rs->GetEntry(DIAGDIR_NW));
src/roadstop_base.h
Show inline comments
 
@@ -188,7 +188,4 @@ private:
 
	}
 
};
 

	
 
#define FOR_ALL_ROADSTOPS_FROM(var, start) FOR_ALL_ITEMS_FROM(RoadStop, roadstop_index, var, start)
 
#define FOR_ALL_ROADSTOPS(var) FOR_ALL_ROADSTOPS_FROM(var, 0)
 

	
 
#endif /* ROADSTOP_BASE_H */
src/saveload/station_sl.cpp
Show inline comments
 
@@ -129,12 +129,11 @@ void AfterLoadStations()
 
void AfterLoadRoadStops()
 
{
 
	/* First construct the drive through entries */
 
	RoadStop *rs;
 
	FOR_ALL_ROADSTOPS(rs) {
 
	for (RoadStop *rs : RoadStop::Iterate()) {
 
		if (IsDriveThroughStopTile(rs->xy)) rs->MakeDriveThrough();
 
	}
 
	/* And then rebuild the data in those entries */
 
	FOR_ALL_ROADSTOPS(rs) {
 
	for (RoadStop *rs : RoadStop::Iterate()) {
 
		if (!HasBit(rs->status, RoadStop::RSSFB_BASE_ENTRY)) continue;
 

	
 
		rs->GetEntry(DIAGDIR_NE)->Rebuild(rs);
 
@@ -606,9 +605,7 @@ static void Ptrs_STNN()
 

	
 
static void Save_ROADSTOP()
 
{
 
	RoadStop *rs;
 

	
 
	FOR_ALL_ROADSTOPS(rs) {
 
	for (RoadStop *rs : RoadStop::Iterate()) {
 
		SlSetArrayIndex(rs->index);
 
		SlObject(rs, _roadstop_desc);
 
	}
 
@@ -627,8 +624,7 @@ static void Load_ROADSTOP()
 

	
 
static void Ptrs_ROADSTOP()
 
{
 
	RoadStop *rs;
 
	FOR_ALL_ROADSTOPS(rs) {
 
	for (RoadStop *rs : RoadStop::Iterate()) {
 
		SlObject(rs, _roadstop_desc);
 
	}
 
}
0 comments (0 inline, 0 general)