diff --git a/libc/time/lib_daysbeforemonth.c b/libc/time/lib_daysbeforemonth.c index 8c09c2203e..d17d05b57e 100644 --- a/libc/time/lib_daysbeforemonth.c +++ b/libc/time/lib_daysbeforemonth.c @@ -44,26 +44,6 @@ #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Public Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -73,10 +53,6 @@ static const uint16_t g_daysbeforemonth[13] = 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -85,7 +61,16 @@ static const uint16_t g_daysbeforemonth[13] = * Function: clock_daysbeforemonth * * Description: - * Get the number of days that occurred before the beginning of the month. + * Get the number of days that occurred before the beginning of the + * month. + * + * Input Parameters: + * month - The month in the form of tm_mon, that is a range of 0-11. + * leapyear - True if leap year and there are 29 days in February. + * NOTE the month=1 is February. + * + * Returned Value: + * The number of days that occurred before the month * ****************************************************************************/ @@ -96,6 +81,7 @@ int clock_daysbeforemonth(int month, bool leapyear) { retval++; } + return retval; } diff --git a/libc/time/lib_gmtimer.c b/libc/time/lib_gmtimer.c index a9624747c9..10173d8c97 100644 --- a/libc/time/lib_gmtimer.c +++ b/libc/time/lib_gmtimer.c @@ -54,10 +54,6 @@ #define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN) #define SEC_PER_DAY ((time_t)24 * SEC_PER_HOUR) -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ @@ -90,8 +86,7 @@ static void clock_utc2julian(time_t jdn, int *year, int *month, int *day); ****************************************************************************/ /**************************************************************************** - * Function: clock_calendar2utc, clock_gregorian2utc, - * and clock_julian2utc + * Function: clock_utc2calendar, clock_utc2gregorian, and clock_utc2julian * * Description: * Calendar to UTC conversion routines. These conversions diff --git a/sched/clock/clock_initialize.c b/sched/clock/clock_initialize.c index 9e5d9f93f4..0113e5e0fc 100644 --- a/sched/clock/clock_initialize.c +++ b/sched/clock/clock_initialize.c @@ -61,6 +61,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Standard time definitions (in units of seconds) */ #define SEC_PER_MIN ((time_t)60) @@ -151,7 +152,7 @@ static inline int clock_basetime(FAR struct timespec *tp) * month, and date */ - jdn = clock_calendar2utc(CONFIG_START_YEAR, CONFIG_START_MONTH, + jdn = clock_calendar2utc(CONFIG_START_YEAR, CONFIG_START_MONTH - 1, CONFIG_START_DAY); /* Set the base time as seconds into this julian day. */