Skip to content
Snippets Groups Projects
Commit f1b4092e authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Move trivial function to header for inlining.

parent 6855506c
No related branches found
No related tags found
No related merge requests found
......@@ -6,20 +6,6 @@ static const int month_360[12] = { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 3
static const int month_365[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static const int month_366[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int
calendar_dpy(int calendar)
{
int daysPerYear = 0;
// clang-format off
if (calendar == CALENDAR_360DAYS) daysPerYear = 360;
else if (calendar == CALENDAR_365DAYS) daysPerYear = 365;
else if (calendar == CALENDAR_366DAYS) daysPerYear = 366;
// clang-format on
return daysPerYear;
}
static const int *
get_dayspermonth_array(int daysPerYear)
{
......
......@@ -6,6 +6,8 @@
// clang-format off
#include "cdi.h"
#ifdef __cplusplus
extern "C" {
#endif
......@@ -13,7 +15,18 @@ extern "C" {
void decode_calday(int daysPerYear, int days, int *year, int *month, int *day);
int64_t encode_calday(int daysPerYear, int year, int month, int day);
int calendar_dpy(int calendar);
static inline int
calendar_dpy(int calendar)
{
int daysPerYear = 0;
if (calendar == CALENDAR_360DAYS) daysPerYear = 360;
else if (calendar == CALENDAR_365DAYS) daysPerYear = 365;
else if (calendar == CALENDAR_366DAYS) daysPerYear = 366;
return daysPerYear;
}
int days_per_year(int calendar, int year);
int days_per_month(int calendar, int year, int month);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment