(svn r3564) Several smaller changes:

- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
This commit is contained in:
tron
2006-02-06 09:18:04 +00:00
parent 0755bbead0
commit 453b30e387
23 changed files with 218 additions and 212 deletions

6
rail.h
View File

@@ -635,9 +635,9 @@ static inline bool TracksOverlap(TrackBits bits)
/* We know that there are at least two tracks present. When there are more
* than 2 tracks, they will surely overlap. When there are two, they will
* always overlap unless they are lower & upper or right & left. */
if ((bits == (TRACK_BIT_UPPER|TRACK_BIT_LOWER)) || (bits == (TRACK_BIT_LEFT | TRACK_BIT_RIGHT)))
return false;
return true;
return
bits != (TRACK_BIT_UPPER | TRACK_BIT_LOWER) &&
bits != (TRACK_BIT_LEFT | TRACK_BIT_RIGHT);
}
void DrawTrainDepotSprite(int x, int y, int image, RailType railtype);