mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-24 17:26:41 +00:00
compile fixes for apple clang
This commit is contained in:
parent
a046038c33
commit
64c0c649cd
3 changed files with 18 additions and 15 deletions
|
@ -7,7 +7,7 @@
|
||||||
// File : glm/core/type_half.inl
|
// File : glm/core/type_half.inl
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright:
|
// 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
|
// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace detail
|
||||||
{
|
{
|
||||||
volatile float f = 1e10;
|
volatile float f = 1e10;
|
||||||
|
|
||||||
for(int i = 0; i < 10; ++i)
|
for(int i = 0; i < 10; ++i)
|
||||||
f *= f; // this will overflow before
|
f *= f; // this will overflow before
|
||||||
// the forloop terminates
|
// the forloop terminates
|
||||||
return f;
|
return f;
|
||||||
|
@ -116,9 +116,9 @@ namespace detail
|
||||||
// of float and half (127 versus 15).
|
// of float and half (127 versus 15).
|
||||||
//
|
//
|
||||||
|
|
||||||
register int s = (i >> 16) & 0x00008000;
|
int s = (i >> 16) & 0x00008000;
|
||||||
register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
|
int e = ((i >> 23) & 0x000000ff) - (127 - 15);
|
||||||
register int m = i & 0x007fffff;
|
int m = i & 0x007fffff;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now reassemble s, e and m into a half:
|
// Now reassemble s, e and m into a half:
|
||||||
|
@ -144,7 +144,7 @@ namespace detail
|
||||||
// whose magnitude is less than __half_NRM_MIN.
|
// whose magnitude is less than __half_NRM_MIN.
|
||||||
//
|
//
|
||||||
// We convert f to a denormalized _halfGTX.
|
// We convert f to a denormalized _halfGTX.
|
||||||
//
|
//
|
||||||
|
|
||||||
m = (m | 0x00800000) >> (1 - e);
|
m = (m | 0x00800000) >> (1 - e);
|
||||||
|
|
||||||
|
@ -155,9 +155,9 @@ namespace detail
|
||||||
// our number normalized. Because of the way a half's bits
|
// our number normalized. Because of the way a half's bits
|
||||||
// are laid out, we don't have to treat this case separately;
|
// are laid out, we don't have to treat this case separately;
|
||||||
// the code below will handle it correctly.
|
// the code below will handle it correctly.
|
||||||
//
|
//
|
||||||
|
|
||||||
if(m & 0x00001000)
|
if(m & 0x00001000)
|
||||||
m += 0x00002000;
|
m += 0x00002000;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -183,7 +183,7 @@ namespace detail
|
||||||
// F is a NAN; we produce a half NAN that preserves
|
// F is a NAN; we produce a half NAN that preserves
|
||||||
// the sign bit and the 10 leftmost bits of the
|
// the sign bit and the 10 leftmost bits of the
|
||||||
// significand of f, with one exception: If the 10
|
// 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
|
// into an infinity, so we have to set at least one
|
||||||
// bit in the significand.
|
// bit in the significand.
|
||||||
//
|
//
|
||||||
|
@ -254,7 +254,7 @@ namespace detail
|
||||||
// return toFloat();
|
// return toFloat();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER thalf::operator float() const
|
GLM_FUNC_QUALIFIER thalf::operator float() const
|
||||||
{
|
{
|
||||||
return toFloat32(this->data);
|
return toFloat32(this->data);
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ namespace detail
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER thalf& thalf::operator*=(thalf const & s)
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,7 +365,7 @@ public:
|
||||||
const size_t n = this->n;
|
const size_t n = this->n;
|
||||||
tbsp__ASSERT(n == o.n);
|
tbsp__ASSERT(n == o.n);
|
||||||
for(size_t i = 0; i < n; ++i)
|
for(size_t i = 0; i < n; ++i)
|
||||||
s += a.p[i] * b.p[i];
|
s += p[i] * o.p[i];
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,9 @@ struct MatrixAcc
|
||||||
// and because math is backwards:
|
// and because math is backwards:
|
||||||
// (h x w) * (H x W) -> (h x W)
|
// (h x w) * (H x W) -> (h x W)
|
||||||
TBSP_ASSERT(size.w == o.size.h);
|
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;
|
return wh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,7 +737,7 @@ MatrixAcc<T> generateLeastSquares(T *mem, const MatrixAcc<T>& N)
|
||||||
{
|
{
|
||||||
MatrixAcc<T> M;
|
MatrixAcc<T> M;
|
||||||
M.p = mem;
|
M.p = mem;
|
||||||
M.size == getLeastSquaresSize(N);
|
M.size = getLeastSquaresSize(N);
|
||||||
|
|
||||||
T * const pend = M.p + (M.size.w * M.size.h);
|
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]);
|
const T dist = distance(points[i-1], points[i]);
|
||||||
totaldist += dist;
|
totaldist += dist;
|
||||||
parm[i] = totaldist
|
parm[i] = totaldist;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalize to 0..1
|
// Normalize to 0..1
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define TTVFS_DEBUG_H
|
#define TTVFS_DEBUG_H
|
||||||
|
|
||||||
#include "VFSDefines.h"
|
#include "VFSDefines.h"
|
||||||
|
#include <stddef.h>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
VFS_NAMESPACE_START
|
VFS_NAMESPACE_START
|
||||||
|
|
Loading…
Reference in a new issue