[gnome-commander/gcmd-1-12] Avoid confusion of std::vector and Exiv2::vector
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-12] Avoid confusion of std::vector and Exiv2::vector
- Date: Wed, 10 Mar 2021 07:15:01 +0000 (UTC)
commit 713a91813cbea12cf0277dec05877d13ce0c163a
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date: Thu Feb 25 22:41:06 2021 +0900
Avoid confusion of std::vector and Exiv2::vector
With gcc-11 and glibc-2.33.9000-1, enabling Exiv2 shows the following error:
```
builddir/build/BUILD/GIT/gnome-commander/_BUILDDIR/../src/tags/gnome-cmd-tags-exiv2.cc: In function 'void
readTags(GnomeCmdFileMetadata*, const T&)':
/builddir/build/BUILD/GIT/gnome-commander/_BUILDDIR/../src/tags/gnome-cmd-tags-exiv2.cc:77:32: error:
template argument 1 is invalid
77 | vector<byte> buff(i->value().size()+1);
| ^
/builddir/build/BUILD/GIT/gnome-commander/_BUILDDIR/../src/tags/gnome-cmd-tags-exiv2.cc:77:32: error:
template argument 2 is invalid
/builddir/build/BUILD/GIT/gnome-commander/_BUILDDIR/../src/tags/gnome-cmd-tags-exiv2.cc:79:42: error:
invalid types 'int[int]' for array subscript
79 | i->value().copy(&buff[0],invalidByteOrder);
| ^
/builddir/build/BUILD/GIT/gnome-commander/_BUILDDIR/../src/tags/gnome-cmd-tags-exiv2.cc:80:53: error:
invalid types 'int[int]' for array subscript
80 | metadata->add(tag,(char *) &buff[0]);
| ^
```
Explicitly specifying to use Exiv2::vector fixes this issue.
src/tags/gnome-cmd-tags-exiv2.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/tags/gnome-cmd-tags-exiv2.cc b/src/tags/gnome-cmd-tags-exiv2.cc
index ac073730..24059fc7 100644
--- a/src/tags/gnome-cmd-tags-exiv2.cc
+++ b/src/tags/gnome-cmd-tags-exiv2.cc
@@ -74,7 +74,7 @@ void readTags(GnomeCmdFileMetadata *metadata, const T &data)
case TAG_EXIF_FLASHPIXVERSION:
case TAG_EXIF_INTEROPERABILITYVERSION:
{
- vector<byte> buff(i->value().size()+1);
+ vector<Exiv2::byte> buff(i->value().size()+1);
i->value().copy(&buff[0],invalidByteOrder);
metadata->add(tag,(char *) &buff[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]