From 3b68f497feb9f794664d9df891f383801f8894ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 12 Oct 2020 20:05:17 +0200 Subject: [PATCH] Fixed ODR (One Definition Rule) violation --- src/map/geotiff.cpp | 10 +++++----- src/map/tar.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/map/geotiff.cpp b/src/map/geotiff.cpp index 4fcc333b..8783a7ff 100644 --- a/src/map/geotiff.cpp +++ b/src/map/geotiff.cpp @@ -61,19 +61,19 @@ ((map).contains(key) && (map).value(key).SHORT != 32767) -typedef struct { +struct TIFFHeader { quint16 KeyDirectoryVersion; quint16 KeyRevision; quint16 MinorRevision; quint16 NumberOfKeys; -} Header; +}; -typedef struct { +struct KeyEntry { quint16 KeyID; quint16 TIFFTagLocation; quint16 Count; quint16 ValueOffset; -} KeyEntry; +}; bool GeoTIFF::readEntry(TIFFFile &file, Ctx &ctx) const @@ -196,7 +196,7 @@ bool GeoTIFF::readMatrix(TIFFFile &file, quint32 offset, double matrix[16]) cons bool GeoTIFF::readKeys(TIFFFile &file, Ctx &ctx, QMap &kv) const { - Header header; + TIFFHeader header; KeyEntry entry; Value value; diff --git a/src/map/tar.cpp b/src/map/tar.cpp index 9cbbe474..c56366f7 100644 --- a/src/map/tar.cpp +++ b/src/map/tar.cpp @@ -9,7 +9,7 @@ #define BLOCKCOUNT(size) \ ((size)/BLOCKSIZE + ((size) % BLOCKSIZE > 0 ? 1 : 0)) -struct Header +struct TARHeader { char name[100]; /* 0 */ char mode[8]; /* 100 */ @@ -61,7 +61,7 @@ bool Tar::open() bool Tar::loadTar() { char buffer[BLOCKSIZE]; - struct Header *hdr = (struct Header*)&buffer; + TARHeader *hdr = (TARHeader*)&buffer; quint64 size; qint64 ret; @@ -113,7 +113,7 @@ bool Tar::loadTmi(const QString &path) QByteArray Tar::file(const QString &name) { char buffer[BLOCKSIZE]; - struct Header *hdr = (struct Header*)&buffer; + TARHeader *hdr = (TARHeader*)&buffer; quint64 size; QMap::const_iterator it(_index.find(name));