Fix double promotion issues
This commit is contained in:
parent
bc58752d18
commit
5e36363138
@ -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());
|
||||
|
||||
@ -655,7 +655,7 @@ namespace Exiv2 {
|
||||
switch (mt->val_) {
|
||||
case 0x0489:
|
||||
if(size <= 4) {
|
||||
duration_in_ms = static_cast<int64_t>(getFloat(buf, bigEndian) * time_code_scale * 1000);
|
||||
duration_in_ms = static_cast<int64_t>(getFloat(buf, bigEndian) * static_cast<float>(time_code_scale) * 1000.0f);
|
||||
}
|
||||
else {
|
||||
duration_in_ms = static_cast<int64_t>(getDouble(buf, bigEndian) * time_code_scale * 1000);
|
||||
|
||||
@ -1299,7 +1299,7 @@ namespace Exiv2 {
|
||||
if(frame_rate == 0)
|
||||
return;
|
||||
|
||||
uint64_t duration = static_cast<uint64_t>((double)frame_count * (double)1000 / (double)frame_rate);
|
||||
uint64_t duration = static_cast<uint64_t>((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
|
||||
|
||||
@ -2906,13 +2906,13 @@ namespace Exiv2 {
|
||||
|
||||
float fnumber(float apertureValue)
|
||||
{
|
||||
return static_cast<float>(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<double>(shutterSpeedValue));
|
||||
if (tmp > 1) {
|
||||
ur.second = static_cast<long>(tmp + 0.5);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user