summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-11-04 23:06:39 +0000
committertruelight <truelight@openttd.org>2007-11-04 23:06:39 +0000
commit4b8aaa994c3f79ba360bc2e3535f7319b09ef0a9 (patch)
treeb50a237674dc49109595b0832ab58f70e3f9af9c /src/yapf
parent69b1d97c0348229bf1ff14a672d7e50aa3d9eb3f (diff)
downloadopenttd-4b8aaa994c3f79ba360bc2e3535f7319b09ef0a9.tar.xz
(svn r11383) -Codechange: fixed all the mess around KillFirstBit (tnx to Rubidium and skidd13)
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/yapf_base.hpp4
-rw-r--r--src/yapf/yapf_common.hpp4
-rw-r--r--src/yapf/yapf_costrail.hpp2
-rw-r--r--src/yapf/yapf_road.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/yapf/yapf_base.hpp b/src/yapf/yapf_base.hpp
index 43dd1793b..c3ab93c72 100644
--- a/src/yapf/yapf_base.hpp
+++ b/src/yapf/yapf_base.hpp
@@ -192,8 +192,8 @@ public:
/** add multiple nodes - direct children of the given node */
FORCEINLINE void AddMultipleNodes(Node* parent, const TrackFollower &tf)
{
- bool is_choice = (KillFirstBit2x64(tf.m_new_td_bits) != 0);
- for (TrackdirBits rtds = tf.m_new_td_bits; rtds != TRACKDIR_BIT_NONE; rtds = (TrackdirBits)KillFirstBit2x64(rtds)) {
+ bool is_choice = (KillFirstBit(tf.m_new_td_bits) != TRACKDIR_BIT_NONE);
+ for (TrackdirBits rtds = tf.m_new_td_bits; rtds != TRACKDIR_BIT_NONE; rtds = KillFirstBit(rtds)) {
Trackdir td = (Trackdir)FindFirstBit2x64(rtds);
Node& n = Yapf().CreateNewNode();
n.Set(parent, tf.m_new_tile, td, is_choice);
diff --git a/src/yapf/yapf_common.hpp b/src/yapf/yapf_common.hpp
index 8c5257e94..b507ceb9e 100644
--- a/src/yapf/yapf_common.hpp
+++ b/src/yapf/yapf_common.hpp
@@ -32,8 +32,8 @@ public:
/// Called when YAPF needs to place origin nodes into open list
void PfSetStartupNodes()
{
- bool is_choice = (KillFirstBit2x64(m_orgTrackdirs) != 0);
- for (TrackdirBits tdb = m_orgTrackdirs; tdb != TRACKDIR_BIT_NONE; tdb = (TrackdirBits)KillFirstBit2x64(tdb)) {
+ bool is_choice = (KillFirstBit(m_orgTrackdirs) != TRACKDIR_BIT_NONE);
+ for (TrackdirBits tdb = m_orgTrackdirs; tdb != TRACKDIR_BIT_NONE; tdb = KillFirstBit(tdb)) {
Trackdir td = (Trackdir)FindFirstBit2x64(tdb);
Node& n1 = Yapf().CreateNewNode();
n1.Set(NULL, m_orgTile, td, is_choice);
diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp
index 3b57fe328..5756f0467 100644
--- a/src/yapf/yapf_costrail.hpp
+++ b/src/yapf/yapf_costrail.hpp
@@ -387,7 +387,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
}
/* Check if the next tile is not a choice. */
- if (KillFirstBit2x64(tf_local.m_new_td_bits) != 0) {
+ if (KillFirstBit(tf_local.m_new_td_bits) != TRACKDIR_BIT_NONE) {
/* More than one segment will follow. Close this one. */
end_segment_reason |= ESRB_CHOICE_FOLLOWS;
break;
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index 99bde7fdb..e07b48d60 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -97,7 +97,7 @@ public:
if (!F.Follow(tile, trackdir)) break;
// if there are more trackdirs available & reachable, we are at the end of segment
- if (KillFirstBit2x64(F.m_new_td_bits) != 0) break;
+ if (KillFirstBit(F.m_new_td_bits) != TRACKDIR_BIT_NONE) break;
Trackdir new_td = (Trackdir)FindFirstBit2x64(F.m_new_td_bits);