mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
Kernel/RTC: Mark some intentional fallthroughs to suppress compiler warnings
This commit is contained in:
parent
20e55c0120
commit
1cefb4a3b4
1 changed files with 31 additions and 11 deletions
|
@ -33,24 +33,44 @@ inline bool is_leap_year(unsigned year)
|
||||||
|
|
||||||
static unsigned days_in_months_since_start_of_year(unsigned month, unsigned year)
|
static unsigned days_in_months_since_start_of_year(unsigned month, unsigned year)
|
||||||
{
|
{
|
||||||
|
ASSERT(month <= 11);
|
||||||
unsigned days = 0;
|
unsigned days = 0;
|
||||||
switch (month) {
|
switch (month) {
|
||||||
case 11: days += 30;
|
case 11:
|
||||||
case 10: days += 31;
|
days += 30;
|
||||||
case 9: days += 30;
|
[[fallthrough]];
|
||||||
case 8: days += 31;
|
case 10:
|
||||||
case 7: days += 31;
|
days += 31;
|
||||||
case 6: days += 30;
|
[[fallthrough]];
|
||||||
case 5: days += 31;
|
case 9:
|
||||||
case 4: days += 30;
|
days += 30;
|
||||||
case 3: days += 31;
|
[[fallthrough]];
|
||||||
|
case 8:
|
||||||
|
days += 31;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 7:
|
||||||
|
days += 31;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 6:
|
||||||
|
days += 30;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 5:
|
||||||
|
days += 31;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 4:
|
||||||
|
days += 30;
|
||||||
|
[[fallthrough]];
|
||||||
|
case 3:
|
||||||
|
days += 31;
|
||||||
|
[[fallthrough]];
|
||||||
case 2:
|
case 2:
|
||||||
if (is_leap_year(year))
|
if (is_leap_year(year))
|
||||||
days += 29;
|
days += 29;
|
||||||
else
|
else
|
||||||
days += 28;
|
days += 28;
|
||||||
case 1: days += 31;
|
[[fallthrough]];
|
||||||
default: break;
|
case 1:
|
||||||
|
days += 31;
|
||||||
}
|
}
|
||||||
return days;
|
return days;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue