#1 Build on clang.

This commit is contained in:
Per Malmberg 2019-03-15 11:45:23 +01:00
parent 802d8e724e
commit e725abf87f
3 changed files with 13 additions and 12 deletions

View File

@ -11,7 +11,8 @@ namespace libcron
class CronData
{
public:
static const std::array<Months, 7> months_with_31;
static const int NUMBER_OF_LONG_MONTHS = 7;
static const libcron::Months months_with_31[NUMBER_OF_LONG_MONTHS];
static CronData create(const std::string& cron_expression);

View File

@ -5,7 +5,7 @@ using namespace date;
namespace libcron
{
const constexpr std::array<Months, 7> CronData::months_with_31{ Months::January,
const constexpr Months CronData::months_with_31[NUMBER_OF_LONG_MONTHS] = { Months::January,
Months::March,
Months::May,
Months::July,
@ -98,7 +98,7 @@ namespace libcron
{
res = false;
for (size_t i = 0; !res && i < months_with_31.size(); ++i)
for (size_t i = 0; !res && i < NUMBER_OF_LONG_MONTHS; ++i)
{
res = months.find(months_with_31[i]) != months.end();
}

View File

@ -87,9 +87,9 @@ namespace libcron
// Limit to 29 days, possibly causing delaying schedule until next leap year.
max = std::min(max, 29);
}
else if (std::find(CronData::months_with_31.begin(),
CronData::months_with_31.end(),
month) == CronData::months_with_31.end())
else if (std::find(std::begin(CronData::months_with_31),
std::end(CronData::months_with_31),
month) == std::end(CronData::months_with_31))
{
// Not among the months with 31 days
max = std::min(max, 30);