summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/signal.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/signal.cpp b/src/signal.cpp
index 068ca6193..9b17e51dc 100644
--- a/src/signal.cpp
+++ b/src/signal.cpp
@@ -268,10 +268,10 @@ static SigFlags ExploreSegment(Owner owner)
{
SigFlags flags = SF_NONE;
- TileIndex tile;
- DiagDirection enterdir;
+ TileIndex tile = INVALID_TILE; // Stop GCC from complaining about a possibly uninitialized variable (issue #8280).
+ DiagDirection enterdir = INVALID_DIAGDIR;
- while (_tbdset.Get(&tile, &enterdir)) {
+ while (_tbdset.Get(&tile, &enterdir)) { // tile and enterdir are initialized here, unless I'm mistaken.
TileIndex oldtile = tile; // tile we are leaving
DiagDirection exitdir = enterdir == INVALID_DIAGDIR ? INVALID_DIAGDIR : ReverseDiagDir(enterdir); // expected new exit direction (for straight line)
@@ -407,8 +407,8 @@ static SigFlags ExploreSegment(Owner owner)
*/
static void UpdateSignalsAroundSegment(SigFlags flags)
{
- TileIndex tile;
- Trackdir trackdir;
+ TileIndex tile = INVALID_TILE; // Stop GCC from complaining about a possibly uninitialized variable (issue #8280).
+ Trackdir trackdir = INVALID_TRACKDIR;
while (_tbuset.Get(&tile, &trackdir)) {
assert(HasSignalOnTrackdir(tile, trackdir));
@@ -474,8 +474,8 @@ static SigSegState UpdateSignalsInBuffer(Owner owner)
bool first = true; // first block?
SigSegState state = SIGSEG_FREE; // value to return
- TileIndex tile;
- DiagDirection dir;
+ TileIndex tile = INVALID_TILE; // Stop GCC from complaining about a possibly uninitialized variable (issue #8280).
+ DiagDirection dir = INVALID_DIAGDIR;
while (_globset.Get(&tile, &dir)) {
assert(_tbuset.IsEmpty());