Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -213,7 +213,7 @@ void CheckRedrawWaypointCoverage(Window *w, bool is_road)
* @param amount Cargo amount
* @param rating ratings data for that particular cargo
*/
static void StationsWndShowStationRating(int left, int right, int y, CargoID type, uint amount, byte rating)
static void StationsWndShowStationRating(int left, int right, int y, CargoID type, uint amount, uint8_t rating)
{
static const uint units_full = 576; ///< number of units to show station as 'full'
static const uint rating_full = 224; ///< rating needed so it is shown as 'full'
@@ -261,7 +261,7 @@ protected:
/* Runtime saved values */
struct FilterState {
Listing last_sorting;
byte facilities; ///< types of stations of interest
uint8_t facilities; ///< types of stations of interest
bool include_no_rating; ///< Whether we should include stations with no cargo rating.
CargoTypes cargoes; ///< bitmap of cargo types to include
};
@@ -375,8 +375,8 @@ protected:
/** Sort stations by their rating */
static bool StationRatingMaxSorter(const Station * const &a, const Station * const &b, const CargoTypes &cargo_filter)
{
byte maxr1 = 0;
byte maxr2 = 0;
uint8_t maxr1 = 0;
uint8_t maxr2 = 0;
for (CargoID j : SetCargoBitIterator(cargo_filter)) {
if (a->goods[j].HasRating()) maxr1 = std::max(maxr1, a->goods[j].rating);
@@ -389,8 +389,8 @@ protected:
/** Sort stations by their rating */
static bool StationRatingMinSorter(const Station * const &a, const Station * const &b, const CargoTypes &cargo_filter)
{
byte minr1 = 255;
byte minr2 = 255;
uint8_t minr1 = 255;
uint8_t minr2 = 255;
for (CargoID j : SetCargoBitIterator(cargo_filter)) {
if (a->goods[j].HasRating()) minr1 = std::min(minr1, a->goods[j].rating);
@@ -400,7 +400,7 @@ protected:
return minr1 > minr2;
}
static void PrepareStationVehiclesCallingSorter(byte facilities)
static void PrepareStationVehiclesCallingSorter(uint8_t facilities)
{
station_vehicle_calling_counts.clear();
@@ -960,7 +960,7 @@ enum SortOrder {
class CargoDataEntry;
enum class CargoSortType : byte {
enum class CargoSortType : uint8_t {
AsGrouping, ///< by the same principle the entries are being grouped
Count, ///< by amount of cargo
StationString, ///< by station name
@@ -1579,7 +1579,7 @@ struct StationViewWindow : public Window {
this->vscroll->SetCount(cargo.GetNumChildren()); // update scrollbar
byte have_veh_types = 0;
uint8_t have_veh_types = 0;
IterateOrderRefcountMapForDestinationID(st->index, [&](CompanyID cid, OrderType order_type, VehicleType veh_type, uint32_t refcount) {
SetBit(have_veh_types, veh_type);
return true;