Changeset - r20998:c047af70b5bc
[Not reviewed]
master
0 2 0
rubidium - 11 years ago 2013-11-23 18:13:30
rubidium@openttd.org
(svn r26072) -Cleanup: mark some unreachable default cases by NOT_REACHED()
2 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_list.cpp
Show inline comments
 
@@ -517,15 +517,13 @@ void ScriptList::Sort(SorterType sorter,
 
				this->sorter = new ScriptListSorterValueAscending(this);
 
			} else {
 
				this->sorter = new ScriptListSorterValueDescending(this);
 
			}
 
			break;
 

	
 
		default:
 
			this->Sort(SORT_BY_ITEM, false);
 
			return;
 
		default: NOT_REACHED();
 
	}
 
	this->sorter_type    = sorter;
 
	this->sort_ascending = ascending;
 
	this->initialized    = false;
 
}
 

	
 
@@ -638,12 +636,13 @@ void ScriptList::RemoveBottom(int32 coun
 
					/* When the last item is removed from the bucket, the bucket itself is removed.
 
					 * This means that the iterators can be invalid after a call to RemoveItem.
 
					 */
 
					if (--size == 0) break;
 
				}
 
			}
 
			break;
 

	
 
		case SORT_BY_ITEM:
 
			for (ScriptListMap::reverse_iterator iter = this->items.rbegin(); iter != this->items.rend(); iter = this->items.rbegin()) {
 
				if (--count < 0) return;
 
				this->RemoveItem((*iter).first);
 
			}
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -677,13 +677,13 @@ CommandCost CmdBuildTunnel(TileIndex sta
 
	cost.AddCost(_price[PR_BUILD_TUNNEL]);
 

	
 
	/* Pay for the rail/road in the tunnel including entrances */
 
	switch (transport_type) {
 
		case TRANSPORT_ROAD: cost.AddCost((tiles + 2) * _price[PR_BUILD_ROAD] * 2); break;
 
		case TRANSPORT_RAIL: cost.AddCost((tiles + 2) * RailBuildCost(railtype)); break;
 
		default: break;
 
		default: NOT_REACHED();
 
	}
 

	
 
	if (flags & DC_EXEC) {
 
		Company *c = Company::GetIfValid(company);
 
		uint num_pieces = (tiles + 2) * TUNNELBRIDGE_TRACKBIT_FACTOR;
 
		if (transport_type == TRANSPORT_RAIL) {
0 comments (0 inline, 0 general)