diff --git a/include/Nazara/Core/Algorithm.inl b/include/Nazara/Core/Algorithm.inl index 1fa2a9032..2b5cffb47 100644 --- a/include/Nazara/Core/Algorithm.inl +++ b/include/Nazara/Core/Algorithm.inl @@ -14,7 +14,7 @@ template struct NzImplTupleUnpack { template - void operator()(F func, const std::tuple& t, Args&... args) + void operator()(F func, const std::tuple& t, Args&... args) { NzImplTupleUnpack()(func, t, std::get(t), args...); } diff --git a/include/Nazara/Core/Color.inl b/include/Nazara/Core/Color.inl index 8e2caa76c..9dfe4e474 100644 --- a/include/Nazara/Core/Color.inl +++ b/include/Nazara/Core/Color.inl @@ -312,8 +312,8 @@ inline void NzColor::ToHSV(const NzColor& color, float* hue, float* saturation, float g = color.g / 255.f; float b = color.b / 255.f; - float min = std::min(std::min(r, g), b); //Min. value of RGB - float max = std::max(std::max(r, g), b); //Max. value of RGB + float min = std::min({r, g, b}); //Min. value of RGB + float max = std::max({r, g, b}); //Max. value of RGB float deltaMax = max - min; //Delta RGB value diff --git a/include/Nazara/Core/DynLib.hpp b/include/Nazara/Core/DynLib.hpp index 733b7c962..bce67acf0 100644 --- a/include/Nazara/Core/DynLib.hpp +++ b/include/Nazara/Core/DynLib.hpp @@ -27,7 +27,7 @@ #include #endif -using NzDynLibFunc = int (*)(); // Type "générique" de pointeur sur fonction +using NzDynLibFunc = int (*)(); // Type "générique" de pointeur sur fonction class NzDynLibImpl; diff --git a/include/Nazara/Math/Matrix4.hpp b/include/Nazara/Math/Matrix4.hpp index ac142f4f1..7d011f171 100644 --- a/include/Nazara/Math/Matrix4.hpp +++ b/include/Nazara/Math/Matrix4.hpp @@ -80,7 +80,6 @@ class NzMatrix4 NzMatrix4& Set(const T matrix[16]); //NzMatrix4(const NzMatrix3& matrix); NzMatrix4& Set(const NzMatrix4& matrix); - NzMatrix4& Set(NzMatrix4&& matrix); template NzMatrix4& Set(const NzMatrix4& matrix); NzMatrix4& SetRotation(const NzQuaternion& rotation); NzMatrix4& SetScale(const NzVector3& scale); diff --git a/include/Nazara/Math/Vector3.hpp b/include/Nazara/Math/Vector3.hpp index 14cd41b0a..21f3c30be 100644 --- a/include/Nazara/Math/Vector3.hpp +++ b/include/Nazara/Math/Vector3.hpp @@ -28,14 +28,12 @@ class NzVector3 ~NzVector3() = default; T AbsDotProduct(const NzVector3& vec) const; - T AngleBetween(const NzVector3& vec) const; NzVector3 CrossProduct(const NzVector3& vec) const; T Distance(const NzVector3& vec) const; float Distancef(const NzVector3& vec) const; - T DotProduct(const NzVector3& vec) const; T GetLength() const; diff --git a/include/Nazara/Math/Vector3.inl b/include/Nazara/Math/Vector3.inl index a2f0ed35c..598c8f686 100644 --- a/include/Nazara/Math/Vector3.inl +++ b/include/Nazara/Math/Vector3.inl @@ -64,9 +64,9 @@ template T NzVector3::AngleBetween(const NzVector3& vec) const { // sqrt(a) * sqrt(b) = sqrt(a*b) - T divisor = std::sqrt(GetSquaredLength() * vec.GetSquaredLength()); + T divisor = std::sqrt(GetSquaredLength() * vec.GetSquaredLength()); - #if NAZARA_MATH_SAFE + #if NAZARA_MATH_SAFE if (NzNumberEquals(divisor, F(0.0))) { NzString error("Division by zero"); @@ -325,7 +325,7 @@ NzVector3& NzVector3::Set(const NzVector4& vec) template T NzVector3::SquaredDistance(const NzVector3& vec) const { - return operator-(vec).GetSquaredLength(); + return (*this - vec).GetSquaredLength(); } template diff --git a/include/Nazara/Math/Vector4.inl b/include/Nazara/Math/Vector4.inl index fdef535a7..6b17b2ced 100644 --- a/include/Nazara/Math/Vector4.inl +++ b/include/Nazara/Math/Vector4.inl @@ -121,11 +121,11 @@ NzVector4& NzVector4::Maximize(const NzVector4& vec) if (vec.y > y) y = vec.y; - if (vec.z > z) - z = vec.z; + if (vec.z > z) + z = vec.z; - if (vec.w > w) - w = vec.w; + if (vec.w > w) + w = vec.w; return *this; } @@ -139,11 +139,11 @@ NzVector4& NzVector4::Minimize(const NzVector4& vec) if (vec.y < y) y = vec.y; - if (vec.z < z) - z = vec.z; + if (vec.z < z) + z = vec.z; - if (vec.w < w) - w = vec.w; + if (vec.w < w) + w = vec.w; return *this; } @@ -447,9 +447,9 @@ template bool NzVector4::operator==(const NzVector4& vec) const { return NzNumberEquals(x, vec.x) && - NzNumberEquals(y, vec.y) && - NzNumberEquals(z, vec.z) && - NzNumberEquals(w, vec.w); + NzNumberEquals(y, vec.y) && + NzNumberEquals(z, vec.z) && + NzNumberEquals(w, vec.w); } template diff --git a/src/Nazara/Core/String.cpp b/src/Nazara/Core/String.cpp index d2ba08601..1269c747c 100644 --- a/src/Nazara/Core/String.cpp +++ b/src/Nazara/Core/String.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -50,24 +51,24 @@ inline char nzToUpper(char character) inline int nzStrcasecmp(const char* s1, const char* s2) { - int ret = 0; + int ret = 0; - while (!(ret = static_cast(nzToLower(*s1)) - static_cast(nzToLower(*s2))) && *s2) - ++s1, ++s2; + while (!(ret = static_cast(nzToLower(*s1)) - static_cast(nzToLower(*s2))) && *s2) + ++s1, ++s2; - return ret != 0 ? (ret > 0 ? 1 : -1) : 0; + return ret != 0 ? (ret > 0 ? 1 : -1) : 0; } inline int nzUnicodecasecmp(const char* s1, const char* s2) { - int ret = 0; + int ret = 0; utf8::unchecked::iterator it1(s1); utf8::unchecked::iterator it2(s2); - while (!(ret = NzUnicode::GetLowercase(*it1) - NzUnicode::GetLowercase(*it2)) && *it2) - ++it1, ++it2; + while (!(ret = NzUnicode::GetLowercase(*it1) - NzUnicode::GetLowercase(*it2)) && *it2) + ++it1, ++it2; - return ret != 0 ? (ret > 0 ? 1 : -1) : 0; + return ret != 0 ? (ret > 0 ? 1 : -1) : 0; } NzString::NzString() : @@ -2087,8 +2088,8 @@ bool NzString::Match(const char* pattern) const if (!*++pattern) return true; - mp = pattern; - cp = str+1; + mp = pattern; + cp = str+1; } else if (*pattern == *str || *pattern == '?') { @@ -3977,7 +3978,7 @@ NzString NzString::Unicode(char32_t character) count = 2; else if (character < 0x10000) count = 3; - else + else count = 4; char* str = new char[count+1]; @@ -4028,7 +4029,7 @@ NzString NzString::Unicode(const char32_t* u32String) count += 2; else if (cp < 0x10000) count += 3; - else + else count += 4; } while (*++ptr); @@ -4056,7 +4057,7 @@ NzString NzString::Unicode(const wchar_t* wString) count += 2; else if (cp < 0x10000) count += 3; - else + else count += 4; } while (*++ptr); diff --git a/src/Nazara/Utility/VertexBuffer.cpp b/src/Nazara/Utility/VertexBuffer.cpp index 463917e17..556e5ba92 100644 --- a/src/Nazara/Utility/VertexBuffer.cpp +++ b/src/Nazara/Utility/VertexBuffer.cpp @@ -53,7 +53,7 @@ bool NzVertexBuffer::FillRaw(const void* data, unsigned int offset, unsigned int if (!m_buffer) { NazaraError("No buffer"); - return nullptr; + return false; } if (m_startOffset + offset + size > m_endOffset)