taglib: fix -Wdeprecated-copy warnings
authorAlexandre Janniaux <ajanni@videolabs.io>
Fri, 7 Feb 2020 22:50:00 +0000 (23:50 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
commit05f513dfd77edbd94b44b93690deccdcd2f26615
tree9fee9b5ba6aa859f7e1ef3475fb717201c17d612
parentf281b4cad535ddfe4f7ba9a0b322f8d5a3c2c713
taglib: fix -Wdeprecated-copy warnings

Warnings were happening because we were using copy operator= as the
assigned object was already initialized. This patch use the copy
constructor or move constructor instead if available.

Those warnings were:

../../modules/meta_engine/taglib.cpp: In function ‘void ReadMetaFromXiph(TagLib::Ogg::XiphComment*, demux_meta_t*, vlc_meta_t*)’:
../../modules/meta_engine/taglib.cpp:672:39: warning: implicitly-declared ‘TagLib::StringList& TagLib::StringList::operator=(const TagLib::StringList&)’ is deprecated [-Wdeprecated-copy]
  672 |     list = tag->fieldListMap()[keyName];                                       \
      |                                       ^
../../modules/meta_engine/taglib.cpp:681:5: note: in expansion of macro ‘SET’
  681 |     SET( "COPYRIGHT", Copyright );
      |     ^~~
In file included from /usr/include/taglib/fileref.h:30,
                 from ../../modules/meta_engine/taglib.cpp:58:
/usr/include/taglib/tstringlist.h:59:5: note: because ‘TagLib::StringList’ has user-provided ‘TagLib::StringList::StringList(const TagLib::StringList&)’
   59 |     StringList(const StringList &l);
      |     ^~~~~~~~~~

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit be4f907a0e834c10277b8217520f745238da1c13)

Gbp-Pq: Name 0037-taglib-fix-Wdeprecated-copy-warnings.patch
modules/meta_engine/taglib.cpp