summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-01-11 10:34:42 +0000
committerKUDr <KUDr@openttd.org>2007-01-11 10:34:42 +0000
commit8553b0dad5d9bc71835270dd098061a392f2ee93 (patch)
treeec4aeac562589ab6f2c903d683ecb3834ea9003d /src/rail.h
parentb71fa18db3aff54518e7900b80a73f58352676d5 (diff)
downloadopenttd-8553b0dad5d9bc71835270dd098061a392f2ee93.tar.xz
(svn r8052) - Codechange: RemoveFirstTrack() and RemoveFirstTrackdir() now accept pointer to TrackBits/TrackdirBits instead of reference.
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rail.h b/src/rail.h
index aaadc9060..0d2d850a1 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -250,11 +250,11 @@ static inline TrackdirBits TrackdirToTrackdirBits(Trackdir trackdir) { return (T
/**
* Removes first Track from TrackBits and returns it
*/
-static inline Track RemoveFirstTrack(TrackBits &tracks)
+static inline Track RemoveFirstTrack(TrackBits *tracks)
{
- if (tracks != TRACK_BIT_NONE && tracks != INVALID_TRACK_BIT) {
- Track first = (Track)FIND_FIRST_BIT(tracks);
- tracks = ClrBitT(tracks, first);
+ if (*tracks != TRACK_BIT_NONE && *tracks != INVALID_TRACK_BIT) {
+ Track first = (Track)FIND_FIRST_BIT(*tracks);
+ *tracks = ClrBitT(*tracks, first);
return first;
}
return INVALID_TRACK;
@@ -263,11 +263,11 @@ static inline Track RemoveFirstTrack(TrackBits &tracks)
/**
* Removes first Trackdir from TrackdirBits and returns it
*/
-static inline Trackdir RemoveFirstTrackdir(TrackdirBits &trackdirs)
+static inline Trackdir RemoveFirstTrackdir(TrackdirBits *trackdirs)
{
- if (trackdirs != TRACKDIR_BIT_NONE && trackdirs != INVALID_TRACKDIR_BIT) {
- Trackdir first = (Trackdir)FindFirstBit2x64(trackdirs);
- trackdirs = ClrBitT(trackdirs, first);
+ if (*trackdirs != TRACKDIR_BIT_NONE && *trackdirs != INVALID_TRACKDIR_BIT) {
+ Trackdir first = (Trackdir)FindFirstBit2x64(*trackdirs);
+ *trackdirs = ClrBitT(*trackdirs, first);
return first;
}
return INVALID_TRACKDIR;