diff --git a/3rdparty/singleapplication/singleapplication_p.cpp b/3rdparty/singleapplication/singleapplication_p.cpp index 9de965fa8..427dde26f 100644 --- a/3rdparty/singleapplication/singleapplication_p.cpp +++ b/3rdparty/singleapplication/singleapplication_p.cpp @@ -114,12 +114,9 @@ void SingleApplicationPrivate::genBlockServerName() { #ifdef Q_OS_UNIX QByteArray username; #if defined(HAVE_GETEUID) && defined(HAVE_GETPWUID) - uid_t uid = geteuid(); - if (uid != -1) { - struct passwd *pw = getpwuid(uid); - if (pw) { - username = pw->pw_name; - } + struct passwd *pw = getpwuid(geteuid()); + if (pw) { + username = pw->pw_name; } #endif if (username.isEmpty()) username = qgetenv("USER"); diff --git a/3rdparty/singleapplication/singlecoreapplication_p.cpp b/3rdparty/singleapplication/singlecoreapplication_p.cpp index 75df19fbd..a6f787df1 100644 --- a/3rdparty/singleapplication/singlecoreapplication_p.cpp +++ b/3rdparty/singleapplication/singlecoreapplication_p.cpp @@ -114,12 +114,9 @@ void SingleCoreApplicationPrivate::genBlockServerName() { #ifdef Q_OS_UNIX QByteArray username; #if defined(HAVE_GETEUID) && defined(HAVE_GETPWUID) - uid_t uid = geteuid(); - if (uid != -1) { - struct passwd *pw = getpwuid(uid); - if (pw) { - username = pw->pw_name; - } + struct passwd *pw = getpwuid(geteuid()); + if (pw) { + username = pw->pw_name; } #endif if (username.isEmpty()) username = qgetenv("USER"); diff --git a/ext/libstrawberry-tagreader/tagreader.cpp b/ext/libstrawberry-tagreader/tagreader.cpp index 79acae88f..7ac06193c 100644 --- a/ext/libstrawberry-tagreader/tagreader.cpp +++ b/ext/libstrawberry-tagreader/tagreader.cpp @@ -290,7 +290,7 @@ void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *s if (!map["APIC"].isEmpty()) song->set_art_automatic(kEmbeddedCover); // Find a suitable comment tag. For now we ignore iTunNORM comments. - for (int i = 0; i < map["COMM"].size(); ++i) { + for (uint i = 0; i < map["COMM"].size(); ++i) { const TagLib::ID3v2::CommentsFrame *frame = dynamic_cast(map["COMM"][i]); if (frame && TStringToQString(frame->description()) != "iTunNORM") { @@ -300,7 +300,7 @@ void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *s } // Parse FMPS frames - for (int i = 0; i < map["TXXX"].size(); ++i) { + for (uint i = 0; i < map["TXXX"].size(); ++i) { const TagLib::ID3v2::UserTextIdentificationFrame *frame = dynamic_cast(map["TXXX"][i]); if (frame && frame->description().startsWith("FMPS_")) { @@ -836,7 +836,7 @@ QByteArray TagReader::LoadEmbeddedAPEArt(const TagLib::APE::ItemListMap &map) co TagLib::ByteVector data = it->second.binaryData(); int pos = data.find('\0') + 1; - if ((pos > 0) && (pos < data.size())) { + if ((pos > 0) && ((uint)pos < data.size())) { ret = QByteArray(data.data() + pos, data.size() - pos); } } diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp index 372086558..a529e1c5c 100644 --- a/src/analyzer/analyzerbase.cpp +++ b/src/analyzer/analyzerbase.cpp @@ -72,7 +72,7 @@ void Analyzer::Base::showEvent(QShowEvent*) { timer_.start(timeout(), this); } void Analyzer::Base::transform(Scope& scope) { QVector aux(fht_->size()); - if (aux.size() >= scope.size()) { + if ((long unsigned int)aux.size() >= scope.size()) { std::copy(scope.begin(), scope.end(), aux.begin()); } else { diff --git a/src/analyzer/blockanalyzer.cpp b/src/analyzer/blockanalyzer.cpp index b5c930088..35a517d45 100644 --- a/src/analyzer/blockanalyzer.cpp +++ b/src/analyzer/blockanalyzer.cpp @@ -196,7 +196,7 @@ void BlockAnalyzer::analyze(QPainter &p, const Analyzer::Scope &s, bool new_fram canvas_painter.drawPixmap(x * (kWidth + 1), y * (kHeight + 1) + y_, *bar(), 0, y * (kHeight + 1), bar()->width(), bar()->height()); } - for (uint x = 0; x < store_.size(); ++x) + for (int x = 0; x < store_.size(); ++x) canvas_painter.drawPixmap(x * (kWidth + 1), static_cast(store_[x]) * (kHeight + 1) + y_, topbarpixmap_); p.drawPixmap(0, 0, canvas_); diff --git a/src/context/contextview.cpp b/src/context/contextview.cpp index 443731025..f90d6e739 100644 --- a/src/context/contextview.cpp +++ b/src/context/contextview.cpp @@ -498,7 +498,7 @@ void ContextView::UpdateSong(const Song &song) { void ContextView::UpdateLyrics(const quint64 id, const QString &provider, const QString &lyrics) { - if (id != lyrics_id_) return; + if ((qint64) id != lyrics_id_) return; lyrics_ = lyrics + "\n\n(Lyrics from " + provider + ")\n"; lyrics_id_ = -1; if (action_show_lyrics_->isChecked()) { diff --git a/src/core/mpris_common.h b/src/core/mpris_common.h index e853f7355..12d7b0756 100644 --- a/src/core/mpris_common.h +++ b/src/core/mpris_common.h @@ -55,7 +55,7 @@ inline void AddMetadata(const QString &key, const QDateTime &metadata, QVariantM if (metadata.isValid()) (*map)[key] = metadata; } -inline QString AsMPRISDateTimeType(uint time) { +inline QString AsMPRISDateTimeType(const int time) { return time != -1 ? QDateTime::fromTime_t(time).toString(Qt::ISODate) : ""; } diff --git a/src/device/cddasongloader.cpp b/src/device/cddasongloader.cpp index f505b2714..ab7f7fbd1 100644 --- a/src/device/cddasongloader.cpp +++ b/src/device/cddasongloader.cpp @@ -149,7 +149,7 @@ void CddaSongLoader::LoadSongs() { gst_message_parse_toc (msg_toc, &toc, nullptr); if (toc) { GList *entries = gst_toc_get_entries(toc); - if (entries && songs.size() <= g_list_length (entries)) { + if (entries && (guint)songs.size() <= g_list_length(entries)) { int i = 0; for (GList *node = entries; node != nullptr; node = node->next) { GstTocEntry *entry = static_cast(node->data); diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index f04d5d703..9cc137b15 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -511,7 +511,7 @@ void GstEngine::EndOfStreamReached(const int pipeline_id, const bool has_next_tr } -void GstEngine::HandlePipelineError(int pipeline_id, const QString &message, int domain, int error_code) { +void GstEngine::HandlePipelineError(const int pipeline_id, const QString &message, const int domain, const int error_code) { if (!current_pipeline_.get() || current_pipeline_->id() != pipeline_id) return; @@ -521,7 +521,7 @@ void GstEngine::HandlePipelineError(int pipeline_id, const QString &message, int BufferingFinished(); emit StateChanged(Engine::Error); - if (domain == GST_RESOURCE_ERROR && (error_code == GST_RESOURCE_ERROR_NOT_FOUND || error_code == GST_RESOURCE_ERROR_NOT_AUTHORIZED)) { + if (domain == (int)GST_RESOURCE_ERROR && (error_code == (int)GST_RESOURCE_ERROR_NOT_FOUND || error_code == (int)GST_RESOURCE_ERROR_NOT_AUTHORIZED)) { emit InvalidSongRequested(stream_url_); } else { diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index 689d9c1c9..1eae1e22e 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -617,7 +617,7 @@ GstPadProbeReturn GstEnginePipeline::HandoffCallback(GstPad *pad, GstPadProbeInf if (instance->end_offset_nanosec_ > 0) { quint64 start_time = GST_BUFFER_TIMESTAMP(buf) - instance->segment_start_; quint64 duration = GST_BUFFER_DURATION(buf); - quint64 end_time = start_time + duration; + qint64 end_time = start_time + duration; if (end_time > instance->end_offset_nanosec_) { if (instance->has_next_valid_url() && instance->next_stream_url_ == instance->stream_url_ && instance->next_beginning_offset_nanosec_ == instance->end_offset_nanosec_) { @@ -804,7 +804,7 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) { g_error_free(error); free(debugs); - if (state() == GST_STATE_PLAYING && pipeline_is_initialised_ && next_uri_set_ && (domain == GST_RESOURCE_ERROR || domain == GST_STREAM_ERROR)) { + if (state() == GST_STATE_PLAYING && pipeline_is_initialised_ && next_uri_set_ && (domain == (int)GST_RESOURCE_ERROR || domain == (int)GST_STREAM_ERROR)) { // A track is still playing and the next uri is not playable. We ignore the error here so it can play until the end. // But there is no message send to the bus when the current track finishes, we have to add an EOS ourself. qLog(Debug) << "Ignoring error when loading next track"; diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 8accf6f0b..1f93a52dc 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -575,7 +575,7 @@ void Transcoder::SetElementProperties(const QString &name, GObject *object) { guint properties_count = 0; GParamSpec **properties = g_object_class_list_properties(G_OBJECT_GET_CLASS(object), &properties_count); - for (int i = 0; i < properties_count; ++i) { + for (uint i = 0; i < properties_count; ++i) { GParamSpec *property = properties[i]; const QVariant value = s.value(property->name);