Browse Source

time: Remove overflow error checking (currently breaks ADO builds).

nce_cpp
bunnei 6 years ago
parent
commit
940ed35ee2
  1. 10
      src/core/hle/service/time/clock_types.h
  2. 10
      src/core/hle/service/time/time_zone_manager.cpp

10
src/core/hle/service/time/clock_types.h

@ -4,8 +4,6 @@
#pragma once
#include <boost/safe_numerics/safe_integer.hpp>
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/uuid.h"
@ -26,13 +24,7 @@ struct SteadyClockTimePoint {
return ERROR_TIME_MISMATCH;
}
const boost::safe_numerics::safe<s64> this_time_point{time_point};
const boost::safe_numerics::safe<s64> other_time_point{other.time_point};
try {
span = other_time_point - this_time_point;
} catch (const std::exception&) {
return ERROR_OVERFLOW;
}
span = other.time_point - time_point;
return RESULT_SUCCESS;
}

10
src/core/hle/service/time/time_zone_manager.cpp

@ -4,8 +4,6 @@
#include <climits>
#include <boost/safe_numerics/safe_integer.hpp>
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/file_sys/content_archive.h"
@ -77,13 +75,7 @@ struct CalendarTimeInternal {
template <typename TResult, typename TOperand>
static bool SafeAdd(TResult& result, TOperand op) {
const boost::safe_numerics::safe<TResult> safe_result{result};
const boost::safe_numerics::safe<TOperand> safe_op{op};
try {
result = safe_result + safe_op;
} catch (const std::exception&) {
return {}; // Failed with undefined behavior
}
result = result + op;
return true;
}

Loading…
Cancel
Save