diff --git a/ext/gstmoodbar/gstfastspectrum.cpp b/ext/gstmoodbar/gstfastspectrum.cpp index 01f03576a..0cc121056 100644 --- a/ext/gstmoodbar/gstfastspectrum.cpp +++ b/ext/gstmoodbar/gstfastspectrum.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -74,7 +75,7 @@ static void gst_fastspectrum_class_init (GstFastSpectrumClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass); GstAudioFilterClass *filter_class = GST_AUDIO_FILTER_CLASS (klass); - GstCaps *caps; + GstCaps *caps = nullptr; gobject_class->set_property = gst_fastspectrum_set_property; gobject_class->get_property = gst_fastspectrum_get_property; @@ -264,7 +265,7 @@ static void input_data_mixed_float(const guint8* _in, double* out, guint len, do Q_UNUSED(max_value); - guint j, ip = 0; + guint j = 0, ip = 0; const gfloat *in = reinterpret_cast(_in); for (j = 0; j < len; j++) { @@ -278,7 +279,7 @@ static void input_data_mixed_double (const guint8 * _in, double* out, guint len, Q_UNUSED(max_value); - guint j, ip = 0; + guint j = 0, ip = 0; const gdouble *in = reinterpret_cast(_in); for (j = 0; j < len; j++) { @@ -290,7 +291,7 @@ static void input_data_mixed_double (const guint8 * _in, double* out, guint len, static void input_data_mixed_int32_max (const guint8 * _in, double* out, guint len, double max_value, guint op, guint nfft) { - guint j, ip = 0; + guint j = 0, ip = 0; const gint32 *in = reinterpret_cast(_in); for (j = 0; j < len; j++) { @@ -302,7 +303,7 @@ static void input_data_mixed_int32_max (const guint8 * _in, double* out, guint l static void input_data_mixed_int24_max (const guint8 * _in, double* out, guint len, double max_value, guint op, guint nfft) { - guint j; + guint j = 0; for (j = 0; j < len; j++) { #if G_BYTE_ORDER == G_BIG_ENDIAN @@ -322,7 +323,7 @@ static void input_data_mixed_int24_max (const guint8 * _in, double* out, guint l static void input_data_mixed_int16_max (const guint8 * _in, double * out, guint len, double max_value, guint op, guint nfft) { - guint j, ip = 0; + guint j = 0, ip = 0; const gint16 *in = reinterpret_cast(_in); for (j = 0; j < len; j++) { @@ -369,7 +370,7 @@ static gboolean gst_fastspectrum_setup (GstAudioFilter * base, const GstAudioInf static void gst_fastspectrum_run_fft (GstFastSpectrum * spectrum, guint input_pos) { - guint i; + guint i = 0; guint bands = spectrum->bands; guint nfft = 2 * bands - 2; @@ -379,7 +380,7 @@ static void gst_fastspectrum_run_fft (GstFastSpectrum * spectrum, guint input_po // Should be safe to execute the same plan multiple times in parallel. fftw_execute(spectrum->plan); - gdouble val; + gdouble val = 0.0; /* Calculate magnitude in db */ for (i = 0; i < bands; i++) { val = spectrum->fft_output[i][0] * spectrum->fft_output[i][0]; @@ -399,13 +400,13 @@ static GstFlowReturn gst_fastspectrum_transform_ip (GstBaseTransform *trans, Gst double max_value = (1UL << ((bps << 3) - 1)) - 1; guint bands = spectrum->bands; guint nfft = 2 * bands - 2; - guint input_pos; + guint input_pos = 0; GstMapInfo map; - const guint8 *data; - gsize size; - guint fft_todo, msg_todo, block_size; - gboolean have_full_interval; - GstFastSpectrumInputData input_data; + const guint8 *data = nullptr; + gsize size = 0; + guint fft_todo = 0, msg_todo = 0, block_size = 0; + gboolean have_full_interval = false; + GstFastSpectrumInputData input_data = nullptr; g_mutex_lock (&spectrum->lock); gst_buffer_map (buffer, &map, GST_MAP_READ); diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 36570d4cf..1eb88454f 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -278,7 +278,7 @@ QString CXXDemangle(const QString &mangled_function); QString CXXDemangle(const QString &mangled_function) { - int status; + int status = 0; char* demangled_function = abi::__cxa_demangle(mangled_function.toLatin1().constData(), nullptr, nullptr, &status); if (status == 0) { QString ret = QString::fromLatin1(demangled_function); diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp index 769a756aa..b29ff63d8 100644 --- a/src/analyzer/analyzerbase.cpp +++ b/src/analyzer/analyzerbase.cpp @@ -141,7 +141,7 @@ int Analyzer::Base::resizeExponent(int exp) { int Analyzer::Base::resizeForBands(int bands) { - int exp; + int exp = 0; if (bands <= 8) exp = 4; else if (bands <= 16) diff --git a/src/analyzer/blockanalyzer.cpp b/src/analyzer/blockanalyzer.cpp index bddc3bde0..74f589795 100644 --- a/src/analyzer/blockanalyzer.cpp +++ b/src/analyzer/blockanalyzer.cpp @@ -164,7 +164,7 @@ void BlockAnalyzer::analyze(QPainter &p, const Analyzer::Scope &s, bool new_fram // Paint the background canvas_painter.drawPixmap(0, 0, background_); - for (int y, x = 0; x < static_cast(scope_.size()); ++x) { + for (int x = 0, y = 0; x < static_cast(scope_.size()); ++x) { // determine y for (y = 0; scope_[x] < yscale_[y]; ++y) continue; @@ -242,7 +242,7 @@ QColor ensureContrast(const QColor &bg, const QColor &fg, int amount) { public: explicit OutputOnExit(const QColor &color) : c(color) {} ~OutputOnExit() { - int h, s, v; + int h = 0, s = 0, v = 0; c.getHsv(&h, &s, &v); } @@ -252,8 +252,8 @@ QColor ensureContrast(const QColor &bg, const QColor &fg, int amount) { OutputOnExit allocateOnTheStack(fg); - int bh, bs, bv; - int fh, fs, fv; + int bh = 0, bs = 0, bv = 0; + int fh = 0, fs = 0, fv = 0; bg.getHsv(&bh, &bs, &bv); fg.getHsv(&fh, &fs, &fv); @@ -347,7 +347,7 @@ void BlockAnalyzer::paletteChange(const QPalette&) { // make a complimentary fadebar colour // TODO dark is not always correct, dumbo! - int h, s, v; + int h = 0, s = 0, v = 0; palette().color(QPalette::Window).darker(150).getHsv(&h, &s, &v); const QColor fg2(QColor::fromHsv(h + 120, s, v)); diff --git a/src/analyzer/boomanalyzer.cpp b/src/analyzer/boomanalyzer.cpp index 85ab2114b..a6e70b04e 100644 --- a/src/analyzer/boomanalyzer.cpp +++ b/src/analyzer/boomanalyzer.cpp @@ -116,7 +116,7 @@ void BoomAnalyzer::analyze(QPainter& p, const Scope& scope, bool new_frame) { p.drawPixmap(0, 0, canvas_); return; } - double h; + double h = 0.0; const uint MAX_HEIGHT = height() - 1; QPainter canvas_painter(&canvas_); @@ -124,7 +124,7 @@ void BoomAnalyzer::analyze(QPainter& p, const Scope& scope, bool new_frame) { Analyzer::interpolate(scope, scope_); - for (int i = 0, x = 0, y; i < bands_; ++i, x += kColumnWidth + 1) { + for (int i = 0, x = 0, y = 0; i < bands_; ++i, x += kColumnWidth + 1) { h = log10(scope_[i] * 256.0) * F_; if (h > MAX_HEIGHT) h = MAX_HEIGHT; diff --git a/src/analyzer/fht.cpp b/src/analyzer/fht.cpp index 2c6a04e68..bf3fafccd 100644 --- a/src/analyzer/fht.cpp +++ b/src/analyzer/fht.cpp @@ -68,7 +68,7 @@ void FHT::ewma(float* d, float* s, float w) { void FHT::logSpectrum(float* out, float* p) { - int n = num_ / 2, i, j, k, *r; + int n = num_ / 2, i = 0, j = 0, k = 0, *r = nullptr; if (log_vector_.size() < n) { log_vector_.resize(n); float f = n / log10(static_cast(n)); @@ -135,8 +135,8 @@ void FHT::transform(float* p) { void FHT::transform8(float* p) { - float a, b, c, d, e, f, g, h, b_f2, d_h2; - float a_c_eg, a_ce_g, ac_e_g, aceg, b_df_h, bdfh; + float a = 0.0, b = 0.0, c = 0.0, d = 0.0, e = 0.0, f = 0.0, g = 0.0, h = 0.0, b_f2 = 0.0, d_h2 = 0.0; + float a_c_eg = 0.0, a_ce_g = 0.0, ac_e_g = 0.0, aceg = 0.0, b_df_h = 0.0, bdfh = 0.0; a = *p++, b = *p++, c = *p++, d = *p++; e = *p++, f = *p++, g = *p++, h = *p; @@ -169,8 +169,8 @@ void FHT::_transform(float* p, int n, int k) { return; } - int i, j, ndiv2 = n / 2; - float a, *t1, *t2, *t3, *t4, *ptab, *pp; + int i = 0, j = 0, ndiv2 = n / 2; + float a = 0.0, *t1 = nullptr, *t2 = nullptr, *t3 = nullptr, *t4 = nullptr, *ptab = nullptr, *pp = nullptr; for (i = 0, t1 = buf_(), t2 = buf_() + ndiv2, pp = &p[k]; i < ndiv2; i++) *t1++ = *pp++, *t2++ = *pp++; diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index c1e177d37..3d357ebc0 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -1914,7 +1914,7 @@ QDataStream &operator<<(QDataStream &s, const CollectionModel::Grouping &g) { QDataStream &operator>>(QDataStream &s, CollectionModel::Grouping &g) { - quint32 buf; + quint32 buf = 0; s >> buf; g.first = CollectionModel::GroupBy(buf); s >> buf; diff --git a/src/core/filesystemwatcherinterface.cpp b/src/core/filesystemwatcherinterface.cpp index d3fa6043c..3131e5187 100644 --- a/src/core/filesystemwatcherinterface.cpp +++ b/src/core/filesystemwatcherinterface.cpp @@ -33,11 +33,11 @@ FileSystemWatcherInterface::FileSystemWatcherInterface(QObject *parent) : QObject(parent) {} FileSystemWatcherInterface *FileSystemWatcherInterface::Create(QObject *parent) { - FileSystemWatcherInterface *ret; + #ifdef Q_OS_MACOS - ret = new MacFSListener(parent); + FileSystemWatcherInterface *ret = new MacFSListener(parent); #else - ret = new QtFSListener(parent); + FileSystemWatcherInterface *ret = new QtFSListener(parent); #endif ret->Init(); diff --git a/src/core/mergedproxymodel.cpp b/src/core/mergedproxymodel.cpp index 513f55917..260e5db68 100644 --- a/src/core/mergedproxymodel.cpp +++ b/src/core/mergedproxymodel.cpp @@ -282,7 +282,7 @@ QModelIndex MergedProxyModel::mapFromSource(const QModelIndex &source_index) con // Add a mapping if we don't have one already const auto &it = p_->mappings_.get().find(source_index); - Mapping *mapping; + Mapping *mapping = nullptr; if (it != p_->mappings_.get().end()) { mapping = *it; } diff --git a/src/core/songloader.cpp b/src/core/songloader.cpp index 7e52a126c..e3a3cd5d1 100644 --- a/src/core/songloader.cpp +++ b/src/core/songloader.cpp @@ -566,8 +566,8 @@ void SongLoader::ErrorMessageReceived(GstMessage *msg) { if (state_ == Finished) return; - GError *error; - gchar *debugs; + GError *error = nullptr; + gchar *debugs = nullptr; gst_message_parse_error(msg, &error, &debugs); qLog(Error) << __PRETTY_FUNCTION__ << error->message; diff --git a/src/core/utilities.cpp b/src/core/utilities.cpp index b2d533d09..08a9377f2 100644 --- a/src/core/utilities.cpp +++ b/src/core/utilities.cpp @@ -315,7 +315,7 @@ bool Copy(QIODevice *source, QIODevice *destination) { std::unique_ptr data(new char[bytes]); qint64 pos = 0; - qint64 bytes_read; + qint64 bytes_read = 0; do { bytes_read = source->read(data.get() + pos, bytes - pos); if (bytes_read == -1) return false; @@ -324,7 +324,7 @@ bool Copy(QIODevice *source, QIODevice *destination) { } while (bytes_read > 0 && pos != bytes); pos = 0; - qint64 bytes_written; + qint64 bytes_written = 0; do { bytes_written = destination->write(data.get() + pos, bytes - pos); if (bytes_written == -1) return false; diff --git a/src/device/cddasongloader.cpp b/src/device/cddasongloader.cpp index bae468503..bd558d9ee 100644 --- a/src/device/cddasongloader.cpp +++ b/src/device/cddasongloader.cpp @@ -166,7 +166,7 @@ void CddaSongLoader::LoadSongs() { // Handle TOC message: get tracks duration if (msg_toc) { - GstToc *toc; + GstToc *toc = nullptr; gst_message_parse_toc (msg_toc, &toc, nullptr); if (toc) { GList *entries = gst_toc_get_entries(toc); @@ -175,7 +175,7 @@ void CddaSongLoader::LoadSongs() { for (GList *node = entries; node != nullptr; node = node->next) { GstTocEntry *entry = static_cast(node->data); quint64 duration = 0; - gint64 start, stop; + gint64 start = 0, stop = 0; if (gst_toc_entry_get_start_stop_times (entry, &start, &stop)) duration = stop - start; songs[i++].set_length_nanosec(duration); } diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index 188f254f4..0dcf3b275 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -215,7 +215,7 @@ bool GstEnginePipeline::InitFromUrl(const QByteArray &stream_url, const QUrl ori g_object_set(G_OBJECT(pipeline_), "uri", stream_url.constData(), nullptr); - gint flags; + gint flags = 0; g_object_get(G_OBJECT(pipeline_), "flags", &flags, nullptr); flags |= 0x00000002; flags &= ~0x00000001; @@ -816,7 +816,7 @@ GstBusSyncReply GstEnginePipeline::BusCallbackSync(GstBus*, GstMessage *msg, gpo void GstEnginePipeline::StreamStatusMessageReceived(GstMessage *msg) { - GstStreamStatusType type; + GstStreamStatusType type = GST_STREAM_STATUS_TYPE_CREATE; GstElement *owner = nullptr; gst_message_parse_stream_status(msg, &type, &owner); @@ -985,7 +985,7 @@ QString GstEnginePipeline::ParseStrTag(GstTagList *list, const char *tag) const guint GstEnginePipeline::ParseUIntTag(GstTagList *list, const char *tag) const { - guint data; + guint data = 0; bool success = gst_tag_list_get_uint(list, tag, &data); guint ret = 0; @@ -1001,7 +1001,7 @@ void GstEnginePipeline::StateChangedMessageReceived(GstMessage *msg) { return; } - GstState old_state, new_state, pending; + GstState old_state = GST_STATE_NULL, new_state = GST_STATE_NULL, pending = GST_STATE_NULL; gst_message_parse_state_changed(msg, &old_state, &new_state, &pending); if (!pipeline_is_initialized_ && (new_state == GST_STATE_PAUSED || new_state == GST_STATE_PLAYING)) { @@ -1074,7 +1074,7 @@ qint64 GstEnginePipeline::length() const { GstState GstEnginePipeline::state() const { - GstState s, sp; + GstState s = GST_STATE_NULL, sp = GST_STATE_NULL; if (!pipeline_ || gst_element_get_state(pipeline_, &s, &sp, kGstStateTimeoutNanosecs) == GST_STATE_CHANGE_FAILURE) return GST_STATE_NULL; diff --git a/src/internet/localredirectserver.cpp b/src/internet/localredirectserver.cpp index 7c2e65b3e..0a29c4e8b 100644 --- a/src/internet/localredirectserver.cpp +++ b/src/internet/localredirectserver.cpp @@ -71,7 +71,7 @@ bool LocalRedirectServer::GenerateCertificate() { return false; } - gnutls_x509_privkey_t key; + gnutls_x509_privkey_t key = nullptr; if (int result = gnutls_x509_privkey_init(&key) != GNUTLS_E_SUCCESS) { error_ = QString("Failed to initialize the private key structure: %1").arg(gnutls_strerror(result)); gnutls_global_deinit(); @@ -104,7 +104,7 @@ bool LocalRedirectServer::GenerateCertificate() { return false; } - gnutls_x509_crt_t crt; + gnutls_x509_crt_t crt = nullptr; if (int result = gnutls_x509_crt_init(&crt) != GNUTLS_E_SUCCESS) { error_ = QString("Failed to initialize an X.509 certificate structure: %1").arg(gnutls_strerror(result)); gnutls_x509_privkey_deinit(key); @@ -173,7 +173,7 @@ bool LocalRedirectServer::GenerateCertificate() { return false; } - gnutls_privkey_t pkey; + gnutls_privkey_t pkey = nullptr; if (int result = gnutls_privkey_init(&pkey) != GNUTLS_E_SUCCESS) { error_ = QString("Failed to initialize a private key object: %1").arg(gnutls_strerror(result)); gnutls_x509_privkey_deinit(key); diff --git a/src/moodbar/moodbarpipeline.cpp b/src/moodbar/moodbarpipeline.cpp index f29451035..bfe1a6749 100644 --- a/src/moodbar/moodbarpipeline.cpp +++ b/src/moodbar/moodbarpipeline.cpp @@ -134,8 +134,8 @@ void MoodbarPipeline::Start() { void MoodbarPipeline::ReportError(GstMessage *msg) { - GError *error; - gchar *debugs; + GError *error = nullptr; + gchar *debugs = nullptr; gst_message_parse_error(msg, &error, &debugs); QString message = QString::fromLocal8Bit(error->message); diff --git a/src/moodbar/moodbarrenderer.cpp b/src/moodbar/moodbarrenderer.cpp index fb8da475d..df3fb9c1c 100644 --- a/src/moodbar/moodbarrenderer.cpp +++ b/src/moodbar/moodbarrenderer.cpp @@ -136,7 +136,7 @@ void MoodbarRenderer::Render(const ColorVector &colors, QPainter *p, const QRect // Draw the actual moodbar. for (int x = 0; x < rect.width(); x++) { - int h, s, v; + int h = 0, s = 0, v = 0; screen_colors[x].getHsv(&h, &s, &v); for (int y = 0; y <= rect.height() / 2; y++) { diff --git a/src/playlist/playlistfilterparser.cpp b/src/playlist/playlistfilterparser.cpp index 6ce0c4c72..6907dd1ef 100644 --- a/src/playlist/playlistfilterparser.cpp +++ b/src/playlist/playlistfilterparser.cpp @@ -440,7 +440,7 @@ FilterTree *FilterParser::createSearchTermTreeNode(const QString &col, const QSt } else if (!col.isEmpty() && columns_.contains(col) && numerical_columns_.contains(columns_[col])) { // the length column contains the time in seconds (nano seconds, actually - the "nano" part is handled by the DropTailComparatorDecorator, though). - int search_value; + int search_value = 0; if (columns_[col] == Playlist::Column_Length) { search_value = parseTime(search); } diff --git a/src/playlist/playlisttabbar.cpp b/src/playlist/playlisttabbar.cpp index 8c53380d2..d59b27067 100644 --- a/src/playlist/playlisttabbar.cpp +++ b/src/playlist/playlisttabbar.cpp @@ -226,7 +226,7 @@ void PlaylistTabBar::CloseSlot() { QDialogButtonBox *buttons = confirmation_box.findChild(); if (grid && buttons) { const int index = grid->indexOf(buttons); - int row, column, row_span, column_span = 0; + int row = 0, column = 0, row_span = 0, column_span = 0; grid->getItemPosition(index, &row, &column, &row_span, &column_span); QLayoutItem *buttonsItem = grid->takeAt(index); grid->addWidget(&dont_prompt_again, row, column, row_span, column_span, Qt::AlignLeft | Qt::AlignTop); diff --git a/src/settings/notificationssettingspage.cpp b/src/settings/notificationssettingspage.cpp index 19376a730..9f8983a61 100644 --- a/src/settings/notificationssettingspage.cpp +++ b/src/settings/notificationssettingspage.cpp @@ -303,7 +303,7 @@ void NotificationsSettingsPage::ChooseFgColor() { void NotificationsSettingsPage::ChooseFont() { - bool ok; + bool ok = false; QFont font = QFontDialog::getFont(&ok, pretty_popup_->font(), this); if (ok) { pretty_popup_->set_font(font); diff --git a/src/smartplaylists/smartplaylistsearch.cpp b/src/smartplaylists/smartplaylistsearch.cpp index f686c98ef..490e6bd5d 100644 --- a/src/smartplaylists/smartplaylistsearch.cpp +++ b/src/smartplaylists/smartplaylistsearch.cpp @@ -134,8 +134,8 @@ QDataStream &operator<<(QDataStream &s, const SmartPlaylistSearch &search) { QDataStream &operator>>(QDataStream &s, SmartPlaylistSearch &search) { - quint8 sort_type, sort_field, search_type; - qint32 limit; + quint8 sort_type = 0, sort_field = 0, search_type = 0; + qint32 limit = 0; s >> search.terms_ >> sort_type >> sort_field >> limit >> search_type; search.sort_type_ = SmartPlaylistSearch::SortType(sort_type); diff --git a/src/smartplaylists/smartplaylistsearchterm.cpp b/src/smartplaylists/smartplaylistsearchterm.cpp index 26004da94..bebcc3941 100644 --- a/src/smartplaylists/smartplaylistsearchterm.cpp +++ b/src/smartplaylists/smartplaylistsearchterm.cpp @@ -456,7 +456,7 @@ QDataStream &operator<<(QDataStream &s, const SmartPlaylistSearchTerm &term) { QDataStream &operator>>(QDataStream &s, SmartPlaylistSearchTerm &term) { - quint8 field, op, date; + quint8 field = 0, op = 0, date = 0; s >> field >> op >> term.value_ >> term.second_value_ >> date; term.field_ = SmartPlaylistSearchTerm::Field(field); term.operator_ = SmartPlaylistSearchTerm::Operator(op); diff --git a/src/subsonic/subsonicrequest.cpp b/src/subsonic/subsonicrequest.cpp index 0e6d52440..e28560240 100644 --- a/src/subsonic/subsonicrequest.cpp +++ b/src/subsonic/subsonicrequest.cpp @@ -153,8 +153,7 @@ void SubsonicRequest::FlushAlbumsRequests() { if (request.size > 0) params << Param("size", QString::number(request.size)); if (request.offset > 0) params << Param("offset", QString::number(request.offset)); - QNetworkReply *reply; - reply = CreateGetRequest(QString("getAlbumList2"), params); + QNetworkReply *reply = CreateGetRequest(QString("getAlbumList2"), params); replies_ << reply; QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { AlbumsReplyReceived(reply, request.offset); }); diff --git a/src/subsonic/subsonicscrobblerequest.cpp b/src/subsonic/subsonicscrobblerequest.cpp index 6641b1e06..51cf7be8a 100644 --- a/src/subsonic/subsonicscrobblerequest.cpp +++ b/src/subsonic/subsonicscrobblerequest.cpp @@ -81,8 +81,7 @@ void SubsonicScrobbleRequest::FlushScrobbleRequests() { Param("submission", QVariant(request.submission).toString()) << Param("time", QVariant(request.time_ms).toString()); - QNetworkReply *reply; - reply = CreateGetRequest(QString("scrobble"), params); + QNetworkReply *reply = CreateGetRequest(QString("scrobble"), params); replies_ << reply; QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() { ScrobbleReplyReceived(reply); }); diff --git a/src/tidal/tidalservice.cpp b/src/tidal/tidalservice.cpp index 88074280b..9247b6c9e 100644 --- a/src/tidal/tidalservice.cpp +++ b/src/tidal/tidalservice.cpp @@ -934,7 +934,7 @@ void TidalService::CancelSearch() { void TidalService::SendSearch() { - TidalBaseRequest::QueryType type; + TidalBaseRequest::QueryType type = TidalBaseRequest::QueryType_None; switch (pending_search_type_) { case InternetSearchView::SearchType_Artists: diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index c4c54aebf..4b0ca662f 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -396,8 +396,8 @@ GstBusSyncReply Transcoder::BusCallbackSync(GstBus*, GstMessage *msg, gpointer d void Transcoder::JobState::ReportError(GstMessage *msg) { - GError *error; - gchar *debugs; + GError *error = nullptr; + gchar *debugs = nullptr; gst_message_parse_error(msg, &error, &debugs); QString message = QString::fromLocal8Bit(error->message); diff --git a/src/widgets/fancytabwidget.cpp b/src/widgets/fancytabwidget.cpp index 3148bb5cc..04e71a317 100644 --- a/src/widgets/fancytabwidget.cpp +++ b/src/widgets/fancytabwidget.cpp @@ -271,7 +271,7 @@ class FancyTabBar: public QTabBar { { p.save(); QTransform m; - int textFlags; + int textFlags = 0; Qt::Alignment iconFlags; QRect tabrectText; diff --git a/src/widgets/groupediconview.cpp b/src/widgets/groupediconview.cpp index 1d4d731e0..8d48f3ec4 100644 --- a/src/widgets/groupediconview.cpp +++ b/src/widgets/groupediconview.cpp @@ -278,7 +278,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) { if (selections && selections->isSelected(*it)) option.state |= QStyle::State_Selected; if (enabled) { - QPalette::ColorGroup cg; + QPalette::ColorGroup cg = QPalette::Active; if ((itemModel->flags(*it) & Qt::ItemIsEnabled) == 0) { option.state &= ~QStyle::State_Enabled; cg = QPalette::Disabled;