diff options
author | rubidium <rubidium@openttd.org> | 2008-10-14 18:38:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-10-14 18:38:51 +0000 |
commit | 272b2ef0e9072c6bf2ee3083c3673ae7773462ab (patch) | |
tree | a41b987e5fdc223ac9abf159f9ee753f07f2234d /src/npf.cpp | |
parent | 03bef3fb5b1c25cc887d51e13fd81c7c5129028b (diff) | |
download | openttd-272b2ef0e9072c6bf2ee3083c3673ae7773462ab.tar.xz |
(svn r14464) -Codechange: replace (uint)-1 with UINT_MAX (PhilSophus)
Diffstat (limited to 'src/npf.cpp')
-rw-r--r-- | src/npf.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/npf.cpp b/src/npf.cpp index 7721ceebf..440c1cf49 100644 --- a/src/npf.cpp +++ b/src/npf.cpp @@ -910,8 +910,8 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, bool ignore_start } /* Initialize result */ - result.best_bird_dist = (uint)-1; - result.best_path_dist = (uint)-1; + result.best_bird_dist = UINT_MAX; + result.best_path_dist = UINT_MAX; result.best_trackdir = INVALID_TRACKDIR; result.node.tile = INVALID_TILE; result.res_okay = false; @@ -1000,7 +1000,7 @@ NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, */ Queue depots; int r; - NPFFoundTargetData best_result = {(uint)-1, (uint)-1, INVALID_TRACKDIR, {INVALID_TILE, 0, {0, 0}}, false}; + NPFFoundTargetData best_result = {UINT_MAX, UINT_MAX, INVALID_TRACKDIR, {INVALID_TILE, 0, {0, 0}}, false}; NPFFoundTargetData result; NPFFindStationOrTileData target; AyStarNode start; @@ -1046,8 +1046,8 @@ NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, /* Initialize Result */ _npf_aystar.user_path = &result; - best_result.best_path_dist = (uint)-1; - best_result.best_bird_dist = (uint)-1; + best_result.best_path_dist = UINT_MAX; + best_result.best_bird_dist = UINT_MAX; /* Just iterate the depots in order of increasing distance */ while ((current = (Depot*)depots.pop(&depots))) { @@ -1067,8 +1067,8 @@ NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, _npf_aystar.addstart(&_npf_aystar, &start, 0); /* Initialize result */ - result.best_bird_dist = (uint)-1; - result.best_path_dist = (uint)-1; + result.best_bird_dist = UINT_MAX; + result.best_path_dist = UINT_MAX; result.best_trackdir = INVALID_TRACKDIR; /* Initialize target */ |