Mercurial > hg > openttd
changeset 9605:9ea90d50b73c draft
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
author | skidd13 <skidd13@openttd.org> |
---|---|
date | Fri, 27 Jun 2008 17:46:43 +0000 |
parents | 55cf78e96365 |
children | 6cc951d7af12 |
files | src/cargopacket.cpp src/economy.cpp src/genworld_gui.cpp src/newgrf_industries.cpp src/roadveh_cmd.cpp src/timetable_gui.cpp |
diffstat | 6 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -242,7 +242,7 @@ if (mta == MTA_FINAL_DELIVERY && !tmp.Empty()) { /* There are some packets that could not be delivered at the station, put them back */ - tmp.MoveTo(this, MAX_UVALUE(uint)); + tmp.MoveTo(this, UINT_MAX); tmp.packets.clear(); }
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -324,7 +324,7 @@ * removing his/her property doesn't fail because of lack of money. * Not too drastically though, because it could overflow */ if (new_player == PLAYER_SPECTATOR) { - GetPlayer(old_player)->player_money = MAX_UVALUE(uint64) >> 2; // jackpot ;p + GetPlayer(old_player)->player_money = UINT64_MAX >> 2; // jackpot ;p } if (new_player == PLAYER_SPECTATOR) {
--- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -473,11 +473,11 @@ EventState state; this->HandleEditBoxKey(GLAND_RANDOM_EDITBOX, key, keycode, state); /* the seed is unsigned, therefore atoi cannot be used. - * As 2^32 - 1 (MAX_UVALUE(uint32)) is a 'magic' value + * As 2^32 - 1 (UINT32_MAX) is a 'magic' value * (use random seed) it should not be possible to be * entered into the input field; the generate seed * button can be used instead. */ - _settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), MAX_UVALUE(uint32) - 1); + _settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1); return state; }
--- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -135,7 +135,7 @@ static uint32 GetClosestIndustry(TileIndex tile, IndustryType type, const Industry *current) { - uint32 best_dist = MAX_UVALUE(uint32); + uint32 best_dist = UINT32_MAX; const Industry *i; FOR_ALL_INDUSTRIES(i) { if (i->type != type || i == current) continue; @@ -158,7 +158,7 @@ { uint32 GrfID = GetRegister(0x100); ///< Get the GRFID of the definition to look for in register 100h IndustryType ind_index; - uint32 closest_dist = MAX_UVALUE(uint32); + uint32 closest_dist = UINT32_MAX; byte count = 0; /* Determine what will be the industry type to look for */
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -727,7 +727,7 @@ TileIndex dest = INVALID_TILE; const RoadStop *rs = GetStation(station)->GetPrimaryRoadStop(this); if (rs != NULL) { - uint mindist = MAX_UVALUE(uint); + uint mindist = UINT_MAX; for (; rs != NULL; rs = rs->GetNextRoadStop(this)) { uint dist = DistanceManhattan(this->tile, rs->xy);
--- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -261,7 +261,7 @@ uint64 time = StrEmpty(str) ? 0 : strtoul(str, NULL, 10); if (!_settings_client.gui.timetable_in_ticks) time *= DAY_TICKS; - uint32 p2 = minu(time, MAX_UVALUE(uint16)); + uint32 p2 = minu(time, UINT16_MAX); DoCommandP(0, p1, p2, NULL, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE)); }