mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:58:12 +00:00
AK+LibC+LibCore+Kernel: Have fewer implementations of is_leap_year
This commit is contained in:
parent
394e4c04cd
commit
84ed257959
4 changed files with 19 additions and 20 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/LogStream.h>
|
||||
#include <AK/Time.h>
|
||||
#include <Kernel/CMOS.h>
|
||||
#include <Kernel/RTC.h>
|
||||
|
||||
|
@ -48,11 +49,6 @@ static bool update_in_progress()
|
|||
return CMOS::read(0x0a) & 0x80;
|
||||
}
|
||||
|
||||
inline bool is_leap_year(unsigned year)
|
||||
{
|
||||
return ((year % 4 == 0) && ((year % 100 != 0) || (year % 400) == 0));
|
||||
}
|
||||
|
||||
static unsigned days_in_months_since_start_of_year(unsigned month, unsigned year)
|
||||
{
|
||||
ASSERT(month <= 11);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue