forked from mirror/OpenTTD
Codechange: rename byte to uint8_t (#12308)
This commit is contained in:
@@ -160,7 +160,7 @@ static inline void GetAllCargoSuffixes(CargoSuffixInOut use_input, CargoSuffixTy
|
||||
/* Reworked behaviour with new many-in-many-out scheme */
|
||||
for (uint j = 0; j < lengthof(suffixes); j++) {
|
||||
if (IsValidCargoID(cargoes[j])) {
|
||||
byte local_id = indspec->grf_prop.grffile->cargo_map[cargoes[j]]; // should we check the value for valid?
|
||||
uint8_t local_id = indspec->grf_prop.grffile->cargo_map[cargoes[j]]; // should we check the value for valid?
|
||||
uint cargotype = local_id << 16 | use_input;
|
||||
GetCargoSuffix(cargotype, cst, ind, ind_type, indspec, suffixes[j]);
|
||||
} else {
|
||||
@@ -207,7 +207,7 @@ void GetCargoSuffix(CargoSuffixInOut use_input, CargoSuffixType cst, const Indus
|
||||
suffix.display = CSD_CARGO;
|
||||
if (!IsValidCargoID(cargo)) return;
|
||||
if (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) {
|
||||
byte local_id = indspec->grf_prop.grffile->cargo_map[cargo]; // should we check the value for valid?
|
||||
uint8_t local_id = indspec->grf_prop.grffile->cargo_map[cargo]; // should we check the value for valid?
|
||||
uint cargotype = local_id << 16 | use_input;
|
||||
GetCargoSuffix(cargotype, cst, ind, ind_type, indspec, suffix);
|
||||
} else if (use_input == CARGOSUFFIX_IN) {
|
||||
@@ -805,7 +805,7 @@ class IndustryViewWindow : public Window
|
||||
Editability editable; ///< Mode for changing production
|
||||
InfoLine editbox_line; ///< The line clicked to open the edit box
|
||||
InfoLine clicked_line; ///< The line of the button that has been clicked
|
||||
byte clicked_button; ///< The button that has been clicked (to raise)
|
||||
uint8_t clicked_button; ///< The button that has been clicked (to raise)
|
||||
int production_offset_y; ///< The offset of the production texts/buttons
|
||||
int info_height; ///< Height needed for the #WID_IV_INFO panel
|
||||
int cheat_line_height; ///< Height of each line for the #WID_IV_INFO panel
|
||||
@@ -1048,10 +1048,10 @@ public:
|
||||
case EA_MULTIPLIER:
|
||||
if (decrease) {
|
||||
if (i->prod_level <= PRODLEVEL_MINIMUM) return;
|
||||
i->prod_level = static_cast<byte>(std::max<uint>(i->prod_level / 2, PRODLEVEL_MINIMUM));
|
||||
i->prod_level = static_cast<uint8_t>(std::max<uint>(i->prod_level / 2, PRODLEVEL_MINIMUM));
|
||||
} else {
|
||||
if (i->prod_level >= PRODLEVEL_MAXIMUM) return;
|
||||
i->prod_level = static_cast<byte>(std::min<uint>(i->prod_level * 2, PRODLEVEL_MAXIMUM));
|
||||
i->prod_level = static_cast<uint8_t>(std::min<uint>(i->prod_level * 2, PRODLEVEL_MAXIMUM));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1063,7 +1063,7 @@ public:
|
||||
if (i->produced[line - IL_RATE1].rate >= 255) return;
|
||||
/* a zero production industry is unlikely to give anything but zero, so push it a little bit */
|
||||
int new_prod = i->produced[line - IL_RATE1].rate == 0 ? 1 : i->produced[line - IL_RATE1].rate * 2;
|
||||
i->produced[line - IL_RATE1].rate = ClampTo<byte>(new_prod);
|
||||
i->produced[line - IL_RATE1].rate = ClampTo<uint8_t>(new_prod);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1551,7 +1551,7 @@ protected:
|
||||
StringID GetIndustryString(const Industry *i) const
|
||||
{
|
||||
const IndustrySpec *indsp = GetIndustrySpec(i->type);
|
||||
byte p = 0;
|
||||
uint8_t p = 0;
|
||||
|
||||
/* Industry name */
|
||||
SetDParam(p++, i->index);
|
||||
|
Reference in New Issue
Block a user