Re-enable disabled GCC warnings where possible (#7379)

This commit is contained in:
Dominic Clark
2024-07-21 22:34:34 +01:00
committed by GitHub
parent 9c0fc8fc69
commit 851c884f58
68 changed files with 222 additions and 241 deletions

View File

@@ -71,8 +71,8 @@ public:
private:
std::atomic<ThreadableJob*> m_items[JOB_QUEUE_SIZE];
std::atomic_int m_writeIndex;
std::atomic_int m_itemsDone;
std::atomic_size_t m_writeIndex;
std::atomic_size_t m_itemsDone;
OperationMode m_opMode;
} ;

View File

@@ -84,11 +84,7 @@ public:
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "PortAudio" );
}
int process_callback( const float *_inputBuffer,
float * _outputBuffer,
unsigned long _framesPerBuffer );
int process_callback(const float* _inputBuffer, float* _outputBuffer, f_cnt_t _framesPerBuffer);
class setupWidget : public gui::AudioDeviceSetupWidget
{
@@ -151,8 +147,8 @@ private:
bool m_wasPAInitError;
SampleFrame* m_outBuf;
int m_outBufPos;
int m_outBufSize;
std::size_t m_outBufPos;
fpp_t m_outBufSize;
bool m_stopped;

View File

@@ -50,8 +50,8 @@ private:
std::atomic_int * m_freeState;
size_t m_freeStateSets;
std::atomic_int m_available;
std::atomic_int m_startIndex;
std::atomic_size_t m_available;
std::atomic_size_t m_startIndex;
} ;

View File

@@ -190,6 +190,8 @@ public:
setParam( 0, pitchBend );
}
auto sysExData() const -> const char* { return m_sysExData; }
Source source() const
{
return m_source;
@@ -212,7 +214,7 @@ private:
int32_t m_sysExDataLen; // len of m_sysExData
} m_data;
[[maybe_unused]] const char* m_sysExData;
const char* m_sysExData;
const void* m_sourcePort;
// Stores the source of the MidiEvent: Internal or External (hardware controllers).

View File

@@ -79,7 +79,7 @@ class MixerChannel : public ThreadableJob
auto color() const -> const std::optional<QColor>& { return m_color; }
void setColor(const std::optional<QColor>& color) { m_color = color; }
std::atomic_int m_dependenciesMet;
std::atomic_size_t m_dependenciesMet;
void incrementDeps();
void processed();

View File

@@ -170,12 +170,8 @@ public:
{
if (buffer == nullptr || buffer->size() == 0) { return 0; }
const auto frames = buffer->size();
const auto frame = sample * frames;
auto f1 = static_cast<f_cnt_t>(frame) % frames;
if (f1 < 0)
{
f1 += frames;
}
const auto frame = absFraction(sample) * frames;
const auto f1 = static_cast<f_cnt_t>(frame);
return linearInterpolate(buffer->data()[f1][0], buffer->data()[(f1 + 1) % frames][0], fraction(frame));
}
@@ -190,12 +186,8 @@ public:
inline wtSampleControl getWtSampleControl(const float sample) const
{
wtSampleControl control;
control.frame = sample * OscillatorConstants::WAVETABLE_LENGTH;
control.f1 = static_cast<f_cnt_t>(control.frame) % OscillatorConstants::WAVETABLE_LENGTH;
if (control.f1 < 0)
{
control.f1 += OscillatorConstants::WAVETABLE_LENGTH;
}
control.frame = absFraction(sample) * OscillatorConstants::WAVETABLE_LENGTH;
control.f1 = static_cast<f_cnt_t>(control.frame);
control.f2 = control.f1 < OscillatorConstants::WAVETABLE_LENGTH - 1 ?
control.f1 + 1 :
0;

View File

@@ -189,13 +189,11 @@ private slots:
void processErrored(QProcess::ProcessError err );
} ;
LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr)
inline std::string QSTR_TO_STDSTR(QString const& qstr)
{
return qstr.toStdString();
}
} // namespace lmms
#endif // LMMS_REMOTE_PLUGIN_H

View File

@@ -36,7 +36,7 @@ namespace lmms
class RmsHelper
{
public:
RmsHelper( int size ) :
RmsHelper(std::size_t size) :
m_buffer( nullptr )
{
setSize( size );
@@ -46,7 +46,7 @@ public:
if( m_buffer ) delete[] m_buffer;
}
inline void setSize( int size )
void setSize(std::size_t size)
{
if( m_buffer )
{
@@ -90,8 +90,8 @@ public:
private:
float * m_buffer;
float m_sum;
unsigned int m_pos;
unsigned int m_size;
std::size_t m_pos;
std::size_t m_size;
float m_sizef;
};

View File

@@ -127,7 +127,7 @@ public:
void deleteClips();
int numOfClips();
Clip * getClip( int clipNum );
auto getClip(std::size_t clipNum) -> Clip*;
int getClipNum(const Clip* clip );
const clipVector & getClips() const

View File

@@ -37,7 +37,7 @@ namespace lmms
// NOTE: FFT_BUFFER_SIZE should be considered deprecated!
// It is used by Eq plugin and some older code here, but this should be a user
// switchable parameter, not a constant. Use a value from FFT_BLOCK_SIZES
const unsigned int FFT_BUFFER_SIZE = 2048;
constexpr auto FFT_BUFFER_SIZE = std::size_t{2048};
// Allowed FFT block sizes. Ranging from barely useful to barely acceptable
// because of performance and latency reasons.

View File

@@ -61,10 +61,9 @@ static inline float fraction( const float _x )
* If the result is interpreted as a phase of an oscillator, it makes that negative phases are
* converted to positive phases.
*/
static inline float absFraction( const float _x )
static inline float absFraction(const float x)
{
return( _x - ( _x >= 0.0f ? static_cast<int>( _x ) :
static_cast<int>( _x ) - 1 ) );
return x - std::floor(x);
}
/*!