(svn r3078) Some more stuff, which piled up:

- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
This commit is contained in:
tron
2005-10-23 13:04:44 +00:00
parent 2cc2154ad2
commit 47137cefb7
38 changed files with 442 additions and 453 deletions

8
tile.c
View File

@@ -41,10 +41,10 @@ uint GetTileSlope(TileIndex tile, uint *h)
if (min >= d) min = d;
r = 0;
if ((a -= min) != 0) { r += (--a << 4) + 8; }
if ((c -= min) != 0) { r += (--c << 4) + 4; }
if ((d -= min) != 0) { r += (--d << 4) + 2; }
if ((b -= min) != 0) { r += (--b << 4) + 1; }
if ((a -= min) != 0) r += (--a << 4) + 8;
if ((c -= min) != 0) r += (--c << 4) + 4;
if ((d -= min) != 0) r += (--d << 4) + 2;
if ((b -= min) != 0) r += (--b << 4) + 1;
if (h != NULL)
*h = min * 8;