Changeset - r27420:b37b70eb3169
[Not reviewed]
master
0 2 0
Peter Nelson - 19 months ago 2023-05-04 09:39:22
peter1138@openttd.org
Codechange: Rename IsCargo..Valid to IsValidCargo..

This better fits our naming pattern for this type of function.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/cargo_type.h
Show inline comments
 
@@ -70,9 +70,9 @@ enum CargoType {
 
};
 

	
 
/** Test whether cargo type is not CT_INVALID */
 
inline bool IsCargoTypeValid(CargoType t) { return t != CT_INVALID; }
 
inline bool IsValidCargoType(CargoType t) { return t != CT_INVALID; }
 
/** Test whether cargo type is not CT_INVALID */
 
inline bool IsCargoIDValid(CargoID t) { return t != CT_INVALID; }
 
inline bool IsValidCargoID(CargoID t) { return t != CT_INVALID; }
 

	
 
typedef uint64 CargoTypes;
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -2527,8 +2527,8 @@ struct IndustryCargoesWindow : public Wi
 
			const IndustrySpec *indsp = GetIndustrySpec(it);
 
			if (!indsp->enabled) continue;
 
			this->ind_textsize = maxdim(this->ind_textsize, GetStringBoundingBox(indsp->name));
 
			CargoesField::max_cargoes = std::max<uint>(CargoesField::max_cargoes, std::count_if(indsp->accepts_cargo, endof(indsp->accepts_cargo), IsCargoIDValid));
 
			CargoesField::max_cargoes = std::max<uint>(CargoesField::max_cargoes, std::count_if(indsp->produced_cargo, endof(indsp->produced_cargo), IsCargoIDValid));
 
			CargoesField::max_cargoes = std::max<uint>(CargoesField::max_cargoes, std::count_if(indsp->accepts_cargo, endof(indsp->accepts_cargo), IsValidCargoID));
 
			CargoesField::max_cargoes = std::max<uint>(CargoesField::max_cargoes, std::count_if(indsp->produced_cargo, endof(indsp->produced_cargo), IsValidCargoID));
 
		}
 
		d.width = std::max(d.width, this->ind_textsize.width);
 
		d.height = this->ind_textsize.height;
0 comments (0 inline, 0 general)