-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings and android issues #2245
Conversation
Android libraries can't be placed inside subdirectory, so to distinguish plugins from regular libraries the new prefix is used.
@@ -21,12 +21,13 @@ | |||
#include "channelpowersink.h" | |||
|
|||
ChannelPowerSink::ChannelPowerSink(ChannelPower *channelPower) : | |||
m_channelPower(channelPower), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be removed from the constructor parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -811,6 +811,10 @@ class ModelMatch { | |||
{ | |||
m_aircraftRegExp.optimize(); | |||
} | |||
|
|||
virtual ~ModelMatch() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or "virtual ~ModelMatch = default" or better "~ModelMatch final = default"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, default semantics is better :)
I'll keep virtual destructor, because class isn't final, so finalizing it's destruction less consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, there are lot of warnings like "warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]". So marking destructor final causes more warnings.
@@ -24,7 +24,6 @@ | |||
#include "aptdemodsink.h" | |||
|
|||
APTDemodSink::APTDemodSink(APTDemod *packetDemod) : | |||
m_aptDemod(packetDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark as with channelpowersink.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -488,7 +488,6 @@ void DABDemodSink::processOneAudioSample(Complex &ci) | |||
} | |||
|
|||
DABDemodSink::DABDemodSink(DABDemod *packetDemod) : | |||
m_dabDemod(packetDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -31,7 +31,6 @@ | |||
ILSDemodSink::ILSDemodSink(ILSDemod *ilsDemod) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -28,7 +28,6 @@ | |||
#include "navtexdemodsink.h" | |||
|
|||
NavtexDemodSink::NavtexDemodSink(NavtexDemod *packetDemod) : | |||
m_navtexDemod(packetDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -30,7 +30,6 @@ | |||
|
|||
PagerDemodSink::PagerDemodSink(PagerDemod *pagerDemod) : | |||
m_scopeSink(nullptr), | |||
m_pagerDemod(pagerDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -29,7 +29,6 @@ | |||
#include "rttydemodsink.h" | |||
|
|||
RttyDemodSink::RttyDemodSink(RttyDemod *packetDemod) : | |||
m_rttyDemod(packetDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -27,7 +27,6 @@ | |||
#include "freqscannersink.h" | |||
|
|||
FreqScannerSink::FreqScannerSink(FreqScanner *ilsDemod) : | |||
m_freqScanner(ilsDemod), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -26,7 +26,6 @@ | |||
|
|||
HeatMapSink::HeatMapSink(HeatMap *heatMap) : | |||
m_scopeSink(nullptr), | |||
m_heatMap(heatMap), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -42,7 +42,7 @@ struct LocalSinkSettings | |||
uint32_t m_log2FFT; | |||
FFTWindow::Function m_fftWindow; | |||
bool m_reverseFilter; | |||
static const uint32_t m_maxFFTBands = 20; | |||
uint32_t m_maxFFTBands; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not keep it as static const ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is it throws error that m_maxFFTBands couldn't be resolved.
Because "static const" member isn't definition but rather a declaration.
@@ -53,6 +53,7 @@ void LocalSinkSettings::resetToDefaults() | |||
m_reverseAPIChannelIndex = 0; | |||
m_workspaceIndex = 0; | |||
m_hidden = false; | |||
m_maxFFTBands = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 32 and not leave it at 20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, leftovers from experiments :) I'll undo the change.
@@ -26,7 +26,6 @@ | |||
#include "noisefiguresink.h" | |||
|
|||
NoiseFigureSink::NoiseFigureSink(NoiseFigure *noiseFigure) : | |||
m_noiseFigure(noiseFigure), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -28,7 +28,6 @@ | |||
|
|||
RadioClockSink::RadioClockSink(RadioClock *radioClock) : | |||
m_scopeSink(nullptr), | |||
m_radioClock(radioClock), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove from constructor parameters if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -54,8 +54,7 @@ FileSource::FileSource(DeviceAPI *deviceAPI) : | |||
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSource), | |||
m_deviceAPI(deviceAPI), | |||
m_frequencyOffset(0), | |||
m_basebandSampleRate(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing it from the initialization list ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"m_linearGain" is never used.
And the line with 'm_basebandSampleRate' only got comma removed.
@@ -273,8 +273,6 @@ int DVB2::next_ts_frame_base( u8 *ts ) | |||
} | |||
DVB2::DVB2(void) | |||
{ | |||
// Clear the transport queue | |||
m_tp_q.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_tp_q appears to be unused so it can be removed from the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in "unpack_transport_packet_add_crc" as a temporary storage. But I think it's kept inside class to (maybe?) reuse some internal structures.
sampleMic = (int)((signed char) buffer[b++]) << 8; | ||
sampleMic += (int)((unsigned char)buffer[b++]); | ||
// sampleMic | ||
b+=2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it !
@@ -66,7 +66,7 @@ uint32_t RTPRandom::PickSeed() | |||
#else | |||
x += (uint32_t)clock(); | |||
#endif | |||
x ^= (uint32_t)((uint8_t *)this - (uint8_t *)0); | |||
x ^= (uint32_t)(size_t)this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is substantially different from the original. Did you test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rtprandom.cpp:69:37: Performing pointer subtraction with a null pointer may have undefined behavior"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, for C this is definitely UB. For C++ this should be valid conversion. To make compiler happy i've changed it.
Since this is just a random number generator and converting pointer to integer is valid operation, should be ok.
@@ -18,7 +18,13 @@ | |||
|
|||
#include <QOpenGLShaderProgram> | |||
#include <QOpenGLFunctions> | |||
#include <QOpenGLFunctions_3_3_Core> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it not in the #else next? Did you test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix that. Don't know why, maybe copy-paste from glshadertvarray.h.
Shouldn't be an issue since none of the QOpenGLFunctions_*_Core headers are used. Probably safe to remove this include completely. But I can't test for all platforms, so I'll keep the include.
@@ -3065,7 +3065,7 @@ void MainWindow::keyPressEvent(QKeyEvent* event) | |||
} | |||
} | |||
|
|||
void MainWindow::orientationChanged(Qt::ScreenOrientation orientation) const | |||
void MainWindow::orientationChanged(Qt::ScreenOrientation orientation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any valid reason to remove const ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "setTabPosition" ,ethod is non-const, so calling it from const method isn't correct.
@@ -229,7 +229,7 @@ private slots: | |||
void openDeviceSetPresetsDialog(QPoint p, const DeviceGUI *deviceGUI); | |||
void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release) const; | |||
void fftWisdomProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); | |||
void orientationChanged(Qt::ScreenOrientation orientation) const; | |||
void orientationChanged(Qt::ScreenOrientation orientation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any valid reason to remove const ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "setTabPosition" ,ethod is non-const, so calling it from const method isn't correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a code smell pointed out by Sonarlint so I am surprised this is not actually const. We'll sort this out later...
Quality Gate passedIssues Measures |
Follow up and fix for #2243