From df0e4b43d4ff4464d1054e11a42c4a096850c68b Mon Sep 17 00:00:00 2001 From: aiekick Date: Mon, 18 Mar 2024 23:44:32 +0100 Subject: [PATCH] [RFR] : fix many warnings with MSVC and CLANG --- include/ctools/GLVersionChecker.h | 2 +- include/ctools/cTools.h | 12 +++++++----- src/GLVersionChecker.cpp | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/ctools/GLVersionChecker.h b/include/ctools/GLVersionChecker.h index 8085779..a385209 100644 --- a/include/ctools/GLVersionChecker.h +++ b/include/ctools/GLVersionChecker.h @@ -24,7 +24,7 @@ SOFTWARE. #pragma once #pragma warning(disable : 4251) -#include "cTools.h" +#include #include #ifdef MSVC diff --git a/include/ctools/cTools.h b/include/ctools/cTools.h index d1bc712..e0d5b18 100644 --- a/include/ctools/cTools.h +++ b/include/ctools/cTools.h @@ -1690,7 +1690,7 @@ using u64vec3 = vec3; CTOOLS_API inline bool valid(const fvec3& a) { return floatIsValid(a.x) && floatIsValid(a.y) && floatIsValid(a.z); } -// specialization for fvec2 +// specialization for fvec3 CTOOLS_API inline bool operator==(const fvec3& v, const fvec3& f) { return IS_FLOAT_EQUAL(f.x, v.x) && IS_FLOAT_EQUAL(f.y, v.y) && IS_FLOAT_EQUAL(f.z, v.z); } @@ -2098,17 +2098,19 @@ using u32vec4 = vec4; using u64vec4 = vec4; // specialization for float32 test to fvec4 -CTOOLS_API inline bool valid(const fvec4& a) { +inline bool valid(const fvec4& a) { return floatIsValid(a.x) && floatIsValid(a.y) && floatIsValid(a.z) && floatIsValid(a.w); } // specialization for fvec4 -CTOOLS_API inline bool operator==(const fvec4& v, const fvec4& f) { +/*template <> +inline bool operator==(fvec4 v, fvec4 f) { return IS_FLOAT_EQUAL(f.x, v.x) && IS_FLOAT_EQUAL(f.y, v.y) && IS_FLOAT_EQUAL(f.z, v.z) && IS_FLOAT_EQUAL(f.w, v.w); } -CTOOLS_API inline bool operator!=(const fvec4& v, const fvec4& f) { +template <> +inline bool operator!=(fvec4 v, fvec4 f) { return IS_FLOAT_DIFFERENT(f.x, v.x) || IS_FLOAT_DIFFERENT(f.y, v.y) || IS_FLOAT_DIFFERENT(f.z, v.z) || IS_FLOAT_DIFFERENT(f.w, v.w); -} +}*/ ///////////////////////////////////////////////////////////////////////// template diff --git a/src/GLVersionChecker.cpp b/src/GLVersionChecker.cpp index 05a03d8..e287df9 100644 --- a/src/GLVersionChecker.cpp +++ b/src/GLVersionChecker.cpp @@ -240,6 +240,7 @@ void OpenglInfosStruct::fill() } #ifdef IMGUI_INCLUDE +#include IMGUI_INCLUDE void OpenglInfosStruct::drawImGui() { if (ImGui::BeginMenu("Opengl Infos"))