mirror of https://github.com/OpenTTD/OpenTTD
(svn r16853) -Codechange: make CargoSpec const at two places
parent
77d13eae61
commit
f16314d0cc
|
@ -56,7 +56,7 @@ void SetupCargoForClimate(LandscapeID l)
|
||||||
|
|
||||||
CargoID GetCargoIDByLabel(CargoLabel cl)
|
CargoID GetCargoIDByLabel(CargoLabel cl)
|
||||||
{
|
{
|
||||||
CargoSpec *cs;
|
const CargoSpec *cs;
|
||||||
FOR_ALL_CARGOSPECS(cs) {
|
FOR_ALL_CARGOSPECS(cs) {
|
||||||
if (cs->label == cl) return cs->Index();
|
if (cs->label == cl) return cs->Index();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ CargoID GetCargoIDByBitnum(uint8 bitnum)
|
||||||
{
|
{
|
||||||
if (bitnum == INVALID_CARGO) return CT_INVALID;
|
if (bitnum == INVALID_CARGO) return CT_INVALID;
|
||||||
|
|
||||||
CargoSpec *cs;
|
const CargoSpec *cs;
|
||||||
FOR_ALL_CARGOSPECS(cs) {
|
FOR_ALL_CARGOSPECS(cs) {
|
||||||
if (cs->bitnum == bitnum) return cs->Index();
|
if (cs->bitnum == bitnum) return cs->Index();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ struct CargoSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Total number of subsidies, both valid and invalid
|
* Total number of cargospecs, both valid and invalid
|
||||||
* @return length of Subsidy::array
|
* @return length of CargoSpec::array
|
||||||
*/
|
*/
|
||||||
static FORCEINLINE size_t GetArraySize()
|
static FORCEINLINE size_t GetArraySize()
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ struct CargoSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static CargoSpec array[NUM_CARGO];
|
static CargoSpec array[NUM_CARGO]; ///< Array holding all CargoSpecs
|
||||||
|
|
||||||
friend void SetupCargoForClimate(LandscapeID l);
|
friend void SetupCargoForClimate(LandscapeID l);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue