diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index 223c7048..9ca5cb13 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -59,8 +59,10 @@ namespace static constexpr std::array invalidKeys { "ID3", "TAG", "OGGS", "MP+" }; // only allow printable ASCII including space (32..126) - return std::none_of(key.begin(), key.end(), [](unsigned char c) { return c < 32 || c > 126; }) - && std::none_of(invalidKeys.begin(), invalidKeys.end(), [upperKey = String(key).upper()](auto k) { return upperKey == k; }); + return std::none_of(key.begin(), key.end(), + [](unsigned char c) { return c < 32 || c > 126; }) + && std::none_of(invalidKeys.begin(), invalidKeys.end(), + [upperKey = String(key).upper()](auto k) { return upperKey == k; }); } } // namespace diff --git a/taglib/mp4/mp4atom.cpp b/taglib/mp4/mp4atom.cpp index a5d1e4a8..eae79613 100644 --- a/taglib/mp4/mp4atom.cpp +++ b/taglib/mp4/mp4atom.cpp @@ -103,7 +103,8 @@ MP4::Atom::Atom(File *file) }; // meta is not a full atom (i.e. not followed by version, flags). It // is followed by the size and type of the first child atom. - auto metaIsFullAtom = std::none_of(metaChildrenNames.begin(), metaChildrenNames.end(), [nextSize = file->readBlock(8).mid(4, 4)](const auto &child) { return nextSize == child; }); + auto metaIsFullAtom = std::none_of(metaChildrenNames.begin(), metaChildrenNames.end(), + [nextSize = file->readBlock(8).mid(4, 4)](const auto &child) { return nextSize == child; }); // Only skip next four bytes, which contain version and flags, if meta // is a full atom. file->seek(posAfterMeta + (metaIsFullAtom ? 4 : 0)); diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp index 8dc16af8..cf42694f 100644 --- a/taglib/mp4/mp4file.cpp +++ b/taglib/mp4/mp4file.cpp @@ -36,7 +36,8 @@ namespace { bool checkValid(const MP4::AtomList &list) { - return std::none_of(list.begin(), list.end(), [](const auto &a) { return a->length == 0 || !checkValid(a->children); }); + return std::none_of(list.begin(), list.end(), + [](const auto &a) { return a->length == 0 || !checkValid(a->children); }); } } // namespace diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp index a37b41f1..befcebda 100644 --- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp +++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp @@ -25,6 +25,8 @@ #include "tableofcontentsframe.h" +#include + #include "tbytevectorlist.h" #include "tpropertymap.h" #include "tdebug.h" @@ -321,11 +323,11 @@ ByteVector TableOfContentsFrame::renderFields() const flags += 1; data.append(flags); data.append(static_cast(entryCount())); - for(const auto &element : d->childElements) { + for(const auto &element : std::as_const(d->childElements)) { data.append(element); data.append('\0'); } - for(const auto &frame : d->embeddedFrameList) { + for(const auto &frame : std::as_const(d->embeddedFrameList)) { frame->header()->setVersion(header()->version()); data.append(frame->render()); } diff --git a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp index 7027e8d7..d37eea4a 100644 --- a/taglib/mpeg/id3v2/frames/textidentificationframe.cpp +++ b/taglib/mpeg/id3v2/frames/textidentificationframe.cpp @@ -294,7 +294,8 @@ PropertyMap TextIdentificationFrame::makeTIPLProperties() const } const StringList l = fieldList(); for(auto it = l.begin(); it != l.end(); ++it) { - auto found = std::find_if(involvedPeople.begin(), involvedPeople.end(), [=](const auto &person) { return *it == person.first; }); + auto found = std::find_if(involvedPeople.begin(), involvedPeople.end(), + [=](const auto &person) { return *it == person.first; }); if(found != involvedPeople.end()) { map.insert(found->second, (++it)->split(",")); } diff --git a/taglib/mpeg/id3v2/id3v2frame.cpp b/taglib/mpeg/id3v2/id3v2frame.cpp index d41d4095..af7db1b5 100644 --- a/taglib/mpeg/id3v2/id3v2frame.cpp +++ b/taglib/mpeg/id3v2/id3v2frame.cpp @@ -69,7 +69,8 @@ namespace if(frameID.size() != 4) return false; - return std::none_of(frameID.begin(), frameID.end(), [](auto c) { return (c < 'A' || c > 'Z') && (c < '0' || c > '9'); }); + return std::none_of(frameID.begin(), frameID.end(), + [](auto c) { return (c < 'A' || c > 'Z') && (c < '0' || c > '9'); }); } } // namespace diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp index fda08581..6431d0e4 100644 --- a/taglib/mpeg/id3v2/id3v2framefactory.cpp +++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp @@ -143,7 +143,8 @@ std::pair FrameFactory::prepareFrameHeader( } #endif - if(std::any_of(frameID.begin(), frameID.end(), [](auto c) { return (c < 'A' || c > 'Z') && (c < '0' || c > '9'); })) { + if(std::any_of(frameID.cbegin(), frameID.cend(), + [](auto c) { return (c < 'A' || c > 'Z') && (c < '0' || c > '9'); })) { delete header; return { nullptr, false }; } diff --git a/taglib/ogg/xiphcomment.cpp b/taglib/ogg/xiphcomment.cpp index 3fa924ea..cbba1f82 100644 --- a/taglib/ogg/xiphcomment.cpp +++ b/taglib/ogg/xiphcomment.cpp @@ -191,7 +191,8 @@ void Ogg::XiphComment::setTrack(unsigned int i) bool Ogg::XiphComment::isEmpty() const { - return std::all_of(d->fieldListMap.begin(), d->fieldListMap.end(), [](const auto &field) { return field.second.isEmpty(); }); + return std::all_of(d->fieldListMap.cbegin(), d->fieldListMap.cend(), + [](const auto &field) { return field.second.isEmpty(); }); } unsigned int Ogg::XiphComment::fieldCount() const diff --git a/taglib/toolkit/tpropertymap.cpp b/taglib/toolkit/tpropertymap.cpp index 46cc1065..f6dce83e 100644 --- a/taglib/toolkit/tpropertymap.cpp +++ b/taglib/toolkit/tpropertymap.cpp @@ -97,7 +97,8 @@ bool PropertyMap::contains(const String &key) const bool PropertyMap::contains(const PropertyMap &other) const { - return std::all_of(other.begin(), other.end(), [this](const auto &o) { return contains(o.first) && (*this)[o.first] == o.second; }); + return std::all_of(other.begin(), other.end(), + [this](const auto &o) { return contains(o.first) && (*this)[o.first] == o.second; }); } PropertyMap &PropertyMap::erase(const String &key)