summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-23 18:13:30 +0000
committerrubidium <rubidium@openttd.org>2013-11-23 18:13:30 +0000
commitbe6b64f4e65bfa7b866ad2fbe9518e6f23d75045 (patch)
tree69dab54dace1dec284f72b1429e382d73b655d75
parent729d64d8d95a1f4fe37ff2f94e4e5aa05fb405f9 (diff)
downloadopenttd-be6b64f4e65bfa7b866ad2fbe9518e6f23d75045.tar.xz
(svn r26072) -Cleanup: mark some unreachable default cases by NOT_REACHED()
-rw-r--r--src/script/api/script_list.cpp5
-rw-r--r--src/tunnelbridge_cmd.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp
index 353d25d3e..68df5bf95 100644
--- a/src/script/api/script_list.cpp
+++ b/src/script/api/script_list.cpp
@@ -520,9 +520,7 @@ void ScriptList::Sort(SorterType sorter, bool ascending)
}
break;
- default:
- this->Sort(SORT_BY_ITEM, false);
- return;
+ default: NOT_REACHED();
}
this->sorter_type = sorter;
this->sort_ascending = ascending;
@@ -641,6 +639,7 @@ void ScriptList::RemoveBottom(int32 count)
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()) {
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index b0a4c6ad8..d3f584711 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -680,7 +680,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
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) {