diff --git a/src/bmffimage.cpp b/src/bmffimage.cpp index 28c8a0c8..8628951f 100644 --- a/src/bmffimage.cpp +++ b/src/bmffimage.cpp @@ -299,7 +299,7 @@ namespace Exiv2 bLF = false; } io_->seek(skip, BasicIo::cur); - while (io_->tell() < (address + box.length)) { + while (io_->tell() < static_cast((address + box.length))) { io_->seek(boxHandler(out,option,depth + 1), BasicIo::beg); } // post-process meta box to recover Exif and XMP @@ -417,7 +417,7 @@ namespace Exiv2 bLF = false; } if (name == "cano") { - while (io_->tell() < (address + box.length)) { + while (io_->tell() < static_cast(address + box.length)) { io_->seek(boxHandler(out,option,depth + 1), BasicIo::beg); } } else if ( name == "xmp" ) { diff --git a/src/http.cpp b/src/http.cpp index 96e3f942..d05babec 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -252,7 +252,7 @@ int Exiv2::http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::stri //////////////////////////////////// // open the socket - int sockfd = socket(AF_INET , SOCK_STREAM,IPPROTO_TCP) ; + int sockfd = static_cast(socket(AF_INET , SOCK_STREAM,IPPROTO_TCP)); if (sockfd < 0) return error(errors, "unable to create socket\n", NULL, NULL, 0); diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index cbc96f0a..30841cd2 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -126,7 +126,7 @@ namespace Exiv2 { const byte* pEnd = pPsData + sizePsData; int ret = 0; while (pCur < pEnd - && 0 == (ret = Photoshop::locateIptcIrb(pCur, pEnd - pCur, + && 0 == (ret = Photoshop::locateIptcIrb(pCur, static_cast(pEnd - pCur), &record, &sizeHdr, &sizeIptc))) { pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1); } @@ -539,7 +539,7 @@ namespace Exiv2 { const byte* pCur = &psBlob[0]; const byte* pEnd = pCur + psBlob.size(); while ( pCur < pEnd - && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, + && 0 == Photoshop::locateIptcIrb(pCur, static_cast(pEnd - pCur), &record, &sizeHdr, &sizeIptc)) { #ifdef EXIV2_DEBUG_MESSAGES std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n"; @@ -1200,11 +1200,11 @@ namespace Exiv2 { const byte* chunkEnd = chunkStart + newPsData.size_; while (chunkStart < chunkEnd) { // Determine size of next chunk - long chunkSize = chunkEnd - chunkStart; + long chunkSize = static_cast(chunkEnd - chunkStart); if (chunkSize > maxChunkSize) { chunkSize = maxChunkSize; // Don't break at a valid IRB boundary - const long writtenSize = chunkStart - newPsData.pData_; + const long writtenSize = static_cast(chunkStart - newPsData.pData_); if (Photoshop::valid(newPsData.pData_, writtenSize + chunkSize)) { // Since an IRB has minimum size 12, // (chunkSize - 8) can't be also a IRB boundary diff --git a/src/pngchunk_int.cpp b/src/pngchunk_int.cpp index 08a4c4f0..bfa5546d 100644 --- a/src/pngchunk_int.cpp +++ b/src/pngchunk_int.cpp @@ -312,7 +312,7 @@ namespace Exiv2 { const byte* pCur = psData.pData_; while ( pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, - pEnd - pCur, + static_cast(pEnd - pCur), &record, &sizeHdr, &sizeIptc)) { @@ -490,14 +490,14 @@ namespace Exiv2 { std::string PngChunk::zlibCompress(const std::string& text) { - uLongf compressedLen = (text.size() * 2); // just a starting point + uLongf compressedLen = static_cast(text.size() * 2); // just a starting point int zlibResult; DataBuf arr; do { arr.alloc(compressedLen); zlibResult = compress2(arr.pData_, &compressedLen, - (const Bytef*)text.data(), text.size(), + (const Bytef*)text.data(), static_cast(text.size()), Z_BEST_COMPRESSION); switch (zlibResult) { diff --git a/src/value.cpp b/src/value.cpp index c9f4ea5f..eb85e29a 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -221,7 +221,7 @@ namespace Exiv2 { long DataValue::copy(byte* buf, ByteOrder /*byteOrder*/) const { // byteOrder not needed - return std::copy(value_.begin(), value_.end(), buf) - buf; + return static_cast(std::copy(value_.begin(), value_.end(), buf) - buf); } long DataValue::size() const @@ -1055,7 +1055,7 @@ namespace Exiv2 { tms.tm_mday = date_.day; tms.tm_mon = date_.month - 1; tms.tm_year = date_.year - 1900; - auto l = std::mktime(&tms); + long l = static_cast(std::mktime(&tms)); ok_ = (l != -1); return l; } diff --git a/src/xmp.cpp b/src/xmp.cpp index 5be6b393..1aaf98aa 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -597,7 +597,7 @@ namespace Exiv2 { return 2; } - SXMPMeta meta(xmpPacket.data(), xmpPacket.size()); + SXMPMeta meta(xmpPacket.data(), static_cast(xmpPacket.size())); SXMPIterator iter(meta); std::string schemaNs, propPath, propValue; XMP_OptionBits opt;