Final VS fixes

Former-commit-id: 6da44f94127f61de39710a52b8b3b73ce19c1269
This commit is contained in:
Lynix
2015-06-14 16:18:37 +02:00
parent 32a217ea1b
commit f4c3ec51ed
24 changed files with 57 additions and 39 deletions

View File

@@ -17,7 +17,7 @@ class NzAbstractHash;
template<typename Block = nzUInt32, class Allocator = std::allocator<Block>>
class NzBitset
{
static_assert(std::is_integral<Block>() && std::is_unsigned<Block>(), "Block must be a unsigned integral type");
static_assert(std::is_integral<Block>::value && std::is_unsigned<Block>::value, "Block must be a unsigned integral type");
public:
class Bit;

View File

@@ -8,6 +8,12 @@
#include <utility>
#include <Nazara/Core/Debug.hpp>
#ifdef NAZARA_COMPILER_MSVC
// Bits tricks require us to disable some warnings under VS
#pragma warning(disable: 4146)
#pragma warning(disable: 4804)
#endif
template<typename Block, class Allocator>
NzBitset<Block, Allocator>::NzBitset() :
m_bitCount(0)
@@ -305,7 +311,7 @@ bool NzBitset<Block, Allocator>::Test(unsigned int bit) const
{
NazaraAssert(bit < m_bitCount, "Bit index out of range");
return m_blocks[GetBlockIndex(bit)] & (Block(1U) << GetBitIndex(bit));
return (m_blocks[GetBlockIndex(bit)] & (Block(1U) << GetBitIndex(bit))) != 0;
}
template<typename Block, class Allocator>
@@ -754,4 +760,10 @@ namespace std
}
}
#ifdef NAZARA_COMPILER_MSVC
// Reenable those warnings
#pragma warning(default: 4146)
#pragma warning(default: 4804)
#endif
#include <Nazara/Core/DebugOff.hpp>