diff --git a/src/engine/sidechain/enginenetworkstream.cpp b/src/engine/sidechain/enginenetworkstream.cpp index d23480b45d2c..3286d894e6ce 100644 --- a/src/engine/sidechain/enginenetworkstream.cpp +++ b/src/engine/sidechain/enginenetworkstream.cpp @@ -137,7 +137,6 @@ qint64 EngineNetworkStream::getNetworkTimeUs() { // will overflow > 200,000 years #ifdef __WINDOWS__ FILETIME ft; - qint64 t; // no GetSystemTimePreciseAsFileTime available, fall // back to GetSystemTimeAsFileTime. This happens before // Windows 8 and Windows Server 2012 @@ -156,11 +155,9 @@ qint64 EngineNetworkStream::getNetworkTimeUs() { // timer was not incremented since last call (< 15 ms) // Add time since last function call after last increment // This reduces the jitter < one call cycle which is sufficient - LARGE_INTEGER li; now += timerSinceInc.elapsed().toIntegerMicros(); } else { // timer was incremented - LARGE_INTEGER li; timerSinceInc.start(); oldNow = now; } diff --git a/src/library/searchquery.cpp b/src/library/searchquery.cpp index 29b051b3c0ba..0f7f4cea7b76 100644 --- a/src/library/searchquery.cpp +++ b/src/library/searchquery.cpp @@ -89,7 +89,7 @@ bool AndNode::match(const TrackPointer& pTrack) const { QString AndNode::toSql() const { QStringList queryFragments; - queryFragments.reserve(m_nodes.size()); + queryFragments.reserve(static_cast(m_nodes.size())); for (const auto& pNode: m_nodes) { QString sql = pNode->toSql(); if (!sql.isEmpty()) { @@ -118,7 +118,7 @@ bool OrNode::match(const TrackPointer& pTrack) const { QString OrNode::toSql() const { QStringList queryFragments; - queryFragments.reserve(m_nodes.size()); + queryFragments.reserve(static_cast(m_nodes.size())); for (const auto& pNode: m_nodes) { QString sql = pNode->toSql(); if (!sql.isEmpty()) { diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp index 54503f94115f..c25acad437e2 100644 --- a/src/musicbrainz/chromaprinter.cpp +++ b/src/musicbrainz/chromaprinter.cpp @@ -64,7 +64,7 @@ QString calcFingerprint( PerformanceTimer timerGeneratingFingerprint; timerGeneratingFingerprint.start(); - int success = chromaprint_feed(ctx, &fingerprintSamples[0], fingerprintSamples.size()); + int success = chromaprint_feed(ctx, &fingerprintSamples[0], static_cast(fingerprintSamples.size())); chromaprint_finish(ctx); if (!success) { qWarning() << "Failed to generate fingerprint from sample data"; diff --git a/src/preferences/dialog/dlgprefsound.h b/src/preferences/dialog/dlgprefsound.h index a2fb180a2435..1ce32731d168 100644 --- a/src/preferences/dialog/dlgprefsound.h +++ b/src/preferences/dialog/dlgprefsound.h @@ -112,8 +112,8 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { bool m_settingsModified; bool m_bLatencyChanged; bool m_bSkipConfigClear; - SoundManagerConfig m_config; bool m_loading; + SoundManagerConfig m_config; }; #endif diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index 31ab76d81619..6b32859e0555 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -290,10 +290,8 @@ unsigned char AudioPath::minChannelsForType(AudioPathType type) { // static unsigned char AudioPath::maxChannelsForType(AudioPathType type) { - switch (type) { - default: - return 2; - } + Q_UNUSED(type); + return 2; } /** diff --git a/src/util/platform.h b/src/util/platform.h index e6d4a11b137e..e5bb65f1a42a 100644 --- a/src/util/platform.h +++ b/src/util/platform.h @@ -27,6 +27,11 @@ #if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") #define M_FALLTHROUGH_INTENDED [[clang::fallthrough]] #endif +#elif defined(__GNUC__) +// Taken from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough_003d +// We could also use a comment, but that would require ccache users to set the +// keep_comments_cpp option. If we switch to C++17, we can use [[fallthough]]. +#define M_FALLTHROUGH_INTENDED __attribute__ ((fallthrough)); #endif #ifndef M_FALLTHROUGH_INTENDED diff --git a/src/waveform/waveform.h b/src/waveform/waveform.h index 31d468069ea0..aa544d6058c3 100644 --- a/src/waveform/waveform.h +++ b/src/waveform/waveform.h @@ -111,7 +111,7 @@ class Waveform { // We do not lock the mutex since m_data is not resized after the // constructor runs. - inline int getTextureSize() const { return m_data.size(); } + inline int getTextureSize() const { return static_cast(m_data.size()); } // Atomically get the number of data elements in this Waveform. We do not // lock the mutex since m_dataSize is not changed after the constructor