Fix a lot of small bugs/warnings

This commit is contained in:
Jérôme Leclercq
2021-12-25 20:07:53 +01:00
parent 1080823c4d
commit b98fd65a01
26 changed files with 62 additions and 52 deletions

View File

@@ -297,6 +297,12 @@ namespace Nz
To SafeCast(From value)
{
#if defined(NAZARA_DEBUG) && !defined(NDEBUG)
#ifdef NAZARA_COMPILER_MSVC
// Disable unreachable code warnings
#pragma warning(push)
#pragma warning(disable: 4702)
#endif
if constexpr (std::is_integral_v<To>)
{
if constexpr (std::is_enum_v<From>)
@@ -368,6 +374,10 @@ namespace Nz
}
}
}
#ifdef NAZARA_COMPILER_MSVC
#pragma warning(pop)
#endif
#endif
return static_cast<To>(value);