mirror of
https://github.com/bkaradzic/bx.git
synced 2026-10-22 16:51:01 +00:00
Fixed MSVC unreachable warning. (#431)
This commit is contained in:
committed by
GitHub
parent
2531549884
commit
3d6e53107b
@@ -298,6 +298,8 @@ namespace bx
|
||||
return static_cast<Ty>(_from);
|
||||
}
|
||||
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH()
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4702) // warning C4702: unreachable code
|
||||
template<typename Ty, typename FromT>
|
||||
inline constexpr bool narrowCastTest(Ty* _out, const FromT& _from)
|
||||
{
|
||||
@@ -307,12 +309,10 @@ namespace bx
|
||||
return true;
|
||||
}
|
||||
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH()
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4702) // warning C4702: unreachable code
|
||||
*_out = static_cast<Ty>(_from);
|
||||
return static_cast<FromT>(*_out) == _from;
|
||||
BX_PRAGMA_DIAGNOSTIC_POP()
|
||||
}
|
||||
BX_PRAGMA_DIAGNOSTIC_POP()
|
||||
|
||||
template<typename Ty, typename FromT>
|
||||
inline Ty narrowCast(const FromT& _from, Location _location)
|
||||
|
||||
Reference in New Issue
Block a user