More consistent coding style

This commit is contained in:
Christophe Riccio
2017-08-15 22:04:24 +02:00
parent d1afe662be
commit e76fca75a0
165 changed files with 2560 additions and 2560 deletions

View File

@@ -198,7 +198,7 @@ namespace bitfieldReverse
struct compute_bitfieldReverseStep
{
template<glm::length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const & v, T, T)
GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const& v, T, T)
{
return v;
}
@@ -208,14 +208,14 @@ namespace bitfieldReverse
struct compute_bitfieldReverseStep<true>
{
template<glm::length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const & v, T Mask, T Shift)
GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const& v, T Mask, T Shift)
{
return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
}
};
template<glm::length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> bitfieldReverseOps(glm::vec<L, T, P> const & v)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> bitfieldReverseOps(glm::vec<L, T, P> const& v)
{
glm::vec<L, T, P> x(v);
x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
@@ -1415,7 +1415,7 @@ namespace bitCount
};
template<glm::length_t L, typename T, glm::qualifier P>
static glm::vec<L, int, P> bitCount_bitfield(glm::vec<L, T, P> const & v)
static glm::vec<L, int, P> bitCount_bitfield(glm::vec<L, T, P> const& v)
{
glm::vec<L, typename glm::detail::make_unsigned<T>::type, P> x(*reinterpret_cast<glm::vec<L, typename glm::detail::make_unsigned<T>::type, P> const *>(&v));
x = compute_bitfieldBitCountStep<sizeof(T) * 8 >= 2>::call(x, typename glm::detail::make_unsigned<T>::type(0x5555555555555555ull), typename glm::detail::make_unsigned<T>::type( 1));

View File

@@ -27,7 +27,7 @@ enum comp
};
//template<comp X, comp Y, comp Z, comp W>
//__m128 swizzle(glm::vec4 const & v)
//__m128 swizzle(glm::vec4 const& v)
//{
// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x);
// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);

View File

@@ -3,7 +3,7 @@
#include <cstdio>
#include <vector>
void print_bits(float const & s)
void print_bits(float const& s)
{
union
{
@@ -22,7 +22,7 @@ void print_bits(float const & s)
}
}
void print_10bits(glm::uint const & s)
void print_10bits(glm::uint const& s)
{
printf("10b: ");
for(std::size_t j = 10; j > 0; --j)
@@ -33,7 +33,7 @@ void print_10bits(glm::uint const & s)
}
}
void print_11bits(glm::uint const & s)
void print_11bits(glm::uint const& s)
{
printf("11b: ");
for(std::size_t j = 11; j > 0; --j)
@@ -44,7 +44,7 @@ void print_11bits(glm::uint const & s)
}
}
void print_value(float const & s)
void print_value(float const& s)
{
printf("%2.5f, ", static_cast<double>(s));
print_bits(s);

View File

@@ -178,7 +178,7 @@ namespace taylorCos
glm::vec4 const AngleShift(0.0f, glm::half_pi<float>(), glm::pi<float>(), glm::three_over_two_pi<float>());
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesNewCos(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesNewCos(glm::vec<L, T, P> const& x)
{
glm::vec<L, T, P> const Powed2(x * x);
glm::vec<L, T, P> const Powed4(Powed2 * Powed2);
@@ -193,7 +193,7 @@ namespace taylorCos
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesNewCos6(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesNewCos6(glm::vec<L, T, P> const& x)
{
glm::vec<L, T, P> const Powed2(x * x);
glm::vec<L, T, P> const Powed4(Powed2 * Powed2);
@@ -217,7 +217,7 @@ namespace taylorCos
}
template<glm::length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastCosNew(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastCosNew(glm::vec<L, T, P> const& x)
{
glm::vec<L, T, P> const Angle0_PI(fastAbs(fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
return taylorSeriesNewCos6(x);
@@ -255,13 +255,13 @@ namespace taylorCos
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> deterministic_fmod(glm::vec<L, T, P> const & x, T y)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> deterministic_fmod(glm::vec<L, T, P> const& x, T y)
{
return x - y * trunc(x / y);
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastCosDeterminisctic(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastCosDeterminisctic(glm::vec<L, T, P> const& x)
{
glm::vec<L, T, P> const Angle0_PI(abs(deterministic_fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
glm::vec<L, bool, P> const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec<L, T, P>(glm::half_pi<T>())));
@@ -296,7 +296,7 @@ namespace taylorCos
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesRefCos(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> taylorSeriesRefCos(glm::vec<L, T, P> const& x)
{
return static_cast<T>(1)
- (x * x) / glm::factorial(static_cast<T>(2))
@@ -306,7 +306,7 @@ namespace taylorCos
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastRefCos(glm::vec<L, T, P> const & x)
GLM_FUNC_QUALIFIER glm::vec<L, T, P> fastRefCos(glm::vec<L, T, P> const& x)
{
glm::vec<L, T, P> const Angle0_PI(glm::abs(fmod(x + glm::pi<T>(), glm::two_pi<T>()) - glm::pi<T>()));
// return taylorSeriesRefCos(Angle0_PI);