From 1ed7d951936257923754c22c9f877818e0916177 Mon Sep 17 00:00:00 2001 From: Chris Motch Date: Sat, 24 Jan 2015 22:01:47 -0500 Subject: [PATCH 1/2] Fixes to allow Compilation using VC++ 12 Some minor fixes and tweaks to allow compilation under Visual C++ 12. This doesn't include changes that I need to make to the build generation. --- external/rtaudio/RtAudio.cpp | 1 + src/AppFrame.cpp | 4 ++-- src/demod/DemodulatorThread.cpp | 4 ++-- src/sdr/SDRPostThread.cpp | 4 ++-- src/sdr/SDRThread.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/external/rtaudio/RtAudio.cpp b/external/rtaudio/RtAudio.cpp index 24cee6d..6ad1eb5 100644 --- a/external/rtaudio/RtAudio.cpp +++ b/external/rtaudio/RtAudio.cpp @@ -45,6 +45,7 @@ #include #include #include +#include // Static variable definitions. const unsigned int RtApi::MAX_SAMPLE_RATES = 14; diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index ea785d8..a0bcfd5 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -34,7 +34,7 @@ EVT_IDLE(AppFrame::OnIdle) wxEND_EVENT_TABLE() AppFrame::AppFrame() : - wxFrame(NULL, wxID_ANY, wxT(CUBICSDR_TITLE)), activeDemodulator(NULL) { + wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) { wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); wxBoxSizer *demodOpts = new wxBoxSizer(wxVERTICAL); @@ -280,7 +280,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) { wxGetApp().getDemodMgr().terminateAll(); wxGetApp().setFrequency(DEFAULT_FREQ); wxGetApp().setOffset(0); - SetTitle(wxT(CUBICSDR_TITLE)); + SetTitle(CUBICSDR_TITLE); currentSessionFile = ""; } else if (event.GetId() == wxID_EXIT) { Close(false); diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 9f853f6..9f5b257 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -56,7 +56,7 @@ void DemodulatorThread::threadMain() { } unsigned int h_len = estimate_req_filter_len(ft, As); - float h[h_len]; + float *h = new float[h_len]; liquid_firdes_kaiser(h_len, firStereoCutoff, As, mu, h); firStereoLeft = firfilt_rrrf_create(h, h_len); @@ -81,7 +81,7 @@ void DemodulatorThread::threadMain() { float ssbAs = 120.0f; // stop-band attenuation [dB] h_len = estimate_req_filter_len(ssbFt, ssbAs); - float ssb_h[h_len]; + float *ssb_h=new float[h_len]; liquid_firdes_kaiser(h_len, 0.25, ssbAs, 0.0, ssb_h); firfilt_crcf firSSB = firfilt_crcf_create(ssb_h, h_len); diff --git a/src/sdr/SDRPostThread.cpp b/src/sdr/SDRPostThread.cpp index c8b1037..6951d61 100644 --- a/src/sdr/SDRPostThread.cpp +++ b/src/sdr/SDRPostThread.cpp @@ -88,7 +88,7 @@ void SDRPostThread::threadMain() { iirfilt_crcf_execute_block(dcFilter, &fpData[0], dataSize, &dataOut[0]); - if (iqDataOutQueue != NULL) { + if (iqDataOutQueue.load() != NULL) { DemodulatorThreadIQData *pipeDataOut = new DemodulatorThreadIQData; pipeDataOut->frequency = data_in->frequency; @@ -97,7 +97,7 @@ void SDRPostThread::threadMain() { iqDataOutQueue.load()->push(pipeDataOut); } - if (iqVisualQueue != NULL && iqVisualQueue.load()->empty()) { + if (iqVisualQueue.load() != NULL && iqVisualQueue.load()->empty()) { if (visualDataOut->data.size() < num_vis_samples) { if (visualDataOut->data.capacity() < num_vis_samples) { visualDataOut->data.reserve(num_vis_samples); diff --git a/src/sdr/SDRThread.cpp b/src/sdr/SDRThread.cpp index 7596103..0d47918 100644 --- a/src/sdr/SDRThread.cpp +++ b/src/sdr/SDRThread.cpp @@ -262,7 +262,7 @@ void SDRThread::threadMain() { double time_slice = (double) n_read / (double) sampleRate; seconds += time_slice; - if (iqDataOutQueue != NULL) { + if (iqDataOutQueue.load() != NULL) { iqDataOutQueue.load()->push(dataOut); } } From bc991c2cd9a7942a3e2b1f16365d779b5861d84a Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Sun, 25 Jan 2015 01:27:37 -0500 Subject: [PATCH 2/2] dealloc filter init var --- src/demod/DemodulatorThread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 9f5b257..7a2d027 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -62,6 +62,8 @@ void DemodulatorThread::threadMain() { firStereoLeft = firfilt_rrrf_create(h, h_len); firStereoRight = firfilt_rrrf_create(h, h_len); + delete h; + liquid_float_complex x, y; firhilbf firStereoR2C = firhilbf_create(5, 60.0f); @@ -86,6 +88,8 @@ void DemodulatorThread::threadMain() { firfilt_crcf firSSB = firfilt_crcf_create(ssb_h, h_len); + delete ssb_h; + // Automatic IQ gain iqAutoGain = agc_crcf_create(); agc_crcf_set_bandwidth(iqAutoGain, 0.9);