From 440f5099ba97ccc5d0b51a52b49056b777ddf3aa Mon Sep 17 00:00:00 2001 From: Heinz-Peter Liechtenecker Date: Tue, 30 Jun 2020 19:07:58 +0200 Subject: [PATCH] Use c_encoding function for datatype conversion (#5) * Use c_encoding function The MSVC compiler does not accept direct conversion from weekday datatype (used in the date.h dependency) to unsigned int used in the DayOfWeek Enum. However, the c_encoding function gives the necessary datatype conversion. * Updated submodule libcron/externals/date Co-authored-by: Heinz-Peter Liechtenecker --- libcron/externals/date | 2 +- libcron/src/CronSchedule.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcron/externals/date b/libcron/externals/date index e7e1482..cac99da 160000 --- a/libcron/externals/date +++ b/libcron/externals/date @@ -1 +1 @@ -Subproject commit e7e1482087f58913b80a20b04d5c58d9d6d90155 +Subproject commit cac99da8dc88be719a728dc1b597b0ac307c1800 diff --git a/libcron/src/CronSchedule.cpp b/libcron/src/CronSchedule.cpp index 5da19d6..af00b3b 100644 --- a/libcron/src/CronSchedule.cpp +++ b/libcron/src/CronSchedule.cpp @@ -46,7 +46,7 @@ namespace libcron //Add days until the current weekday is one of the allowed weekdays year_month_weekday ymw = date::floor(curr); - if (data.get_day_of_week().find(static_cast(unsigned(ymw.weekday()))) == + if (data.get_day_of_week().find(static_cast(ymw.weekday().c_encoding())) == data.get_day_of_week().end()) { sys_days s = ymd;