mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 05:16:24 -05:00
Added maybe_unused
This commit is contained in:
parent
ddc242dd51
commit
48cd61d9c8
2 changed files with 7 additions and 2 deletions
|
@ -16,10 +16,13 @@
|
||||||
namespace Service::Time {
|
namespace Service::Time {
|
||||||
|
|
||||||
static void PosixToCalendar(u64 posix_time, CalendarTime& calendar_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::time_t time(posix_time);
|
||||||
const std::tm* tm = std::localtime(&time);
|
const std::tm* tm = std::localtime(&time);
|
||||||
if (tm == nullptr) {
|
if (tm == nullptr) {
|
||||||
|
calendar_time = {};
|
||||||
|
additional_info = {};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
calendar_time.year = tm->tm_year + 1900;
|
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;
|
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{};
|
std::tm time{};
|
||||||
time.tm_year = calendar_time.year - 1900;
|
time.tm_year = calendar_time.year - 1900;
|
||||||
time.tm_mon = calendar_time.month - 1;
|
time.tm_mon = calendar_time.month - 1;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include "common/common_funcs.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service::Time {
|
namespace Service::Time {
|
||||||
|
|
Loading…
Reference in a new issue