diff --git a/samples/xmpsample.cpp b/samples/xmpsample.cpp index e0fe1542..06b21444 100644 --- a/samples/xmpsample.cpp +++ b/samples/xmpsample.cpp @@ -78,7 +78,7 @@ try { const Exiv2::Value &getv6 = xmpData["Xmp.dc.six"].value(); assert(getv6.toLong() == 0); assert(getv6.ok()); - assert(getv6.toFloat() == 0.0); + assert(getv6.toFloat() == 0.0f); assert(getv6.ok()); assert(getv6.toRational() == Exiv2::Rational(0, 1)); assert(getv6.ok()); @@ -90,7 +90,7 @@ try { const Exiv2::Value &getv8 = xmpData["Xmp.dc.eight"].value(); assert(getv8.toLong() == 1); assert(getv8.ok()); - assert(getv8.toFloat() == 1.0); + assert(getv8.toFloat() == 1.0f); assert(getv8.ok()); assert(getv8.toRational() == Exiv2::Rational(1, 1)); assert(getv8.ok()); diff --git a/src/matroskavideo.cpp b/src/matroskavideo.cpp index 18c278b5..c0436821 100644 --- a/src/matroskavideo.cpp +++ b/src/matroskavideo.cpp @@ -655,7 +655,7 @@ namespace Exiv2 { switch (mt->val_) { case 0x0489: if(size <= 4) { - duration_in_ms = static_cast(getFloat(buf, bigEndian) * time_code_scale * 1000); + duration_in_ms = static_cast(getFloat(buf, bigEndian) * static_cast(time_code_scale) * 1000.0f); } else { duration_in_ms = static_cast(getDouble(buf, bigEndian) * time_code_scale * 1000); diff --git a/src/riffvideo.cpp b/src/riffvideo.cpp index 9a5432c5..92dcd3aa 100644 --- a/src/riffvideo.cpp +++ b/src/riffvideo.cpp @@ -1299,7 +1299,7 @@ namespace Exiv2 { if(frame_rate == 0) return; - uint64_t duration = static_cast((double)frame_count * (double)1000 / (double)frame_rate); + uint64_t duration = static_cast((double)frame_count * 1000. / frame_rate); xmpData_["Xmp.video.FileDataRate"] = (double)io_->size()/(double)(1048576*duration); xmpData_["Xmp.video.Duration"] = duration; //Duration in number of seconds } // RiffVideo::fillDuration diff --git a/src/tags.cpp b/src/tags.cpp index 9e74c990..f54a042b 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -2906,13 +2906,13 @@ namespace Exiv2 { float fnumber(float apertureValue) { - return static_cast(std::exp(std::log(2.0) * apertureValue / 2)); + return std::exp(std::log(2.0f) * apertureValue / 2.f); } URational exposureTime(float shutterSpeedValue) { URational ur(1, 1); - double tmp = std::exp(std::log(2.0) * shutterSpeedValue); + double tmp = std::exp(std::log(2.0) * static_cast(shutterSpeedValue)); if (tmp > 1) { ur.second = static_cast(tmp + 0.5); }