Changeset - r9605:6debaf923fba
[Not reviewed]
master
0 6 0
skidd13 - 16 years ago 2008-06-27 17:46:43
skidd13@openttd.org
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
6 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -242,7 +242,7 @@ bool CargoList::MoveTo(CargoList *dest, 
 

	
 
	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();
 
	}
 

	
src/economy.cpp
Show inline comments
 
@@ -324,7 +324,7 @@ void ChangeOwnershipOfPlayerItems(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) {
src/genworld_gui.cpp
Show inline comments
 
@@ -473,11 +473,11 @@ struct GenerateLandscapeWindow : public 
 
		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;
 
	}
 

	
src/newgrf_industries.cpp
Show inline comments
 
@@ -135,7 +135,7 @@ uint32 GetIndustryIDAtOffset(TileIndex t
 

	
 
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 GetCountAndDistanceOfClose
 
{
 
	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 */
src/roadveh_cmd.cpp
Show inline comments
 
@@ -727,7 +727,7 @@ TileIndex RoadVehicle::GetOrderStationLo
 
	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);
src/timetable_gui.cpp
Show inline comments
 
@@ -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));
 
	}
0 comments (0 inline, 0 general)