Codechange: Don't use enums for non-enumerated values. (#13031)

In the past we have used enums to hold an arbitrary values. These values
are not enumerated types, so make them constants instead.
This commit is contained in:
Peter Nelson
2024-10-27 18:02:49 +00:00
committed by GitHub
parent a86f9dba0f
commit e1697a6ad1
18 changed files with 151 additions and 184 deletions

View File

@@ -35,20 +35,18 @@ static constexpr uint16_t _month_date_from_year_day[] = {
};
#undef M
enum DaysTillMonth {
ACCUM_JAN = 0,
ACCUM_FEB = ACCUM_JAN + 31,
ACCUM_MAR = ACCUM_FEB + 29,
ACCUM_APR = ACCUM_MAR + 31,
ACCUM_MAY = ACCUM_APR + 30,
ACCUM_JUN = ACCUM_MAY + 31,
ACCUM_JUL = ACCUM_JUN + 30,
ACCUM_AUG = ACCUM_JUL + 31,
ACCUM_SEP = ACCUM_AUG + 31,
ACCUM_OCT = ACCUM_SEP + 30,
ACCUM_NOV = ACCUM_OCT + 31,
ACCUM_DEC = ACCUM_NOV + 30,
};
static constexpr uint16_t ACCUM_JAN = 0;
static constexpr uint16_t ACCUM_FEB = ACCUM_JAN + 31;
static constexpr uint16_t ACCUM_MAR = ACCUM_FEB + 29;
static constexpr uint16_t ACCUM_APR = ACCUM_MAR + 31;
static constexpr uint16_t ACCUM_MAY = ACCUM_APR + 30;
static constexpr uint16_t ACCUM_JUN = ACCUM_MAY + 31;
static constexpr uint16_t ACCUM_JUL = ACCUM_JUN + 30;
static constexpr uint16_t ACCUM_AUG = ACCUM_JUL + 31;
static constexpr uint16_t ACCUM_SEP = ACCUM_AUG + 31;
static constexpr uint16_t ACCUM_OCT = ACCUM_SEP + 30;
static constexpr uint16_t ACCUM_NOV = ACCUM_OCT + 31;
static constexpr uint16_t ACCUM_DEC = ACCUM_NOV + 30;
/** Number of days to pass from the first day in the year before reaching the first of a month. */
static constexpr uint16_t _accum_days_for_month[] = {