[SCM] calf/master: + fixed_point template: fix rebase and make operator+/operator- actually work

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:27 UTC 2013


The following commit has been merged in the master branch:
commit cb728dfdfd7da49c54647d02fd103c17b32f8910
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Fri Aug 1 19:31:07 2008 +0000

    + fixed_point template: fix rebase and make operator+/operator- actually work
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@247 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/fixed_point.h b/src/calf/fixed_point.h
index 93bcfa9..46aaf46 100644
--- a/src/calf/fixed_point.h
+++ b/src/calf/fixed_point.h
@@ -81,7 +81,7 @@ public:
         return *this;
     }
     
-    template<class U, int FracBits2> inline T rebase(const fixed_point<U, FracBits2> &v) {
+    template<class U, int FracBits2> static inline T rebase(const fixed_point<U, FracBits2> &v) {
         if (FracBits == FracBits2) 
             return v.get();
         if (FracBits > FracBits2) 
@@ -105,11 +105,15 @@ public:
     }
 
     template<class U, int FracBits2> inline fixed_point operator+(const fixed_point<U, FracBits2> &v) const {
-        return value + rebase<U, FracBits2>(v.get());
+        fixed_point fpv;
+        fpv.set(value + rebase<U, FracBits2>(v));
+        return fpv;
     }
 
     template<class U, int FracBits2> inline fixed_point operator-(const fixed_point<U, FracBits2> &v) const {
-        return value - rebase<U, FracBits2>(v.get());
+        fixed_point fpv;
+        fpv.set(value - rebase<U, FracBits2>(v));
+        return fpv;
     }
 
     /// multiply two fixed point values, using long long int to store the temporary multiplication result

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list