summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2020-01-04 03:09:56 -0500
committerGravatar bunnei2020-01-04 13:48:31 -0500
commit361285add978c5720bc16344a9fe41fa93374505 (patch)
treeb8dc12be3311368c0843fe50d0bd548067fab083
parentservice: time: Implement GetClockSnapshotFromSystemClockContext. (diff)
downloadyuzu-361285add978c5720bc16344a9fe41fa93374505.tar.gz
yuzu-361285add978c5720bc16344a9fe41fa93374505.tar.xz
yuzu-361285add978c5720bc16344a9fe41fa93374505.zip
time: Remove overflow error checking (currently breaks ADO builds).
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/time/clock_types.h10
-rw-r--r--src/core/hle/service/time/time_zone_manager.cpp10
2 files changed, 2 insertions, 18 deletions
diff --git a/src/core/hle/service/time/clock_types.h b/src/core/hle/service/time/clock_types.h
index 3d5b0ff1e..72e1921ec 100644
--- a/src/core/hle/service/time/clock_types.h
+++ b/src/core/hle/service/time/clock_types.h
@@ -4,8 +4,6 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <boost/safe_numerics/safe_integer.hpp>
8
9#include "common/common_funcs.h" 7#include "common/common_funcs.h"
10#include "common/common_types.h" 8#include "common/common_types.h"
11#include "common/uuid.h" 9#include "common/uuid.h"
@@ -26,13 +24,7 @@ struct SteadyClockTimePoint {
26 return ERROR_TIME_MISMATCH; 24 return ERROR_TIME_MISMATCH;
27 } 25 }
28 26
29 const boost::safe_numerics::safe<s64> this_time_point{time_point}; 27 span = other.time_point - time_point;
30 const boost::safe_numerics::safe<s64> other_time_point{other.time_point};
31 try {
32 span = other_time_point - this_time_point;
33 } catch (const std::exception&) {
34 return ERROR_OVERFLOW;
35 }
36 28
37 return RESULT_SUCCESS; 29 return RESULT_SUCCESS;
38 } 30 }
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp
index c06ca538a..4db6d7ad3 100644
--- a/src/core/hle/service/time/time_zone_manager.cpp
+++ b/src/core/hle/service/time/time_zone_manager.cpp
@@ -4,8 +4,6 @@
4 4
5#include <climits> 5#include <climits>
6 6
7#include <boost/safe_numerics/safe_integer.hpp>
8
9#include "common/assert.h" 7#include "common/assert.h"
10#include "common/logging/log.h" 8#include "common/logging/log.h"
11#include "core/file_sys/content_archive.h" 9#include "core/file_sys/content_archive.h"
@@ -77,13 +75,7 @@ struct CalendarTimeInternal {
77 75
78template <typename TResult, typename TOperand> 76template <typename TResult, typename TOperand>
79static bool SafeAdd(TResult& result, TOperand op) { 77static bool SafeAdd(TResult& result, TOperand op) {
80 const boost::safe_numerics::safe<TResult> safe_result{result}; 78 result = result + op;
81 const boost::safe_numerics::safe<TOperand> safe_op{op};
82 try {
83 result = safe_result + safe_op;
84 } catch (const std::exception&) {
85 return {}; // Failed with undefined behavior
86 }
87 return true; 79 return true;
88} 80}
89 81