gwnavruntime/math/checkintegeroverflow.h Source File
Go to the documentation of this file.
18 #if defined(KY_FULL_DEBUG_IntegerOverflow)
23 #ifdef KY_FULL_DEBUG_IntegerOverflow
25 inline void CheckPrecision(
const Vec2LL& P)
29 KY_DEV_BREAK_IF(P.x >= (1LL << 31) || -P.x >= (1LL << 31));
30 KY_DEV_BREAK_IF(P.y >= (1LL << 31) || -P.y >= (1LL << 31));
33 inline void CheckPrecision(
const Vec2LL& v1,
const Vec2LL& v2,
const Vec2LL& v3,
const Vec2LL& v4,
const Vec2LL& v5)
42 inline void CheckPrecision(
const Vec2LL& v1,
const Vec2LL& v2,
const Vec2LL& v3,
const Vec2LL& v4,
const Vec2LL& v5,
const Vec2LL& v6)
52 inline void CheckPrecision(
const Vec2i& P)
56 KY_DEV_BREAK_IF(P.x >= (1 << 15) || -P.x >= (1 << 15);
57 KY_DEV_BREAK_IF(P.y >= (1 << 15) || -P.y >= (1 << 15);
60 inline void CheckPrecision(
const Vec2i& v1,
const Vec2i& v2,
const Vec2i& v3,
const Vec2i& v4,
const Vec2i& v5,
const Vec2i& v6)
70 inline void CheckPrecisionOn20Bits(
KyInt64 x)
72 KY_DEV_BREAK_IF((x >= 1LL << 20 || -x >= 1LL << 20));
77 CheckPrecisionOn20Bits(
KyInt64 x1);
78 CheckPrecisionOn20Bits(
KyInt64 x2);
79 CheckPrecisionOn20Bits(
KyInt64 x3);
80 CheckPrecisionOn20Bits(
KyInt64 x4);
81 CheckPrecisionOn20Bits(
KyInt64 x5);
82 CheckPrecisionOn20Bits(
KyInt64 x6);
86 inline void AssertUnder8bits(
const Vec2i& P)
90 KY_DEV_BREAK_IF(P.x >= (1 << 8) || -P.x >= (1 << 8);
91 KY_DEV_BREAK_IF(P.y >= (1 << 8) || -P.y >= (1 << 8);
94 inline void AssertUnder8bits(
const Vec2i& A,
const Vec2i& B,
const Vec2i& C,
const Vec2i& D)
103 inline void CheckDegenerated2d(
const T& A,
const T& B,
const T& C,
const T& D)
105 KY_DEV_BREAK_IF(A.x == B.x && A.y == B.y);
106 KY_DEV_BREAK_IF(C.x == D.x && C.y == D.y);
111 inline void CheckPrecision(
const Vec2LL&) {}
112 inline void CheckPrecision(
const Vec2LL&,
const Vec2LL&,
const Vec2LL&,
const Vec2LL&,
const Vec2LL&) {}
113 inline void CheckPrecision(
const Vec2LL&,
const Vec2LL&,
const Vec2LL&,
const Vec2LL&,
const Vec2LL&,
const Vec2LL&) {}
114 inline void CheckPrecision(
const Vec2i&) {}
115 inline void CheckPrecision(
const Vec2i&,
const Vec2i&,
const Vec2i&,
const Vec2i&,
const Vec2i&,
const Vec2i&) {}
116 inline void CheckPrecisionOn20Bits(
KyInt64) {}
118 inline void AssertUnder8bits(
const Vec2i&) {}
119 inline void AssertUnder8bits(
const Vec2i&,
const Vec2i&,
const Vec2i&,
const Vec2i&) {}
120 template<
typename T>
inline void CheckDegenerated2d(
const T&,
const T&,
const T&,
const T&) {}
std::int64_t KyInt64
int64_t
Definition: types.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17