Skip to content

Commit

Permalink
Merge pull request #2245 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 12, 2024
2 parents 37e06de + d2e89b7 commit d6773ea
Show file tree
Hide file tree
Showing 277 changed files with 478 additions and 507 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
2 changes: 1 addition & 1 deletion plugins/channelrx/channelpower/channelpower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ChannelPower::ChannelPower(DeviceAPI *deviceAPI) :
{
setObjectName(m_channelId);

m_basebandSink = new ChannelPowerBaseband(this);
m_basebandSink = new ChannelPowerBaseband();
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);

Expand Down
3 changes: 1 addition & 2 deletions plugins/channelrx/channelpower/channelpowerbaseband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@

MESSAGE_CLASS_DEFINITION(ChannelPowerBaseband::MsgConfigureChannelPowerBaseband, Message)

ChannelPowerBaseband::ChannelPowerBaseband(ChannelPower *channelPower) :
m_sink(channelPower),
ChannelPowerBaseband::ChannelPowerBaseband() :
m_running(false)
{
qDebug("ChannelPowerBaseband::ChannelPowerBaseband");
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/channelpower/channelpowerbaseband.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ChannelPowerBaseband : public QObject
{ }
};

ChannelPowerBaseband(ChannelPower *channelPower);
ChannelPowerBaseband();
~ChannelPowerBaseband();
void reset();
void startWork();
Expand Down
4 changes: 1 addition & 3 deletions plugins/channelrx/channelpower/channelpowersink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

#include "channelpowersink.h"

ChannelPowerSink::ChannelPowerSink(ChannelPower *channelPower) :
m_channelPower(channelPower),
ChannelPowerSink::ChannelPowerSink() :
m_channelSampleRate(10000),
m_channelFrequencyOffset(0),
m_lowpassFFT(nullptr),
Expand All @@ -41,7 +40,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
3 changes: 1 addition & 2 deletions plugins/channelrx/channelpower/channelpowersink.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ChannelPower;

class ChannelPowerSink : public ChannelSampleSink {
public:
ChannelPowerSink(ChannelPower *channelPower);
ChannelPowerSink();
~ChannelPowerSink();

virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
Expand Down 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
2 changes: 2 additions & 0 deletions plugins/channelrx/demodadsb/adsbdemodgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ class ModelMatch {
{
m_aircraftRegExp.optimize();
}

virtual ~ModelMatch() = default;

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
Loading

0 comments on commit d6773ea

Please sign in to comment.