summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-11-10 08:07:34 +0100
committerDavid Marcec <dmarcecguzman@gmail.com>2018-11-10 08:07:34 +0100
commit48cd61d9c865aa0d93789cf05b647b272bccab4e (patch)
tree0defbeb073cf31891bd55b1e5943208237b4e8c4 /src/core/hle
parentAdded ToPosixTime & ToPosixTimeWithMyRule (diff)
downloadyuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar.gz
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar.bz2
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar.lz
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar.xz
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.tar.zst
yuzu-48cd61d9c865aa0d93789cf05b647b272bccab4e.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/time/time.cpp8
-rw-r--r--src/core/hle/service/time/time.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index d312bd765..85e7b1195 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -16,10 +16,13 @@
namespace Service::Time {
static void PosixToCalendar(u64 posix_time, CalendarTime& calendar_time,
- CalendarAdditionalInfo& additional_info, const TimeZoneRule& /*rule*/) {
+ CalendarAdditionalInfo& additional_info,
+ [[maybe_unused]] const TimeZoneRule& /*rule*/) {
const std::time_t time(posix_time);
const std::tm* tm = std::localtime(&time);
if (tm == nullptr) {
+ calendar_time = {};
+ additional_info = {};
return;
}
calendar_time.year = tm->tm_year + 1900;
@@ -35,7 +38,8 @@ static void PosixToCalendar(u64 posix_time, CalendarTime& calendar_time,
additional_info.utc_offset = 0;
}
-u64 CalendarToPosix(const CalendarTime& calendar_time, const TimeZoneRule& /*rule*/) {
+static u64 CalendarToPosix(const CalendarTime& calendar_time,
+ [[maybe_unused]] const TimeZoneRule& /*rule*/) {
std::tm time{};
time.tm_year = calendar_time.year - 1900;
time.tm_mon = calendar_time.month - 1;
diff --git a/src/core/hle/service/time/time.h b/src/core/hle/service/time/time.h
index ca30ec60f..77871ae07 100644
--- a/src/core/hle/service/time/time.h
+++ b/src/core/hle/service/time/time.h
@@ -5,6 +5,7 @@
#pragma once
#include <array>
+#include "common/common_funcs.h"
#include "core/hle/service/service.h"
namespace Service::Time {