From 10fb751db6563c8dd1227f017da1bd0a47d098d5 Mon Sep 17 00:00:00 2001 From: Ryan Loebs Date: Mon, 4 Apr 2016 12:44:52 -0700 Subject: [PATCH] Fix MSVC incompatibilities, use C++ styles instead of C --- src/core/hle/shared_page.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp index 029be8242..7efabae69 100644 --- a/src/core/hle/shared_page.cpp +++ b/src/core/hle/shared_page.cpp @@ -17,15 +17,16 @@ void Init() { std::memset(&shared_page, 0, sizeof(shared_page)); // 3DS uses 1/1/1900 for Epoch - time_t plat_time = time(NULL); - struct tm console_epoch = {0}; + time_t plat_time = std::time(nullptr); + tm console_epoch = {}; console_epoch.tm_mday = 1; - u64_le console_time = (u64_le) difftime(plat_time, mktime(&console_epoch)) * 1000L; + u64_le console_time = static_cast(std::difftime(plat_time, std::mktime(&console_epoch)) * 1000L); shared_page.running_hw = 0x1; // product - shared_page.date_time_0 = { - .date_time = console_time, - }; + shared_page.date_time_0 = {}; + shared_page.date_time_0.date_time = console_time; + shared_page.date_time_1 = {}; + shared_page.date_time_1.date_time = console_time; } } // namespace