Skip to content

Commit

Permalink
Merge pull request #2243 from DreamNik/fix_warnings_and_android_issues
Browse files Browse the repository at this point in the history
Fix warnings and android issues
  • Loading branch information
f4exb authored Sep 4, 2024
2 parents 5d0fa7f + b0e9193 commit fe1fe84
Show file tree
Hide file tree
Showing 243 changed files with 442 additions and 439 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ else()
endif()
set(INSTALL_PLUGINS_DIR "${INSTALL_LIB_DIR}/plugins")
set(INSTALL_PLUGINSSRV_DIR "${INSTALL_LIB_DIR}/pluginssrv")

if(ANDROID)
set(PLUGINS_PREFIX "sdrangel_plugins_")
set(PLUGINSSRV_PREFIX "sdrangel_pluginssrv_")
else()
set(PLUGINS_PREFIX "")
set(PLUGINSSRV_PREFIX "")
endif()
set(EXTERNAL_BUILD_LIBRARIES "${CMAKE_BINARY_DIR}/external")

# custom libraries
Expand Down Expand Up @@ -579,6 +587,7 @@ elseif(ANDROID)
CACHE INTERNAL ""
)
endif()
add_compile_definitions(ANDROID)
endif()

# When building a bundle on MacOS, we want to keep build paths in the library
Expand Down Expand Up @@ -659,6 +668,7 @@ if (BUILD_GUI)
if (ENABLE_QT6)
find_package(Qt6
REQUIRED COMPONENTS
Location
OpenGL
OpenGLWidgets
Quick
Expand Down
5 changes: 5 additions & 0 deletions devices/soapysdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ set_target_properties(soapysdrdevice

target_link_libraries(soapysdrdevice
${SOAPYSDR_LINK_LIBRARIES}
${SOAPYSDR_LIBRARIES}
sdrbase
)

target_link_directories(soapysdrdevice PRIVATE
${SOAPYSDR_LIBRARY_DIRS}
)

if(SOAPYSDR_EXTERNAL AND NOT LINUX)
add_dependencies(soapysdrdevice soapysdr)
endif()
Expand Down
3 changes: 2 additions & 1 deletion ft8/ft8.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ struct FT8_API cdecode
// total transmission time is 12.64 seconds

// tunable parameters
struct FT8_API FT8Params
class FT8_API FT8Params
{
public:
int nthreads; // number of parallel threads, for multi-core
int npasses_one; // number of spectral subtraction passes
int npasses_two; // number of spectral subtraction passes
Expand Down
2 changes: 1 addition & 1 deletion httpserver/httpconnectionhandlerpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void HttpConnectionHandlerPool::cleanup()
if (++idleCounter > maxIdleHandlers)
{
pool.removeOne(handler);
qDebug("HttpConnectionHandlerPool: Removed connection handler (%p), pool size is now %i",handler,pool.size());
qDebug("HttpConnectionHandlerPool: Removed connection handler (%p), pool size is now %i",handler,(int)pool.size());
delete handler;
break; // remove only one handler in each interval
}
Expand Down
4 changes: 2 additions & 2 deletions httpserver/staticfilecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ StaticFileController::StaticFileController(QSettings* settings, QObject* parent)
maxCachedFileSize=settings->value("maxCachedFileSize","65536").toInt();
cache.setMaxCost(settings->value("cacheSize","1000000").toInt());
cacheTimeout=settings->value("cacheTime","60000").toInt();
qDebug("StaticFileController: cache timeout=%i, size=%i",cacheTimeout,cache.maxCost());
qDebug("StaticFileController: cache timeout=%i, size=%i",cacheTimeout,(int)cache.maxCost());
}

StaticFileController::StaticFileController(const HttpDocrootSettings& settings, QObject* parent)
Expand All @@ -56,7 +56,7 @@ StaticFileController::StaticFileController(const HttpDocrootSettings& settings,
maxCachedFileSize=settings.maxCachedFileSize;
cache.setMaxCost(settings.cacheSize);
cacheTimeout=settings.cacheTime;
qDebug("StaticFileController: cache timeout=%i, size=%i",cacheTimeout,cache.maxCost());
qDebug("StaticFileController: cache timeout=%i, size=%i",cacheTimeout,(int)cache.maxCost());
}

void StaticFileController::service(HttpRequest& request, HttpResponse& response)
Expand Down
2 changes: 1 addition & 1 deletion modemm17/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ constexpr T to_int(uint8_t v)
{
constexpr auto MAX_LOCAL_INPUT = (1 << (n - 1));
constexpr auto NEGATIVE_OFFSET = std::numeric_limits<typename std::make_unsigned<T>::type>::max() - (MAX_LOCAL_INPUT - 1);
T r = v & (1 << (n - 1)) ? NEGATIVE_OFFSET : 0;
T r = v & (1 << (n - 1)) ? (T)NEGATIVE_OFFSET : 0;
return r + (v & (MAX_LOCAL_INPUT - 1));
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/channelmimo/beamsteeringcwmod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ if (NOT SERVER_MODE)
beamsteeringcwmodgui.h
)

set(TARGET_NAME beamsteeringcwmod)
set(TARGET_NAME ${PLUGINS_PREFIX}beamsteeringcwmod)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME beamsteeringcwmodsrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}beamsteeringcwmodsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
4 changes: 0 additions & 4 deletions plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,13 @@ class BeamSteeringCWMod: public MIMOChannel, public ChannelAPI
BeamSteeringCWModBaseband* m_basebandSource;
QMutex m_mutex;
bool m_running;
BasebandSampleSink* m_spectrumSink;
BasebandSampleSink* m_scopeSink;
BeamSteeringCWModSettings m_settings;

QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;

int64_t m_frequencyOffset;
uint32_t m_basebandSampleRate;
int m_count0;
int m_count1;

bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const BeamSteeringCWModSettings& settings, bool force = false);
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelmimo/doa2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ if (NOT SERVER_MODE)
doa2compass.cpp
)

