diff --git a/samples/addmoddel.cpp b/samples/addmoddel.cpp index 59073e07..e171eddb 100644 --- a/samples/addmoddel.cpp +++ b/samples/addmoddel.cpp @@ -29,7 +29,7 @@ try { // tag is added. exifData["Exif.Image.Model"] = "Test 1"; // AsciiValue exifData["Exif.Image.SamplesPerPixel"] = uint16_t(162); // UShortValue - exifData["Exif.Image.XResolution"] = int32_t(-2); // LongValue + exifData["Exif.Image.XResolution"] = -2; // LongValue exifData["Exif.Image.YResolution"] = Exiv2::Rational(-2, 3); // RationalValue std::cout << "Added a few tags the quick way.\n"; diff --git a/samples/xmpsample.cpp b/samples/xmpsample.cpp index 4605913d..e0fe1542 100644 --- a/samples/xmpsample.cpp +++ b/samples/xmpsample.cpp @@ -40,7 +40,7 @@ try { xmpData["Xmp.dc.two"] = 3.1415; xmpData["Xmp.dc.three"] = Exiv2::Rational(5, 7); xmpData["Xmp.dc.four"] = uint16_t(255); - xmpData["Xmp.dc.five"] = int32_t(256); + xmpData["Xmp.dc.five"] = 256; xmpData["Xmp.dc.six"] = false; // In addition, there is a dedicated assignment operator for Exiv2::Value diff --git a/src/basicio.cpp b/src/basicio.cpp index e887d444..87751915 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -1572,7 +1572,7 @@ namespace Exiv2 { { std::string data; getDataByRange( (long) lowBlock, (long) highBlock, data); - rcount = (size_t)data.length(); + rcount = data.length(); if (rcount == 0) { throw Error(kerErrorMessage, "Data By Range is empty. Please check the permission."); } @@ -1613,7 +1613,7 @@ namespace Exiv2 { if (length < 0) { // unable to get the length of remote file, get the whole file content. std::string data; p_->getDataByRange(-1, -1, data); - p_->size_ = (size_t) data.length(); + p_->size_ = data.length(); size_t nBlocks = (p_->size_ + p_->blockSize_ - 1) / p_->blockSize_; p_->blocksMap_ = new BlockMap[nBlocks]; p_->isMalloced_ = true; diff --git a/src/convert.cpp b/src/convert.cpp index 5427ab0e..77853989 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -1294,7 +1294,7 @@ namespace Exiv2 { void moveExifToXmp(ExifData& exifData, XmpData& xmpData) { - Converter converter(const_cast(exifData), xmpData); + Converter converter(exifData, xmpData); converter.setErase(); converter.cnvToXmp(); } @@ -1307,14 +1307,14 @@ namespace Exiv2 { void moveXmpToExif(XmpData& xmpData, ExifData& exifData) { - Converter converter(exifData, const_cast(xmpData)); + Converter converter(exifData, xmpData); converter.setErase(); converter.cnvFromXmp(); } void syncExifWithXmp(ExifData& exifData, XmpData& xmpData) { - Converter converter(exifData, const_cast(xmpData)); + Converter converter(exifData, xmpData); converter.syncExifWithXmp(); } @@ -1331,7 +1331,7 @@ namespace Exiv2 { { if (!iptcCharset) iptcCharset = iptcData.detectCharset(); if (!iptcCharset) iptcCharset = "ISO-8859-1"; - Converter converter(const_cast(iptcData), xmpData, iptcCharset); + Converter converter(iptcData, xmpData, iptcCharset); converter.setErase(); converter.cnvToXmp(); } @@ -1344,7 +1344,7 @@ namespace Exiv2 { void moveXmpToIptc(XmpData& xmpData, IptcData& iptcData) { - Converter converter(iptcData, const_cast(xmpData)); + Converter converter(iptcData, xmpData); converter.setErase(); converter.cnvFromXmp(); } diff --git a/src/epsimage.cpp b/src/epsimage.cpp index 30f6dd30..d70984ce 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -260,7 +260,7 @@ namespace { const byte *data = io.mmap(); // default positions and sizes - const size_t size = static_cast(io.size()); + const size_t size = io.size(); size_t posEps = 0; size_t posEndEps = size; uint32_t posWmf = 0; diff --git a/src/riffvideo.cpp b/src/riffvideo.cpp index 7dfd3cba..9a5432c5 100644 --- a/src/riffvideo.cpp +++ b/src/riffvideo.cpp @@ -833,7 +833,7 @@ namespace Exiv2 { double denominator = 1; io_->read(buf.pData_, 4); tempSize -= 4; - while((long)tempSize > 0) { + while(tempSize > 0) { std::memset(buf.pData_, 0x0, buf.size_); io_->read(buf.pData_, 4); io_->read(buf2.pData_, 4); diff --git a/src/webpimage.cpp b/src/webpimage.cpp index 7a8c0b28..a9994fd2 100644 --- a/src/webpimage.cpp +++ b/src/webpimage.cpp @@ -345,7 +345,7 @@ namespace Exiv2 { if (outIo.write((const byte*)WEBP_CHUNK_HEADER_ICCP, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); ul2Data(data, (uint32_t) iccProfile_.size_, littleEndian); if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); - if (outIo.write(iccProfile_.pData_, (long)iccProfile_.size_) != (long)iccProfile_.size_) { + if (outIo.write(iccProfile_.pData_, iccProfile_.size_) != iccProfile_.size_) { throw Error(kerImageWriteFailed); } has_icc = false; @@ -597,21 +597,21 @@ namespace Exiv2 { bool be_header = false; long pos = -1; - pos = getHeaderOffset (payload.pData_, (long)payload.size_, (byte*)&exifLongHeader, 4); + pos = getHeaderOffset (payload.pData_, payload.size_, (byte*)&exifLongHeader, 4); if (pos == -1) { - pos = getHeaderOffset (payload.pData_, (long)payload.size_, (byte*)&exifLongHeader, 6); + pos = getHeaderOffset (payload.pData_, payload.size_, (byte*)&exifLongHeader, 6); if (pos != -1) { s_header = true; } } if (pos == -1) { - pos = getHeaderOffset (payload.pData_, (long)payload.size_, (byte*)&exifTiffLEHeader, 3); + pos = getHeaderOffset (payload.pData_, payload.size_, (byte*)&exifTiffLEHeader, 3); if (pos != -1) { le_header = true; } } if (pos == -1) { - pos = getHeaderOffset (payload.pData_, (long)payload.size_, (byte*)&exifTiffBEHeader, 4); + pos = getHeaderOffset (payload.pData_, payload.size_, (byte*)&exifTiffBEHeader, 4); if (pos != -1) { be_header = true; } @@ -624,7 +624,7 @@ namespace Exiv2 { offset += 12; } - long size = payload.size_ + offset; + const long size = payload.size_ + offset; rawExifData = (byte*)malloc(size); if (s_header) { @@ -640,7 +640,7 @@ namespace Exiv2 { memcpy(rawExifData + 6, (char*)&exifShortHeader, 6); } - memcpy(rawExifData + offset, payload.pData_, (long)payload.size_); + memcpy(rawExifData + offset, payload.pData_, payload.size_); #ifdef DEBUG std::cout << "Display Hex Dump [size:" << (unsigned long)size << "]" << std::endl; diff --git a/src/xmp.cpp b/src/xmp.cpp index e9c72145..644abcce 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -482,7 +482,7 @@ namespace Exiv2 { if ( bURI || bNS ) { std::map* p = (std::map*) refCon; - std::map& m = (std::map&) *p ; + std::map& m = *p; std::string b(""); if ( bNS ) { // store the NS in dict[""]