mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
Kernel/RTC: Mark some intentional fallthroughs to suppress compiler warnings
This commit is contained in:
parent
20e55c0120
commit
1cefb4a3b4
Notes:
sideshowbarker
2024-07-19 14:03:39 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/1cefb4a3b48 Pull-request: https://github.com/SerenityOS/serenity/pull/53
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)
|
||||
{
|
||||
ASSERT(month <= 11);
|
||||
unsigned days = 0;
|
||||
switch (month) {
|
||||
case 11: days += 30;
|
||||
case 10: days += 31;
|
||||
case 9: days += 30;
|
||||
case 8: days += 31;
|
||||
case 7: days += 31;
|
||||
case 6: days += 30;
|
||||
case 5: days += 31;
|
||||
case 4: days += 30;
|
||||
case 3: days += 31;
|
||||
case 11:
|
||||
days += 30;
|
||||
[[fallthrough]];
|
||||
case 10:
|
||||
days += 31;
|
||||
[[fallthrough]];
|
||||
case 9:
|
||||
days += 30;
|
||||
[[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:
|
||||
if (is_leap_year(year))
|
||||
days += 29;
|
||||
else
|
||||
days += 28;
|
||||
case 1: days += 31;
|
||||
default: break;
|
||||
[[fallthrough]];
|
||||
case 1:
|
||||
days += 31;
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue