From 7b877680bde3f1ba89ed9d0f15d4aefe2d73cda4 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Wed, 6 Jun 2018 15:21:53 +0100 Subject: [PATCH] Remove reference to nonexistant template variable --- src/FixedPoints/SFixed0MemberFunctions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FixedPoints/SFixed0MemberFunctions.h b/src/FixedPoints/SFixed0MemberFunctions.h index 52372c4..d79e3ec 100644 --- a/src/FixedPoints/SFixed0MemberFunctions.h +++ b/src/FixedPoints/SFixed0MemberFunctions.h @@ -68,8 +68,8 @@ constexpr typename SFixed<0, Fraction>::InternalType SFixed<0, Fraction>::getInt template< unsigned Fraction > constexpr typename SFixed<0, Fraction>::IntegerType SFixed<0, Fraction>::getInteger(void) const { - static_assert(false, "UNDEFINED BEHAVIOUR"); - //return (static_cast(this->value >> IntegerShift) & IntegerMask) | ((this->value < 0) ? ~IntegerMask : 0); + //static_assert(false, "UNDEFINED BEHAVIOUR"); + return (static_cast(this->value >> IntegerShift) & IntegerMask) | ((this->value < 0) ? ~IntegerMask : 0); } template< unsigned Fraction > @@ -172,7 +172,7 @@ template< unsigned Fraction > SFixed<0, Fraction> & SFixed<0, Fraction>::operator *=(const SFixed<0, Fraction> & other) { using InternalType = typename SFixed<0, Fraction>::InternalType; - using PrecisionType = typename SFixed::InternalType; + using PrecisionType = typename SFixed<0, Fraction * 2>::InternalType; const PrecisionType temp = (static_cast(this->value) * static_cast(other.value)) >> Fraction; this->value = static_cast(temp); return *this; @@ -182,7 +182,7 @@ template< unsigned Fraction > SFixed<0, Fraction> & SFixed<0, Fraction>::operator /=(const SFixed<0, Fraction> & other) { using InternalType = typename SFixed<0, Fraction>::InternalType; - using PrecisionType = typename SFixed::InternalType; + using PrecisionType = typename SFixed<0, Fraction * 2>::InternalType; const PrecisionType temp = (static_cast(this->value) << Fraction) / static_cast(other.value); this->value = static_cast(temp); return *this;