More Cppcheck fixes

Former-commit-id: 62ab1caa04543da1a169812bb92a450d44f3aec1
This commit is contained in:
Lynix
2015-06-07 00:21:53 +02:00
parent d1258c2a6d
commit f8682d227b
7 changed files with 41 additions and 28 deletions

View File

@@ -160,31 +160,37 @@ inline NzColor NzColor::FromHSV(float hue, float saturation, float value)
r = value;
g = v3;
b = v1;
break;
case 1:
r = v2;
g = value;
b = v1;
break;
case 2:
r = v1;
g = value;
b = v3;
break;
case 3:
r = v1;
g = v2;
b = value;
break;
case 4:
r = v3;
g = v1;
b = value;
break;
default:
r = value;
g = v1;
b = v2;
break;
}
// RGB results from 0 to 255
@@ -289,12 +295,11 @@ inline void NzColor::ToHSL(const NzColor& color, nzUInt8* hue, nzUInt8* saturati
float deltaB = ((max - b)/6.f + deltaMax/2.f)/deltaMax;
float h;
if (NzNumberEquals(r, max))
h = deltaB - deltaG;
else if (NzNumberEquals(g, max))
h = (1.f/3.f) + deltaR - deltaB;
else if (NzNumberEquals(b, max))
else
h = (2.f/3.f) + deltaG - deltaR;
if (h < 0.f)

View File

@@ -123,14 +123,14 @@ inline T* NzMemoryPool::New(Args&&... args)
inline NzMemoryPool& NzMemoryPool::operator=(NzMemoryPool&& pool) noexcept
{
m_blockSize = m_blockSize;
m_canGrow = m_canGrow;
m_freeCount = m_freeCount.load(std::memory_order_relaxed);
m_freeList = std::move(m_freeList);
m_pool = std::move(m_pool);
m_previous = m_previous;
m_next = std::move(m_next);
m_size = m_size;
m_blockSize = pool.m_blockSize;
m_canGrow = pool.m_canGrow;
m_freeCount = pool.m_freeCount.load(std::memory_order_relaxed);
m_freeList = std::move(pool.m_freeList);
m_pool = std::move(pool.m_pool);
m_previous = pool.m_previous;
m_next = std::move(pool.m_next);
m_size = pool.m_size;
// Si nous avons été créés par un autre pool, nous devons le faire pointer vers nous de nouveau
if (m_previous)