1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 12:44:10 +01:00

Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383)

This commit is contained in:
Peter Nelson
2025-01-28 22:17:34 +00:00
committed by GitHub
parent 6fda85c569
commit afc0745aa2
180 changed files with 371 additions and 367 deletions

View File

@@ -94,7 +94,7 @@ public:
return Date{(365 * year_as_int) + number_of_leap_years};
}
enum Trigger {
enum Trigger : uint8_t {
DAY,
WEEK,
MONTH,
@@ -102,7 +102,7 @@ public:
YEAR,
};
enum Priority {
enum Priority : uint8_t {
NONE, ///< These timers can be executed in any order; there is no Random() in them, so order is not relevant.
/* All other may have a Random() call in them, so order is important.

View File

@@ -27,7 +27,7 @@
*/
class TimerGameRealtime {
public:
enum PeriodFlags {
enum PeriodFlags : uint8_t {
ALWAYS, ///< Always run, even when paused.
UNPAUSED, ///< Only run when not paused.
AUTOSAVE, ///< Only run when not paused or there was a Command executed recently.

View File

@@ -24,7 +24,7 @@ public:
using Ticks = int32_t; ///< The type to store ticks in
using TickCounter = uint64_t; ///< The type that the tick counter is stored in
enum Priority {
enum Priority : uint8_t {
NONE, ///< These timers can be executed in any order; the order is not relevant.
/* For all other priorities, the order is important.