From b5e467978b70884033d8e25a4a9738cc17699e4e Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 14 Oct 2008 18:38:51 +0000 Subject: (svn r14464) -Codechange: replace (uint)-1 with UINT_MAX (PhilSophus) --- src/npf.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/npf.cpp') 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 */ -- cgit v1.2.3-54-g00ecf