set(TARGET_NAME doa2)
set(TARGET_NAME ${PLUGINS_PREFIX}doa2)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME doa2srv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}doa2srv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
2 changes: 0 additions & 2 deletions plugins/channelmimo/doa2/doa2.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ class DOA2: public MIMOChannel, public ChannelAPI
int64_t m_frequencyOffset;
uint32_t m_deviceSampleRate;
qint64 m_deviceCenterFrequency;
int m_count0;
int m_count1;

bool handleMessage(const Message& cmd) final; //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const DOA2Settings& settings, bool force = false);
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelmimo/doa2/doa2corr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool DOA2Correlator::performFFTProd(
m_fft[0]->out() + m_fftSize,
m_dataj,
m_invFFT->in(),
[this](std::complex<float>& a, const std::complex<float>& b) -> std::complex<float> {
[](std::complex<float>& a, const std::complex<float>& b) -> std::complex<float> {
return (a*b);
}
);
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelmimo/doa2/doa2streamsink.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class DOA2StreamSink : public ChannelSampleSink
int m_dataSize;
int m_bufferSize;
int m_dataStart;

uint32_t m_log2Decim;
uint32_t m_filterChainHash;
};


Expand Down
4 changes: 2 additions & 2 deletions plugins/channelmimo/interferometer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ if (NOT SERVER_MODE)
interferometergui.h
)

set(TARGET_NAME interferometer)
set(TARGET_NAME ${PLUGINS_PREFIX}interferometer)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME interferometersrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}interferometersrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
2 changes: 0 additions & 2 deletions plugins/channelmimo/interferometer/interferometer.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ class Interferometer: public MIMOChannel, public ChannelAPI
uint64_t m_centerFrequency;
int64_t m_frequencyOffset;
uint32_t m_deviceSampleRate;
int m_count0;
int m_count1;

QList<int> m_localInputDeviceIndexes;

Expand Down
2 changes: 1 addition & 1 deletion plugins/channelmimo/interferometer/interferometercorr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ bool InterferometerCorrelator::performFFTProd(
m_fft2[0]->out() + m_fftSize,
m_dataj,
m_invFFT2->in(),
[this](std::complex<float>& a, const std::complex<float>& b) -> std::complex<float> {
[](std::complex<float>& a, const std::complex<float>& b) -> std::complex<float> {
return (a*b);
}
);
Expand Down
3 changes: 0 additions & 3 deletions plugins/channelmimo/interferometer/interferometerstreamsink.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class InterferometerStreamSink : public ChannelSampleSink
int m_dataSize;
int m_bufferSize;
int m_dataStart;

uint32_t m_log2Decim;
uint32_t m_filterChainHash;
};


Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/chanalyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include_directories(
${Boost_INCLUDE_DIRS}
)

set(TARGET_NAME chanalyzer)
set(TARGET_NAME ${PLUGINS_PREFIX}chanalyzer)
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})

add_library(${TARGET_NAME} SHARED
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/channelpower/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ if(NOT SERVER_MODE)
channelpowergui.h
)

set(TARGET_NAME channelpower)
set(TARGET_NAME ${PLUGINS_PREFIX}channelpower)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME channelpowersrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}channelpowersrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/channelpower/channelpowersink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
#include "channelpowersink.h"

