From 64c0c649cd9eafffa8b7949b0e0c69b15f859b54 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 13 Jul 2024 06:49:32 +0200 Subject: [PATCH] compile fixes for apple clang --- ExternalLibs/glm/core/type_half.inl | 22 +++++++++++----------- ExternalLibs/tbsp.hh | 10 ++++++---- ExternalLibs/ttvfs/VFSDebug.h | 1 + 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ExternalLibs/glm/core/type_half.inl b/ExternalLibs/glm/core/type_half.inl index 8166a75..0506d33 100644 --- a/ExternalLibs/glm/core/type_half.inl +++ b/ExternalLibs/glm/core/type_half.inl @@ -7,7 +7,7 @@ // File : glm/core/type_half.inl /////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright: -// This half implementation is based on OpenEXR which is Copyright (c) 2002, +// This half implementation is based on OpenEXR which is Copyright (c) 2002, // Industrial Light & Magic, a division of Lucas Digital Ltd. LLC /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -20,7 +20,7 @@ namespace detail { volatile float f = 1e10; - for(int i = 0; i < 10; ++i) + for(int i = 0; i < 10; ++i) f *= f; // this will overflow before // the for­loop terminates return f; @@ -116,9 +116,9 @@ namespace detail // of float and half (127 versus 15). // - register int s = (i >> 16) & 0x00008000; - register int e = ((i >> 23) & 0x000000ff) - (127 - 15); - register int m = i & 0x007fffff; + int s = (i >> 16) & 0x00008000; + int e = ((i >> 23) & 0x000000ff) - (127 - 15); + int m = i & 0x007fffff; // // Now reassemble s, e and m into a half: @@ -144,7 +144,7 @@ namespace detail // whose magnitude is less than __half_NRM_MIN. // // We convert f to a denormalized _halfGTX. - // + // m = (m | 0x00800000) >> (1 - e); @@ -155,9 +155,9 @@ namespace detail // our number normalized. Because of the way a half's bits // are laid out, we don't have to treat this case separately; // the code below will handle it correctly. - // + // - if(m & 0x00001000) + if(m & 0x00001000) m += 0x00002000; // @@ -183,7 +183,7 @@ namespace detail // F is a NAN; we produce a half NAN that preserves // the sign bit and the 10 leftmost bits of the // significand of f, with one exception: If the 10 - // leftmost bits are all zero, the NAN would turn + // leftmost bits are all zero, the NAN would turn // into an infinity, so we have to set at least one // bit in the significand. // @@ -254,7 +254,7 @@ namespace detail // return toFloat(); //} - GLM_FUNC_QUALIFIER thalf::operator float() const + GLM_FUNC_QUALIFIER thalf::operator float() const { return toFloat32(this->data); } @@ -290,7 +290,7 @@ namespace detail GLM_FUNC_QUALIFIER thalf& thalf::operator*=(thalf const & s) { - data = toFloat16(toFloat32(data) * toFloat32(s.data)); + data = toFloat16(toFloat32(data) * toFloat32(s.data)); return *this; } diff --git a/ExternalLibs/tbsp.hh b/ExternalLibs/tbsp.hh index a94f9e0..8c6f5cb 100644 --- a/ExternalLibs/tbsp.hh +++ b/ExternalLibs/tbsp.hh @@ -365,7 +365,7 @@ public: const size_t n = this->n; tbsp__ASSERT(n == o.n); for(size_t i = 0; i < n; ++i) - s += a.p[i] * b.p[i]; + s += p[i] * o.p[i]; return s; } @@ -410,7 +410,9 @@ struct MatrixAcc // and because math is backwards: // (h x w) * (H x W) -> (h x W) TBSP_ASSERT(size.w == o.size.h); - Size2d wh { o.size.w, size.h }; + Size2d wh; + wh.w = o.size.w; + wh.h = size.h; return wh; } @@ -735,7 +737,7 @@ MatrixAcc generateLeastSquares(T *mem, const MatrixAcc& N) { MatrixAcc M; M.p = mem; - M.size == getLeastSquaresSize(N); + M.size = getLeastSquaresSize(N); T * const pend = M.p + (M.size.w * M.size.h); @@ -974,7 +976,7 @@ void chordal(T *parm, const P *points, size_t n) { const T dist = distance(points[i-1], points[i]); totaldist += dist; - parm[i] = totaldist + parm[i] = totaldist; } // Normalize to 0..1 diff --git a/ExternalLibs/ttvfs/VFSDebug.h b/ExternalLibs/ttvfs/VFSDebug.h index e5da11d..8552d57 100644 --- a/ExternalLibs/ttvfs/VFSDebug.h +++ b/ExternalLibs/ttvfs/VFSDebug.h @@ -2,6 +2,7 @@ #define TTVFS_DEBUG_H #include "VFSDefines.h" +#include #include VFS_NAMESPACE_START