From ea201ce613b29a39a34f5d68cd74c1594726d227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Thu, 17 Feb 2022 22:06:27 +0100 Subject: [PATCH] Remove dead code --- app/actions.cpp | 7 ------- app/actions.hpp | 14 ------------- app/exiv2.cpp | 19 ----------------- app/exiv2app.hpp | 4 ---- src/basicio.cpp | 26 ++++++++++------------- src/convert.cpp | 30 ++++----------------------- src/crwimage_int.cpp | 12 ----------- src/crwimage_int.hpp | 6 ------ src/http.cpp | 2 -- src/image.cpp | 5 +++-- src/image_int.cpp | 46 ----------------------------------------- src/image_int.hpp | 9 +------- src/iptc.cpp | 6 +++--- src/jp2image.cpp | 6 ++---- src/minoltamn_int.cpp | 11 ---------- src/minoltamn_int.hpp | 3 --- src/properties.cpp | 2 ++ src/psdimage.cpp | 24 +++++++++++---------- src/rafimage.cpp | 7 +++---- src/tags.cpp | 1 + src/tiffvisitor_int.cpp | 1 + src/value.cpp | 1 + src/webpimage.cpp | 2 -- 23 files changed, 45 insertions(+), 199 deletions(-) diff --git a/app/actions.cpp b/app/actions.cpp index 3f751499..f26f6916 100644 --- a/app/actions.cpp +++ b/app/actions.cpp @@ -175,11 +175,6 @@ namespace Action { registry_.clear(); } - void TaskFactory::registerTask(TaskType type, Task::UniquePtr task) - { - registry_[type] = std::move(task); - } - TaskFactory::TaskFactory() { registry_.emplace(adjust, std::make_unique()); @@ -595,7 +590,6 @@ namespace Action { if (Params::instance().printItems_ & Params::prHex) { if (!first) std::cout << std::endl; - first = false; Exiv2::DataBuf buf(md.size()); md.copy(buf.data(), pImage->byteOrder()); Exiv2::hexdump(std::cout, buf.c_data(), buf.size()); @@ -1892,7 +1886,6 @@ namespace { // #1148 use Raw XMP packet if there are no XMP modification commands int tRawSidecar = Params::ctXmpSidecar | Params::ctXmpRaw; // option -eXX - // printTarget("in metacopy",Params::instance().target_,true); if (Params::instance().modifyCmds_.empty() && (Params::instance().target_ & tRawSidecar) == tRawSidecar) { // std::cout << "short cut" << std::endl; // http://www.cplusplus.com/doc/tutorial/files/ diff --git a/app/actions.hpp b/app/actions.hpp index 4520f219..b6ff516e 100644 --- a/app/actions.hpp +++ b/app/actions.hpp @@ -123,20 +123,6 @@ namespace Action { */ Task::UniquePtr create(TaskType type); - /*! - @brief Register a task prototype together with its type. - - The task factory creates new tasks of a given type by cloning its - associated prototype. Additional tasks can be registered. If called - for a type which already exists in the list, the corresponding - prototype is replaced. - - @param type Task type. - @param task Pointer to the prototype. Ownership is transferred to the - task factory. That's what the auto pointer indicates. - */ - void registerTask(TaskType type, Task::UniquePtr task); - private: //! Prevent construction other than through instance(). TaskFactory(); diff --git a/app/exiv2.cpp b/app/exiv2.cpp index 182ab7ae..bc01364e 100644 --- a/app/exiv2.cpp +++ b/app/exiv2.cpp @@ -248,25 +248,6 @@ void Params::usage(std::ostream& os) const << _("Image metadata manipulation tool.\n"); } -std::string Params::printTarget(const std::string &before, int target, bool bPrint, std::ostream& out) -{ - std::string t; - if ( target & Params::ctExif ) t+= 'e'; - if ( target & Params::ctXmpSidecar ) t+= 'X'; - if ( target & Params::ctXmpRaw ) t+= target & Params::ctXmpSidecar ? 'X' : 'R' ; - if ( target & Params::ctIptc ) t+= 'i'; - if ( target & Params::ctIccProfile ) t+= 'C'; - if ( target & Params::ctIptcRaw ) t+= 'I'; - if ( target & Params::ctXmp ) t+= 'x'; - if ( target & Params::ctComment ) t+= 'c'; - if ( target & Params::ctThumb ) t+= 't'; - if ( target & Params::ctPreview ) t+= 'p'; - if ( target & Params::ctStdInOut ) t+= '-'; - - if ( bPrint ) out << before << " :" << t << std::endl; - return t; -} - void Params::help(std::ostream& os) const { usage(os); diff --git a/app/exiv2app.hpp b/app/exiv2app.hpp index 97230021..680bb7f2 100644 --- a/app/exiv2app.hpp +++ b/app/exiv2app.hpp @@ -339,10 +339,6 @@ public: //! Print version information to an output stream. static void version(bool verbose = false, std::ostream& os = std::cout); - //! Print target_ - static std::string printTarget(const std::string& before, int target, bool bPrint = false, - std::ostream& out = std::cout); - //! getStdin binary data read from stdin to DataBuf /* stdin can be used by multiple images in the exiv2 command line: diff --git a/src/basicio.cpp b/src/basicio.cpp index 5e9ddd72..57057783 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -352,10 +352,10 @@ namespace Exiv2 { byte buf[4096]; long readCount = 0; - long writeCount = 0; long writeTotal = 0; while ((readCount = src.read(buf, sizeof(buf)))) { - writeTotal += writeCount = static_cast(std::fwrite(buf, 1, readCount, p_->fp_)); + long writeCount = static_cast(std::fwrite(buf, 1, readCount, p_->fp_)); + writeTotal += writeCount; if (writeCount != readCount) { // try to reset back to where write stopped src.seek(writeCount-readCount, BasicIo::cur); @@ -678,18 +678,17 @@ namespace Exiv2 { { return type_ == bNone; } - bool isInMem () const - { - return type_ == bMemory; - } + bool isKnown () const { return type_ == bKnown; } + byte* getData () const { return data_; } + size_t getSize () const { return size_; @@ -1247,9 +1246,6 @@ namespace Exiv2 { size_t left = 0; size_t right = 0; size_t blockIndex = 0; - size_t i = 0; - size_t readCount = 0; - size_t blockSize = 0; auto buf = new byte [p_->blockSize_]; size_t nBlocks = (p_->size_ + p_->blockSize_ - 1) / p_->blockSize_; @@ -1257,11 +1253,11 @@ namespace Exiv2 { src.seek(0, BasicIo::beg); bool findDiff = false; while (blockIndex < nBlocks && !src.eof() && !findDiff) { - blockSize = p_->blocksMap_[blockIndex].getSize(); + size_t blockSize = p_->blocksMap_[blockIndex].getSize(); bool isFakeData = p_->blocksMap_[blockIndex].isKnown(); // fake data - readCount = static_cast(src.read(buf, static_cast(blockSize))); + size_t readCount = static_cast(src.read(buf.data(), static_cast(blockSize))); byte* blockData = p_->blocksMap_[blockIndex].getData(); - for (i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) { + for (size_t i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) { if ((!isFakeData && buf[i] != blockData[i]) || (isFakeData && buf[i] != 0)) { findDiff = true; } else { @@ -1276,14 +1272,14 @@ namespace Exiv2 { blockIndex = nBlocks; while (blockIndex > 0 && right < src.size() && !findDiff) { blockIndex--; - blockSize = p_->blocksMap_[blockIndex].getSize(); + size_t blockSize = p_->blocksMap_[blockIndex].getSize(); if(src.seek(-1 * (blockSize + right), BasicIo::end)) { findDiff = true; } else { bool isFakeData = p_->blocksMap_[blockIndex].isKnown(); // fake data - readCount = src.read(buf, static_cast(blockSize)); + size_t readCount = src.read(buf.data(), static_cast(blockSize)); byte* blockData = p_->blocksMap_[blockIndex].getData(); - for (i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) { + for (size_t i = 0; (i < readCount) && (i < blockSize) && !findDiff; i++) { if ((!isFakeData && buf[readCount - i - 1] != blockData[blockSize - i - 1]) || (isFakeData && buf[readCount - i - 1] != 0)) { findDiff = true; } else { diff --git a/src/convert.cpp b/src/convert.cpp index 9197e2cf..316fb679 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -284,8 +284,6 @@ namespace Exiv2 { //@{ //! Get the value of the erase flag, see also setErase(bool on). bool erase() const { return erase_; } - //! Get the value of the overwrite flag, see also setOverwrite(bool on). - bool overwrite() const { return overwrite_; } //@} private: @@ -293,7 +291,6 @@ namespace Exiv2 { bool prepareIptcTarget(const char* to, bool force =false); bool prepareXmpTarget(const char* to, bool force =false); std::string computeExifDigest(bool tiff); - std::string computeIptcDigest(); // DATA static const Conversion conversion_[]; //(min)) * 60.0; min = static_cast(static_cast(min)); - sep2 = ','; } if ( in.bad() || !(ref == 'N' || ref == 'S' || ref == 'E' || ref == 'W') @@ -1256,28 +1252,6 @@ namespace Exiv2 { writeExifDigest(); } - std::string Converter::computeIptcDigest() - { -#ifdef EXV_HAVE_XMP_TOOLKIT - std::ostringstream res; - MD5_CTX context; - unsigned char digest[16]; - - MD5Init(&context); - - DataBuf data = IptcParser::encode(*iptcData_); - MD5Update(&context, data.c_data(), data.size()); - MD5Final(digest, &context); - res << std::setw(2) << std::setfill('0') << std::hex << std::uppercase; - for (auto&& i : digest) { - res << static_cast(i); - } - return res.str(); -#else - return std::string(""); -#endif - } - // ************************************************************************* // free functions @@ -1288,6 +1262,7 @@ namespace Exiv2 { converter.cnvToXmp(); } + /// \todo not used internally. We should at least have unit tests for this. void moveExifToXmp(ExifData& exifData, XmpData& xmpData) { Converter converter(exifData, xmpData); @@ -1301,6 +1276,7 @@ namespace Exiv2 { converter.cnvFromXmp(); } + /// \todo not used internally. We should at least have unit tests for this. void moveXmpToExif(XmpData& xmpData, ExifData& exifData) { Converter converter(exifData, xmpData); @@ -1323,6 +1299,7 @@ namespace Exiv2 { converter.cnvToXmp(); } + /// \todo not used internally. We should at least have unit tests for this. void moveIptcToXmp(IptcData& iptcData, XmpData& xmpData, const char *iptcCharset) { if (!iptcCharset) iptcCharset = iptcData.detectCharset(); @@ -1338,6 +1315,7 @@ namespace Exiv2 { converter.cnvFromXmp(); } + /// \todo not used internally. We should at least have unit tests for this. void moveXmpToIptc(XmpData& xmpData, IptcData& iptcData) { Converter converter(iptcData, xmpData); diff --git a/src/crwimage_int.cpp b/src/crwimage_int.cpp index 34227ca6..d1e33647 100644 --- a/src/crwimage_int.cpp +++ b/src/crwimage_int.cpp @@ -53,7 +53,6 @@ namespace { // ***************************************************************************** // local definitions namespace { - //! @cond IGNORE constexpr RotationMap::OmList RotationMap::omList_[] = { { 1, 0 }, { 3, 180 }, @@ -87,7 +86,6 @@ namespace { } return d; } - //! @endcond } // namespace namespace Exiv2 { @@ -503,16 +501,6 @@ namespace Exiv2 { } } // CiffComponent::writeDirEntry - void CiffHeader::print(std::ostream& os, const std::string& prefix) const - { - std::ios::fmtflags f( os.flags() ); - os << prefix - << _("Header, offset") << " = 0x" << std::setw(8) << std::setfill('0') - << std::hex << std::right << offset_ << "\n"; - if (pRootDir_) pRootDir_->print(os, byteOrder_, prefix); - os.flags(f); - } // CiffHeader::print - void CiffComponent::print(std::ostream& os, ByteOrder byteOrder, const std::string& prefix) const diff --git a/src/crwimage_int.hpp b/src/crwimage_int.hpp index 81e80068..73cbc41f 100644 --- a/src/crwimage_int.hpp +++ b/src/crwimage_int.hpp @@ -481,13 +481,7 @@ namespace Exiv2 { @param image Image to add metadata to */ void decode(Image& image) const; - /*! - @brief Print debug info for the CRW image to \em os. - @param os Output stream to write to. - @param prefix Prefix to be written before each line of output. - */ - void print(std::ostream& os, const std::string& prefix ="") const; //! Return the byte order (little or big endian). ByteOrder byteOrder() const { return byteOrder_; } /*! diff --git a/src/http.cpp b/src/http.cpp index 9334b81f..5c04fd68 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -239,8 +239,6 @@ int Exiv2::http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::stri servername_p = Proxy.Host.c_str(); port_p = Proxy.Port.c_str(); page = url.c_str(); - std::string p(proxy?proxi:PROXI); - // std::cerr << p << '=' << prox << " page = " << page << std::endl; } if ( !port [0] ) port = "80"; if ( !port_p[0] ) port_p = "80"; diff --git a/src/image.cpp b/src/image.cpp index 298f9d79..bf40c543 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -284,6 +284,7 @@ namespace Exiv2 { return Image::byteSwap(v,bSwap); } + /// \todo not used internally. At least we should test it uint64_t Image::byteSwap8(const DataBuf& buf,size_t offset,bool bSwap) { uint64_t v = 0; @@ -373,7 +374,6 @@ namespace Exiv2 { // Break for unknown tag types else we may segfault. if ( !typeValid(type) ) { EXV_ERROR << "invalid type in tiff structure" << type << std::endl; - start = 0; // break from do loop throw Error(kerInvalidTypeValue); } @@ -525,7 +525,6 @@ namespace Exiv2 { out << Internal::indent(depth) << "END " << io.path() << std::endl; } out.flush(); - depth--; } void Image::printTiffStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,int depth,size_t offset /*=0*/) @@ -582,6 +581,7 @@ namespace Exiv2 { return xmpPacket_; } + /// \todo not used internally. At least we should test it void Image::setMetadata(const Image& image) { if (checkMode(mdExif) & amWrite) { @@ -754,6 +754,7 @@ namespace Exiv2 { return ImageFactory::checkType(imageType_, *io_, false); } + /// \todo not used internally. At least we should test it bool Image::supportsMetadata(MetadataId metadataId) const { return (supportedMetadata_ & metadataId) != 0; diff --git a/src/image_int.cpp b/src/image_int.cpp index 8db6de19..84ea26b7 100644 --- a/src/image_int.cpp +++ b/src/image_int.cpp @@ -57,52 +57,6 @@ namespace Exiv2 return result; } - std::string binaryToHex(const byte* data, size_t size) - { - std::stringstream hexOutput; - - auto tl = size_t(size / 16) * 16; - auto tl_offset = size_t(size) - tl; - - for (size_t loop = 0; loop < size; loop++) { - if (data[loop] < 16) { - hexOutput << "0"; - } - hexOutput << std::hex << static_cast(data[loop]); - if ((loop % 8) == 7) { - hexOutput << " "; - } - if ((loop % 16) == 15 || loop == (tl + tl_offset - 1)) { - int max = 15; - if (loop >= tl) { - max = int(tl_offset) - 1; - for (int offset = 0; offset < int(16 - tl_offset); offset++) { - if ((offset % 8) == 7) { - hexOutput << " "; - } - hexOutput << " "; - } - } - hexOutput << " "; - for (int offset = max; offset >= 0; offset--) { - if (offset == (max - 8)) { - hexOutput << " "; - } - byte c = '.'; - if (data[loop - offset] >= 0x20 && data[loop - offset] <= 0x7E) { - c = data[loop - offset]; - } - hexOutput << static_cast(c); - } - hexOutput << std::endl; - } - } - - hexOutput << std::endl << std::endl << std::endl; - - return hexOutput.str(); - } - std::string indent(int32_t d) { std::string result; diff --git a/src/image_int.hpp b/src/image_int.hpp index fe50d62c..7058795c 100644 --- a/src/image_int.hpp +++ b/src/image_int.hpp @@ -120,14 +120,7 @@ namespace Exiv2 { return binaryToStringHelper(sl); } - /*! - @brief format binary for display of raw data . - */ - std::string binaryToHex(const byte *data, size_t size); - - /*! - @brief indent output for kpsRecursive in \em printStructure() \em . - */ + /// @brief indent output for kpsRecursive in \em printStructure() \em . std::string indent(int32_t depth); }} // namespace Internal, Exiv2 diff --git a/src/iptc.cpp b/src/iptc.cpp index c30b7e78..e2229763 100644 --- a/src/iptc.cpp +++ b/src/iptc.cpp @@ -327,11 +327,13 @@ namespace Exiv2 { FindIptcdatum(dataset, record)); } + /// \todo not used internally. At least we should test it void IptcData::sortByKey() { std::sort(iptcMetadata_.begin(), iptcMetadata_.end(), cmpMetadataByKey); } + /// \todo not used internally. At least we should test it void IptcData::sortByTag() { std::sort(iptcMetadata_.begin(), iptcMetadata_.end(), cmpMetadataByTag); @@ -350,8 +352,7 @@ namespace Exiv2 { size_t i = 0; while (i < bytes.size() - 3 && bytes.at(i) != 0x1c) i++; - depth++; - out << Internal::indent(depth) << "Record | DataSet | Name | Length | Data" << std::endl; + out << Internal::indent(++depth) << "Record | DataSet | Name | Length | Data" << std::endl; while (i < bytes.size() - 3) { if (bytes.at(i) != 0x1c) { break; @@ -370,7 +371,6 @@ namespace Exiv2 { << std::endl; i += 5 + len; } - depth--; } const char *IptcData::detectCharset() const diff --git a/src/jp2image.cpp b/src/jp2image.cpp index 0c2648ff..b31908b5 100644 --- a/src/jp2image.cpp +++ b/src/jp2image.cpp @@ -221,7 +221,6 @@ static void boxes_check(size_t b,size_t m) throw Error(kerNotAnImage, "JPEG-2000"); } - long position = 0; Jp2BoxHeader box = {0,0}; Jp2BoxHeader subBox = {0,0}; Jp2ImageHeaderBox ihdr = {0,0,0,0,0,0,0,0}; @@ -231,7 +230,7 @@ static void boxes_check(size_t b,size_t m) while (io_->read(reinterpret_cast(&box), sizeof(box)) == sizeof(box)) { boxes_check(boxes++,boxem ); - position = io_->tell(); + long position = io_->tell(); box.length = getLong(reinterpret_cast(&box.length), bigEndian); box.type = getLong(reinterpret_cast(&box.type), bigEndian); #ifdef EXIV2_DEBUG_MESSAGES @@ -490,7 +489,6 @@ static void boxes_check(size_t b,size_t m) if ( bPrint || bXMP || bICC || bIPTCErase ) { - long position = 0; Jp2BoxHeader box = {1,1}; Jp2BoxHeader subBox = {1,1}; Jp2UuidBox uuid = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; @@ -498,7 +496,7 @@ static void boxes_check(size_t b,size_t m) while (box.length && box.type != kJp2BoxTypeClose && io_->read(reinterpret_cast(&box), sizeof(box)) == sizeof(box)) { - position = io_->tell(); + long position = io_->tell(); box.length = getLong(reinterpret_cast(&box.length), bigEndian); box.type = getLong(reinterpret_cast(&box.type), bigEndian); enforce(box.length <= sizeof(box)+io_->size()-io_->tell() , Exiv2::kerCorruptedMetadata); diff --git a/src/minoltamn_int.cpp b/src/minoltamn_int.cpp index a445369f..b5b6b64e 100644 --- a/src/minoltamn_int.cpp +++ b/src/minoltamn_int.cpp @@ -2490,16 +2490,5 @@ namespace Exiv2 { return EXV_PRINT_TAG(minoltaSonyZoneMatching)(os, value, metadata); } - std::ostream& printMinoltaSonyFlashExposureComp(std::ostream& os, const Value& value, const ExifData*) - { - std::ios::fmtflags f( os.flags() ); - if (value.count() != 1 || value.typeId() != signedRational) { - return os << "(" << value << ")"; - } - os << std::fixed << std::setprecision(2) << value.toFloat(0) << " EV"; - os.flags(f); - return os; - } - } // namespace Internal } // namespace Exiv2 diff --git a/src/minoltamn_int.hpp b/src/minoltamn_int.hpp index 1fab3ffd..e8aa9924 100644 --- a/src/minoltamn_int.hpp +++ b/src/minoltamn_int.hpp @@ -136,9 +136,6 @@ namespace Exiv2 { //! Print Minolta/Sony ZoneMatching values to readable labels. std::ostream& printMinoltaSonyZoneMatching(std::ostream&, const Value&, const ExifData*); - //! Print Minolta/Sony FlashExposureComp values to readable labels. - std::ostream& printMinoltaSonyFlashExposureComp(std::ostream&, const Value&, const ExifData*); - // TODO: Added shared methods here. }} // namespace Internal, Exiv2 diff --git a/src/properties.cpp b/src/properties.cpp index 3a55e5cf..31ed9c39 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -3943,6 +3943,7 @@ namespace Exiv2 { XmpProperties::NsRegistry XmpProperties::nsRegistry_; std::mutex XmpProperties::mutex_; + /// \todo not used internally. At least we should test it const XmpNsInfo* XmpProperties::lookupNsRegistry(const XmpNsInfo::Prefix& prefix) { std::lock_guard scoped_read_lock(mutex_); @@ -4095,6 +4096,7 @@ namespace Exiv2 { return pi; } + /// \todo not used internally. At least we should test it const char* XmpProperties::nsDesc(const std::string& prefix) { return nsInfo(prefix)->desc_; diff --git a/src/psdimage.cpp b/src/psdimage.cpp index ccf21e98..e0420be0 100644 --- a/src/psdimage.cpp +++ b/src/psdimage.cpp @@ -399,13 +399,15 @@ namespace Exiv2 { #endif // Copy colorData uint32_t readTotal = 0; - long toRead = 0; while (readTotal < colorDataLength) { - toRead = static_cast(colorDataLength - readTotal) < lbuf.size() - ? static_cast(colorDataLength - readTotal) : lbuf.size(); - if (io_->read(lbuf.data(), toRead) != toRead) throw Error(kerNotAnImage, "Photoshop"); + long toRead = static_cast(colorDataLength - readTotal) < lbuf.size() + ? static_cast(colorDataLength - readTotal) + : lbuf.size(); + if (io_->read(lbuf.data(), toRead) != toRead) + throw Error(kerNotAnImage, "Photoshop"); readTotal += toRead; - if (outIo.write(lbuf.c_data(), toRead) != toRead) throw Error(kerImageWriteFailed); + if (outIo.write(lbuf.c_data(), toRead) != toRead) + throw Error(kerImageWriteFailed); } if (outIo.error()) throw Error(kerImageWriteFailed); @@ -505,15 +507,17 @@ namespace Exiv2 { if (outIo.write(buf, 4) != 4) throw Error(kerImageWriteFailed); readTotal = 0; - toRead = 0; while (readTotal < pResourceSize) { - toRead = static_cast(pResourceSize - readTotal) < lbuf.size() - ? static_cast(pResourceSize - readTotal) : lbuf.size(); + /// \todo almost same code as in lines 403-410. Factor out & reuse! + long toRead = static_cast(pResourceSize - readTotal) < lbuf.size() + ? static_cast(pResourceSize - readTotal) + : lbuf.size(); if (io_->read(lbuf.data(), toRead) != toRead) { throw Error(kerNotAnImage, "Photoshop"); } readTotal += toRead; - if (outIo.write(lbuf.c_data(), toRead) != toRead) throw Error(kerImageWriteFailed); + if (outIo.write(lbuf.c_data(), toRead) != toRead) + throw Error(kerImageWriteFailed); } if (outIo.error()) throw Error(kerImageWriteFailed); newResLength += pResourceSize + adjResourceNameLen + 12; @@ -532,13 +536,11 @@ namespace Exiv2 { // Append ExifInfo resource block, if not yet written if (!exifDone) { newResLength += writeExifData(exifData_, outIo); - exifDone = true; } // Append XmpPacket resource block, if not yet written if (!xmpDone) { newResLength += writeXmpData(xmpData_, outIo); - xmpDone = true; } // Populate the fake data, only make sense for remoteio, httpio and sshio. diff --git a/src/rafimage.cpp b/src/rafimage.cpp index 92c24a4c..b3ecaa34 100644 --- a/src/rafimage.cpp +++ b/src/rafimage.cpp @@ -96,12 +96,11 @@ namespace Exiv2 { if (io_->error() || io_->eof()) throw Error(kerFailedToReadImageData); throw Error(kerNotAnImage, "RAF"); } - size_t address = 0 ; - size_t address2 = 0 ; + const bool bPrint = option==kpsBasic || option==kpsRecursive; if ( bPrint ) { io_->seek(0,BasicIo::beg); // rewind - address = io_->tell(); + size_t address = io_->tell(); const char* format = " %8d | %8d | "; { @@ -174,7 +173,7 @@ namespace Exiv2 { byte jpg_img_offset [4]; io_->read(jpg_img_offset, 4); byte jpg_img_length [4]; - address2 = io_->tell(); + size_t address2 = io_->tell(); io_->read(jpg_img_length, 4); long jpg_img_off = Exiv2::getULong(jpg_img_offset, bigEndian); diff --git a/src/tags.cpp b/src/tags.cpp index c7922964..d2b3dace 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -127,6 +127,7 @@ namespace Exiv2 { return sectionInfo[ti->sectionId_].name_; } + /// \todo not used internally. At least we should test it uint16_t ExifTags::defaultCount(const ExifKey& key) { const TagInfo* ti = tagInfo(key.tag(), static_cast(key.ifdId())); diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index e9faf6fc..50c93cc8 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -469,6 +469,7 @@ namespace Exiv2 { const uint16_t nMasks = (nPoints+15)/(sizeof(uint16_t) * 8); int nStart = 0; + /// \todo make this static struct { uint16_t tag ; uint16_t size ; diff --git a/src/value.cpp b/src/value.cpp index bfd330f6..d99c0e9f 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -1110,6 +1110,7 @@ namespace Exiv2 { return 1; } + /// \todo not used internally. At least we should test it void TimeValue::setTime( const Time& src ) { std::memcpy(&time_, &src, sizeof(time_)); diff --git a/src/webpimage.cpp b/src/webpimage.cpp index c023cf0e..3cc1c9f8 100644 --- a/src/webpimage.cpp +++ b/src/webpimage.cpp @@ -833,8 +833,6 @@ namespace Exiv2 { if (iIo.tell() % 2) { if (iIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(kerImageWriteFailed); } - - has_icc = false; } }