ChannelPowerSink::ChannelPowerSink(ChannelPower *channelPower) :
m_channelPower(channelPower),
m_channelSampleRate(10000),
m_channelFrequencyOffset(0),
m_lowpassFFT(nullptr),
m_lowpassBufferIdx(0)
{
(void)channelPower;

resetMagLevels();

applySettings(m_settings, QStringList(), true);
Expand All @@ -41,7 +42,6 @@ ChannelPowerSink::~ChannelPowerSink()
void ChannelPowerSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
{
QMutexLocker mutexLocker(&m_mutex);
Complex ci;

for (SampleVector::const_iterator it = begin; it != end; ++it)
{
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/channelpower/channelpowersink.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class ChannelPowerSink : public ChannelSampleSink {

private:

ChannelPower *m_channelPower;
ChannelPowerSettings m_settings;
ChannelAPI *m_channel;
int m_channelSampleRate;
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodadsb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ if(NOT SERVER_MODE)
osndb.h
)

set(TARGET_NAME demodadsb)
set(TARGET_NAME ${PLUGINS_PREFIX}demodadsb)
set(TARGET_LIB Qt::Widgets Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::Location Qt::TextToSpeech)
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodadsbsrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}demodadsbsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodadsb/adsbdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4991,7 +4991,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
m_azEl.setLocation(stationLatitude, stationLongitude, stationAltitude);

// These are the default values in sdrbase/settings/preferences.cpp
if ((stationLatitude == 49.012423) && (stationLongitude == 8.418125)) {
if ((stationLatitude == (float)49.012423) && (stationLongitude == (float)8.418125)) {
ui->warning->setText("Please set your antenna location under Preferences > My Position");
}

Expand Down
4 changes: 4 additions & 0 deletions plugins/channelrx/demodadsb/adsbdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ class ModelMatch {
{
m_aircraftRegExp.optimize();
}

virtual ~ModelMatch()
{
}

virtual bool match(const QString &aircraft, const QString &manufacturer, QString &model)
{
Expand Down
1 change: 0 additions & 1 deletion plugins/channelrx/demodadsb/adsbdemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ void ADSBDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
for (SampleVector::const_iterator it = begin; it != end; ++it)
{
Complex c(it->real(), it->imag());
Complex ci;
c *= m_nco.nextIQ();
processOneSample(complexMagSq(c));
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodais/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ if(NOT SERVER_MODE)
aisdemodgui.h
)

set(TARGET_NAME demodais)
set(TARGET_NAME ${PLUGINS_PREFIX}demodais)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodaissrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}demodaissrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
2 changes: 0 additions & 2 deletions plugins/channelrx/demodais/aisdemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ void AISDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV

void AISDemodSink::processOneSample(Complex &ci)
{
Complex ca;

// FM demodulation
double magsqRaw;
Real deviation;
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ if(NOT SERVER_MODE)
amdemodssbdialog.h
)

set(TARGET_NAME demodam)
set(TARGET_NAME ${PLUGINS_PREFIX}demodam)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodamsrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}demodamsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodam/amdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void AMDemodGUI::snapClicked()
{
applySnap();

qint64 value;
qint64 value = 0;

if (m_settings.m_frequencyMode == AMDemodSettings::Offset) {
value = m_settings.m_inputFrequencyOffset;
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demodapt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ if(NOT SERVER_MODE)
aptdemodselectdialog.h
)

set(TARGET_NAME demodapt)
set(TARGET_NAME ${PLUGINS_PREFIX}demodapt)
set(TARGET_LIB "Qt::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodaptsrv)
set(TARGET_NAME ${PLUGINSSRV_PREFIX}demodaptsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
Expand Down
5 changes: 2 additions & 3 deletions plugins/channelrx/demodapt/aptdemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "aptdemodsink.h"

APTDemodSink::APTDemodSink(APTDemod *packetDemod) :
m_aptDemod(packetDemod),
m_channelSampleRate(APTDEMOD_AUDIO_SAMPLE_RATE),
m_channelFrequencyOffset(0),
m_magsqSum(0.0f),
Expand All @@ -33,6 +32,8 @@ APTDemodSink::APTDemodSink(APTDemod *packetDemod) :
m_imageWorkerMessageQueue(nullptr),
m_samples(nullptr)
{
(void)packetDemod;

m_magsq = 0.0;

applySettings(m_settings, true);
Expand Down Expand Up @@ -129,8 +130,6 @@ void APTDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV

void APTDemodSink::processOneSample(Complex &ci)
{
Complex ca;

// FM demodulation
double magsqRaw;
Real deviation;
Expand Down
Loading

0 comments on commit fe1fe84

Please sign in to comment.