From dd8f5afdf45abafdf4f63def7f442e6565d59775 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 19 Sep 2021 14:57:54 +0200 Subject: [PATCH] (Windows) Fixed some compiler errors and a compiler warning. --- es-core/src/Window.cpp | 4 ++-- es-core/src/utils/TimeUtil.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 6ca4dce4e..f23d9f96d 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -664,10 +664,10 @@ void Window::setHelpPrompts(const std::vector& prompts, const HelpSt "lt", "start", "back"}; - size_t i = 0; + int i = 0; int aVal = 0; int bVal = 0; - while (i < map.size()) { + while (i < static_cast(map.size())) { if (a.first == map[i]) aVal = i; if (b.first == map[i]) diff --git a/es-core/src/utils/TimeUtil.cpp b/es-core/src/utils/TimeUtil.cpp index 4289ba97c..40ba11bd3 100644 --- a/es-core/src/utils/TimeUtil.cpp +++ b/es-core/src/utils/TimeUtil.cpp @@ -18,7 +18,11 @@ namespace Utils DateTime::DateTime() { mTime = 0; +#if defined(_WIN64) + mTimeStruct = {0, 0, 0, 1, 0, 0, 0, 0, -1}; +#else mTimeStruct = {0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0}; +#endif mIsoString = "00000000T000000"; } @@ -83,7 +87,11 @@ namespace Utils { const char* s = string.c_str(); const char* f = format.c_str(); +#if defined(_WIN64) + tm timeStruct = {0, 0, 0, 1, 0, 0, 0, 0, -1}; +#else tm timeStruct = {0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0}; +#endif size_t parsedChars = 0; if (string == "19700101T010000") @@ -231,7 +239,11 @@ namespace Utils int daysInMonth(const int year, const int month) { +#if defined(_WIN64) + tm timeStruct = {0, 0, 0, 0, month, year - 1900, 0, 0, -1}; +#else tm timeStruct = {0, 0, 0, 0, month, year - 1900, 0, 0, -1, 0, 0}; +#endif mktime(&timeStruct); return timeStruct.tm_mday; @@ -239,7 +251,11 @@ namespace Utils int daysInYear(const int year) { +#if defined(_WIN64) + tm timeStruct = {0, 0, 0, 0, 0, year - 1900 + 1, 0, 0, -1}; +#else tm timeStruct = {0, 0, 0, 0, 0, year - 1900 + 1, 0, 0, -1, 0, 0}; +#endif mktime(&timeStruct); return timeStruct.tm_yday + 1;