diff --git a/src/IOThread.cpp b/src/IOThread.cpp index 81345df..d57f5ba 100644 --- a/src/IOThread.cpp +++ b/src/IOThread.cpp @@ -50,7 +50,7 @@ void IOThread::setInputQueue(std::string qname, ThreadQueueBase *threadQueue) { this->onBindInput(qname, threadQueue); }; -void *IOThread::getInputQueue(std::string qname) { +ThreadQueueBase *IOThread::getInputQueue(std::string qname) { return input_queues[qname]; }; @@ -59,7 +59,7 @@ void IOThread::setOutputQueue(std::string qname, ThreadQueueBase *threadQueue) { this->onBindOutput(qname, threadQueue); }; -void *IOThread::getOutputQueue(std::string qname) { +ThreadQueueBase *IOThread::getOutputQueue(std::string qname) { return output_queues[qname]; }; diff --git a/src/IOThread.h b/src/IOThread.h index f67b81e..fd8c1d1 100644 --- a/src/IOThread.h +++ b/src/IOThread.h @@ -115,9 +115,9 @@ public: virtual void onBindInput(std::string name, ThreadQueueBase* threadQueue); void setInputQueue(std::string qname, ThreadQueueBase *threadQueue); - void *getInputQueue(std::string qname); + ThreadQueueBase *getInputQueue(std::string qname); void setOutputQueue(std::string qname, ThreadQueueBase *threadQueue); - void *getOutputQueue(std::string qname); + ThreadQueueBase *getOutputQueue(std::string qname); protected: std::map input_queues; diff --git a/src/audio/AudioThread.cpp b/src/audio/AudioThread.cpp index 2a02a03..23507c4 100644 --- a/src/audio/AudioThread.cpp +++ b/src/audio/AudioThread.cpp @@ -379,8 +379,8 @@ void AudioThread::run() { std::cout << "Audio thread started." << std::endl; - inputQueue = (AudioThreadInputQueue *)getInputQueue("AudioDataInput"); - threadQueueNotify = (DemodulatorThreadCommandQueue*)getOutputQueue("NotifyQueue"); + inputQueue = static_cast(getInputQueue("AudioDataInput")); + threadQueueNotify = static_cast(getOutputQueue("NotifyQueue")); while (!terminated) { AudioThreadCommand command; diff --git a/src/demod/DemodulatorPreThread.cpp b/src/demod/DemodulatorPreThread.cpp index 19161b1..6b128ea 100644 --- a/src/demod/DemodulatorPreThread.cpp +++ b/src/demod/DemodulatorPreThread.cpp @@ -56,9 +56,9 @@ void DemodulatorPreThread::run() { ReBuffer buffers("DemodulatorPreThreadBuffers"); - iqInputQueue = (DemodulatorThreadInputQueue*)getInputQueue("IQDataInput"); - iqOutputQueue = (DemodulatorThreadPostInputQueue*)getOutputQueue("IQDataOutput"); - threadQueueNotify = (DemodulatorThreadCommandQueue*)getOutputQueue("NotifyQueue"); + iqInputQueue = static_cast(getInputQueue("IQDataInput")); + iqOutputQueue = static_cast(getOutputQueue("IQDataOutput")); + threadQueueNotify = static_cast(getOutputQueue("NotifyQueue")); std::vector in_buf_data; std::vector out_buf_data; diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index e8f4036..6d642dd 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -32,7 +32,7 @@ void DemodulatorThread::onBindOutput(std::string name, ThreadQueueBase *threadQu //protects because it may be changed at runtime std::lock_guard < std::mutex > lock(m_mutexAudioVisOutputQueue); - audioVisOutputQueue = (DemodulatorThreadOutputQueue *)threadQueue; + audioVisOutputQueue = static_cast(threadQueue); } } @@ -69,10 +69,10 @@ void DemodulatorThread::run() { std::cout << "Demodulator thread started.." << std::endl; - iqInputQueue = (DemodulatorThreadPostInputQueue*)getInputQueue("IQDataInput"); - audioOutputQueue = (AudioThreadInputQueue*)getOutputQueue("AudioDataOutput"); - threadQueueControl = (DemodulatorThreadControlCommandQueue *)getInputQueue("ControlQueue"); - threadQueueNotify = (DemodulatorThreadCommandQueue*)getOutputQueue("NotifyQueue"); + iqInputQueue = static_cast(getInputQueue("IQDataInput")); + audioOutputQueue = static_cast(getOutputQueue("AudioDataOutput")); + threadQueueControl = static_cast(getInputQueue("ControlQueue")); + threadQueueNotify = static_cast(getOutputQueue("NotifyQueue")); ModemIQData modemData; diff --git a/src/demod/DemodulatorWorkerThread.cpp b/src/demod/DemodulatorWorkerThread.cpp index dd43aaf..3b1a28d 100644 --- a/src/demod/DemodulatorWorkerThread.cpp +++ b/src/demod/DemodulatorWorkerThread.cpp @@ -14,8 +14,8 @@ void DemodulatorWorkerThread::run() { std::cout << "Demodulator worker thread started.." << std::endl; - commandQueue = (DemodulatorThreadWorkerCommandQueue *)getInputQueue("WorkerCommandQueue"); - resultQueue = (DemodulatorThreadWorkerResultQueue *)getOutputQueue("WorkerResultQueue"); + commandQueue = static_cast(getInputQueue("WorkerCommandQueue")); + resultQueue = static_cast(getOutputQueue("WorkerResultQueue")); while (!terminated) { bool filterChanged = false; diff --git a/src/process/FFTVisualDataThread.cpp b/src/process/FFTVisualDataThread.cpp index 88df9e7..86f7caf 100644 --- a/src/process/FFTVisualDataThread.cpp +++ b/src/process/FFTVisualDataThread.cpp @@ -24,8 +24,8 @@ SpectrumVisualProcessor *FFTVisualDataThread::getProcessor() { } void FFTVisualDataThread::run() { - DemodulatorThreadInputQueue *pipeIQDataIn = (DemodulatorThreadInputQueue *)getInputQueue("IQDataInput"); - SpectrumVisualDataQueue *pipeFFTDataOut = (SpectrumVisualDataQueue *)getOutputQueue("FFTDataOutput"); + DemodulatorThreadInputQueue *pipeIQDataIn = static_cast(getInputQueue("IQDataInput")); + SpectrumVisualDataQueue *pipeFFTDataOut = static_cast(getOutputQueue("FFTDataOutput")); fftQueue.set_max_num_items(100); pipeFFTDataOut->set_max_num_items(100); diff --git a/src/sdr/SDRPostThread.cpp b/src/sdr/SDRPostThread.cpp index fe6f62c..8ae854a 100644 --- a/src/sdr/SDRPostThread.cpp +++ b/src/sdr/SDRPostThread.cpp @@ -161,10 +161,10 @@ void SDRPostThread::run() { std::cout << "SDR post-processing thread started.." << std::endl; - iqDataInQueue = (SDRThreadIQDataQueue*)getInputQueue("IQDataInput"); - iqDataOutQueue = (DemodulatorThreadInputQueue*)getOutputQueue("IQDataOutput"); - iqVisualQueue = (DemodulatorThreadInputQueue*)getOutputQueue("IQVisualDataOutput"); - iqActiveDemodVisualQueue = (DemodulatorThreadInputQueue*)getOutputQueue("IQActiveDemodVisualDataOutput"); + iqDataInQueue = static_cast(getInputQueue("IQDataInput")); + iqDataOutQueue = static_cast(getOutputQueue("IQDataOutput")); + iqVisualQueue = static_cast(getOutputQueue("IQVisualDataOutput")); + iqActiveDemodVisualQueue = static_cast(getOutputQueue("IQActiveDemodVisualDataOutput")); iqDataInQueue->set_max_num_items(0); diff --git a/src/sdr/SoapySDRThread.cpp b/src/sdr/SoapySDRThread.cpp index 66c60ee..e3d121e 100644 --- a/src/sdr/SoapySDRThread.cpp +++ b/src/sdr/SoapySDRThread.cpp @@ -216,7 +216,7 @@ void SDRThread::readStream(SDRThreadIQDataQueue* iqDataOutQueue) { } void SDRThread::readLoop() { - SDRThreadIQDataQueue* iqDataOutQueue = (SDRThreadIQDataQueue*) getOutputQueue("IQDataOutput"); + SDRThreadIQDataQueue* iqDataOutQueue = static_cast( getOutputQueue("IQDataOutput")); if (iqDataOutQueue == NULL) { return;