(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant

pull/155/head
skidd13 16 years ago
parent 54333f5f06
commit 0a178274e2

@ -242,7 +242,7 @@ bool CargoList::MoveTo(CargoList *dest, uint count, CargoList::MoveToAction mta,
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();
}

@ -324,7 +324,7 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
* 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) {

@ -473,11 +473,11 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
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;
}

@ -135,7 +135,7 @@ uint32 GetIndustryIDAtOffset(TileIndex tile, const Industry *i)
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 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
{
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 */

@ -727,7 +727,7 @@ TileIndex RoadVehicle::GetOrderStationLocation(StationID station)
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);

@ -261,7 +261,7 @@ struct TimetableWindow : Window {
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));
}

Loading…
Cancel
Save