[135830] trunk/dports/science/gqrx

michaelld at macports.org michaelld at macports.org
Mon May 4 12:19:26 PDT 2015


Revision: 135830
          https://trac.macports.org/changeset/135830
Author:   michaelld at macports.org
Date:     2015-05-04 12:19:26 -0700 (Mon, 04 May 2015)
Log Message:
-----------
gqrx: add patch to fix building using clang / libc++, while keeping the code working with gcc / libstdc++.

Modified Paths:
--------------
    trunk/dports/science/gqrx/Portfile

Added Paths:
-----------
    trunk/dports/science/gqrx/files/patch-fix-agc_impl_complex.diff

Modified: trunk/dports/science/gqrx/Portfile
===================================================================
--- trunk/dports/science/gqrx/Portfile	2015-05-04 18:56:41 UTC (rev 135829)
+++ trunk/dports/science/gqrx/Portfile	2015-05-04 19:19:26 UTC (rev 135830)
@@ -30,6 +30,10 @@
 
     patchfiles-append   patch-gqrx.pro.diff
 
+    # fix AGC complex
+
+    patchfiles-append   patch-fix-agc_impl_complex.diff
+
     # allow gqrx to work with both gnuradio and gnuradio-devel ...
 
     depends_lib-append  port:gr-osmosdr \

Added: trunk/dports/science/gqrx/files/patch-fix-agc_impl_complex.diff
===================================================================
--- trunk/dports/science/gqrx/files/patch-fix-agc_impl_complex.diff	                        (rev 0)
+++ trunk/dports/science/gqrx/files/patch-fix-agc_impl_complex.diff	2015-05-04 19:19:26 UTC (rev 135830)
@@ -0,0 +1,64 @@
+--- dsp/agc_impl.cpp.orig
++++ dsp/agc_impl.cpp
+@@ -88,6 +88,7 @@ CAgc::CAgc()
+     m_SlopeFactor = 0;
+     m_Decay = 0;
+     m_SampleRate = 100.0;
++    m_SigDelayBuf_r = (float*)(&m_SigDelayBuf);
+ }
+ 
+ CAgc::~CAgc()
+@@ -126,8 +127,7 @@ void CAgc::SetParameters(bool AgcOn,  bool UseHang, int Threshold, int ManualGai
+         m_SampleRate = SampleRate;
+         for (int i = 0; i < MAX_DELAY_BUF; i++)
+         {
+-            m_SigDelayBuf[i].real() = 0.0;
+-            m_SigDelayBuf[i].imag() = 0.0;
++            m_SigDelayBuf[i] = 0.0;
+             m_MagBuf[i] = -16.0;
+         }
+         m_SigDelayPtr = 0;
+@@ -292,8 +292,7 @@ void CAgc::ProcessData(int Length, const TYPECPX * pInData, TYPECPX * pOutData)
+                 // use variable gain if above knee
+                 gain = AGC_OUTSCALE * powf(10.0, mag * (m_GainSlope - 1.0));
+ 
+-            pOutData[i].real() = delayedin.real() * gain;
+-            pOutData[i].imag() = delayedin.imag() * gain;
++            pOutData[i] = delayedin * gain;
+         }
+     }
+     else
+@@ -301,8 +300,7 @@ void CAgc::ProcessData(int Length, const TYPECPX * pInData, TYPECPX * pOutData)
+         // manual gain just multiply by m_ManualGain
+         for (int i = 0; i < Length; i++)
+         {
+-            pOutData[i].real() = m_ManualAgcGain * pInData[i].real();
+-            pOutData[i].imag() = m_ManualAgcGain * pInData[i].imag();
++            pOutData[i] = m_ManualAgcGain * pInData[i];
+         }
+     }
+ }
+@@ -324,10 +322,10 @@ void CAgc::ProcessData(int Length, const float *pInData, float * pOutData)
+             float in = pInData[i];
+ 
+             // Get delayed sample of input signal
+-            delayedin = m_SigDelayBuf[m_SigDelayPtr].real();
++            delayedin = m_SigDelayBuf_r[m_SigDelayPtr];
+ 
+             // put new input sample into signal delay buffer
+-            m_SigDelayBuf[m_SigDelayPtr++].real() = in;
++            m_SigDelayBuf_r[m_SigDelayPtr++] = in;
+             if (m_SigDelayPtr >= m_DelaySamples) //deal with delay buffer wrap around
+                 m_SigDelayPtr = 0;
+ 
+--- dsp/agc_impl.h.orig
++++ dsp/agc_impl.h
+@@ -72,6 +72,8 @@ private:
+     int         m_HangTimer;
+ 
+     TYPECPX     m_SigDelayBuf[MAX_DELAY_BUF];
++    float*      m_SigDelayBuf_r;
++
+     float       m_MagBuf[MAX_DELAY_BUF];
+ };
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150504/5c05f9db/attachment.html>


More information about the macports-changes mailing list