(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
--- a/src/cargopacket.cpp Fri Jun 27 16:16:35 2008 +0000
+++ b/src/cargopacket.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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 Fri Jun 27 16:16:35 2008 +0000
+++ b/src/economy.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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 Fri Jun 27 16:16:35 2008 +0000
+++ b/src/genworld_gui.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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 Fri Jun 27 16:16:35 2008 +0000
+++ b/src/newgrf_industries.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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 Fri Jun 27 16:16:35 2008 +0000
+++ b/src/roadveh_cmd.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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 Fri Jun 27 16:16:35 2008 +0000
+++ b/src/timetable_gui.cpp Fri Jun 27 17:46:43 2008 +0000
@@ -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));
}