From f809f0e08d451c7fa05116c9c7b147f499ea82d7 Mon Sep 17 00:00:00 2001 From: npwoods Date: Wed, 5 Apr 2017 21:39:00 -0400 Subject: Introduced an 'util::arbitrary_clock' template class, to represent a clock that "knows" when the epoch starts (#2010) * Introduced an 'util::arbitrary_clock' template class, to represent a clock that "knows" when the epoch starts Also: - Converted the NTFS filetime code to use util::arbitrary_clock - Converted the Mac datetime code to use util::atribrary_clock This is in preparation for a bigger change to Imgtool where I eliminate usage of time_t --- src/lib/util/coreutil.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/lib/util/coreutil.cpp') diff --git a/src/lib/util/coreutil.cpp b/src/lib/util/coreutil.cpp index 8ff9585d476..bd10802ef5a 100644 --- a/src/lib/util/coreutil.cpp +++ b/src/lib/util/coreutil.cpp @@ -58,39 +58,6 @@ uint32_t bcd_2_dec(uint32_t a) -/*************************************************************************** - GREGORIAN CALENDAR HELPERS -***************************************************************************/ - -int gregorian_is_leap_year(int year) -{ - return !((year % 100) ? (year % 4) : (year % 400)); -} - - -/* months are one counted */ - -/** - * @fn int gregorian_days_in_month(int month, int year) - * - * @brief Gregorian days in month. - * - * @param month The month. - * @param year The year. - * - * @return An int. - */ - -int gregorian_days_in_month(int month, int year) -{ - assert(month >= 1 && month <= 12); - - int days[] = { 31,28,31,30,31,30,31,31,30,31,30,31 }; - days[1] += gregorian_is_leap_year(year) ? 1 : 0; - return days[month-1]; -} - - /*************************************************************************** MISC ***************************************************************************/ -- cgit v1.2.3-70-g09d2