Skip to content

Commit

Permalink
Merge pull request #2245 from neheb/2
Browse files Browse the repository at this point in the history
clang-tidy 14 fixes
  • Loading branch information
piponazo authored May 22, 2022
2 parents 93dc63b + cf963e9 commit 6e56ec1
Show file tree
Hide file tree
Showing 35 changed files with 108 additions and 92 deletions.
2 changes: 2 additions & 0 deletions app/actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ class TaskFactory {
*/
static TaskFactory& instance();

~TaskFactory() = default;
//! Prevent copy construction: not implemented.
TaskFactory(const TaskFactory&) = delete;
TaskFactory& operator=(const TaskFactory&) = delete;

//! Destructor
void cleanup();
Expand Down
2 changes: 1 addition & 1 deletion app/exiv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int main(int argc, char* const argv[]) {

try {
// Create the required action class
auto task = Action::TaskFactory::instance().create(Action::TaskType(params.action_));
auto task = Action::TaskFactory::instance().create(static_cast<Action::TaskType>(params.action_));

// Process all files
auto filesCount = params.files_.size();
Expand Down
2 changes: 2 additions & 0 deletions app/exiv2app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ class Params : public Util::Getopt {
static Params& instance();

//! Prevent copy-construction: not implemented.
~Params() = default;
Params(const Params&) = delete;
Params& operator=(const Params&) = delete;

//! Enumerates print modes
enum PrintMode {
Expand Down
1 change: 1 addition & 0 deletions include/exiv2/webpimage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class EXIV2API WebPImage : public Image {
[[nodiscard]] std::string mimeType() const override;
//@}

~WebPImage() = default;
//! Copy constructor
WebPImage(const WebPImage&) = delete;
//! Assignment operator
Expand Down
8 changes: 4 additions & 4 deletions samples/addmoddel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ int main(int argc, char* const argv[]) {
// This is the quickest way to add (simple) Exif data. If a metadatum for
// a given key already exists, its value is overwritten. Otherwise a new
// tag is added.
exifData["Exif.Image.Model"] = "Test 1"; // AsciiValue
exifData["Exif.Image.SamplesPerPixel"] = uint16_t(162); // UShortValue
exifData["Exif.Image.XResolution"] = -2; // LongValue
exifData["Exif.Image.YResolution"] = Exiv2::Rational(-2, 3); // RationalValue
exifData["Exif.Image.Model"] = "Test 1"; // AsciiValue
exifData["Exif.Image.SamplesPerPixel"] = static_cast<uint16_t>(162); // UShortValue
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";

// Create a ASCII string value (note the use of create)
Expand Down
14 changes: 7 additions & 7 deletions samples/exifdata-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ int main(int argc, char* const argv[]) {
std::cout << "Copy construction, non-intrusive changes\n";
Exiv2::ExifData ed1(ed);
ed1["Exif.Image.DateTime"] = "Sunday, 11am";
ed1["Exif.Image.Orientation"] = uint16_t(2);
ed1["Exif.Image.Orientation"] = static_cast<uint16_t>(2);
ed1["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am";
ed1["Exif.Photo.MeteringMode"] = uint16_t(1);
ed1["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
ed1["Exif.Iop.InteroperabilityIndex"] = "123";
// ed1["Exif.Thumbnail.Orientation"] = uint16_t(2);
write(file, ed1);
Expand All @@ -61,11 +61,11 @@ int main(int argc, char* const argv[]) {
ed3["Exif.Thumbnail.Artist"] = "Test 6 Ifd1 tag";
ed3 = ed;
ed3["Exif.Image.DateTime"] = "Sunday, 11am";
ed3["Exif.Image.Orientation"] = uint16_t(2);
ed3["Exif.Image.Orientation"] = static_cast<uint16_t>(2);
ed3["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am";
ed3["Exif.Photo.MeteringMode"] = uint16_t(1);
ed3["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
ed3["Exif.Iop.InteroperabilityIndex"] = "123";
ed3["Exif.Thumbnail.Orientation"] = uint16_t(2);
ed3["Exif.Thumbnail.Orientation"] = static_cast<uint16_t>(2);
write(file, ed3);
print(file);
std::cout << "----------------------------------------------\n";
Expand All @@ -78,9 +78,9 @@ int main(int argc, char* const argv[]) {
ed4["Exif.Image.DateTime"] = "Sunday, 11am and ten minutes";
ed4["Exif.Image.Orientation"] = "2 3 4 5";
ed4["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am and ten minutes";
ed4["Exif.Photo.MeteringMode"] = uint16_t(1);
ed4["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
ed4["Exif.Iop.InteroperabilityIndex"] = "123";
ed4["Exif.Thumbnail.Orientation"] = uint16_t(2);
ed4["Exif.Thumbnail.Orientation"] = static_cast<uint16_t>(2);
write(file, ed4);
print(file);

Expand Down
2 changes: 1 addition & 1 deletion samples/iptceasy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char* const argv[]) try {
iptcData["Iptc.Application2.Headline"] = "The headline I am";
iptcData["Iptc.Application2.Keywords"] = "Yet another keyword";
iptcData["Iptc.Application2.DateCreated"] = "2004-8-3";
iptcData["Iptc.Application2.Urgency"] = uint16_t(1);
iptcData["Iptc.Application2.Urgency"] = static_cast<uint16_t>(1);
iptcData["Iptc.Envelope.ModelVersion"] = 42;
iptcData["Iptc.Envelope.TimeSent"] = "14:41:0-05:00";
iptcData["Iptc.Application2.RasterizedCaption"] = "230 42 34 2 90 84 23 146";
Expand Down
12 changes: 6 additions & 6 deletions samples/remotetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ int main(int argc, char* const argv[]) {
// set/add metadata
std::cout << "Modify the metadata ...\n";
Exiv2::ExifData exifData;
exifData["Exif.Photo.UserComment"] = "Hello World"; // AsciiValue
exifData["Exif.Image.Software"] = "Exiv2"; // AsciiValue
exifData["Exif.Image.Copyright"] = "Exiv2"; // AsciiValue
exifData["Exif.Image.Make"] = "Canon"; // AsciiValue
exifData["Exif.Canon.OwnerName"] = "Tuan"; // UShortValue
exifData["Exif.CanonCs.LensType"] = uint16_t(65535); // LongValue
exifData["Exif.Photo.UserComment"] = "Hello World"; // AsciiValue
exifData["Exif.Image.Software"] = "Exiv2"; // AsciiValue
exifData["Exif.Image.Copyright"] = "Exiv2"; // AsciiValue
exifData["Exif.Image.Make"] = "Canon"; // AsciiValue
exifData["Exif.Canon.OwnerName"] = "Tuan"; // UShortValue
exifData["Exif.CanonCs.LensType"] = static_cast<uint16_t>(65535); // LongValue
Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::asciiString);
v->read("2013:06:09 14:30:30");
Exiv2::ExifKey key("Exif.Image.DateTime");
Expand Down
2 changes: 1 addition & 1 deletion samples/tiff-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void mini1(const char* path) {
enforce(wm == wmIntrusive, Exiv2::ErrorCode::kerErrorMessage, "encode returned an unexpected value");
std::cout << "Test 3: Wrote non-empty Exif data without original binary data:\n";
exifData.clear();
ByteOrder bo = ExifParser::decode(exifData, &blob[0], blob.size());
ByteOrder bo = ExifParser::decode(exifData, blob.data(), blob.size());
enforce(bo == bigEndian, Exiv2::ErrorCode::kerErrorMessage, "decode returned an unexpected value");
print(exifData);
}
Expand Down
32 changes: 16 additions & 16 deletions samples/write2-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ int main(int argc, char* const argv[]) {
edMn1["Exif.Image.Make"] = "Canon";
edMn1["Exif.Image.Model"] = "Canon PowerShot S40";
edMn1["Exif.Canon.0xabcd"] = "A Canon makernote tag";
edMn1["Exif.CanonCs.0x0002"] = uint16_t(41);
edMn1["Exif.CanonSi.0x0005"] = uint16_t(42);
edMn1["Exif.CanonCf.0x0001"] = uint16_t(43);
edMn1["Exif.CanonPi.0x0001"] = uint16_t(44);
edMn1["Exif.CanonPa.0x0001"] = uint16_t(45);
edMn1["Exif.CanonCs.0x0002"] = static_cast<uint16_t>(41);
edMn1["Exif.CanonSi.0x0005"] = static_cast<uint16_t>(42);
edMn1["Exif.CanonCf.0x0001"] = static_cast<uint16_t>(43);
edMn1["Exif.CanonPi.0x0001"] = static_cast<uint16_t>(44);
edMn1["Exif.CanonPa.0x0001"] = static_cast<uint16_t>(45);
write(file, edMn1);
print(file);

Expand All @@ -69,8 +69,8 @@ int main(int argc, char* const argv[]) {
image->readMetadata();

Exiv2::ExifData& rEd = image->exifData();
rEd["Exif.CanonCs.0x0001"] = uint16_t(88);
rEd["Exif.CanonSi.0x0004"] = uint16_t(99);
rEd["Exif.CanonCs.0x0001"] = static_cast<uint16_t>(88);
rEd["Exif.CanonSi.0x0004"] = static_cast<uint16_t>(99);
image->writeMetadata();
print(file);

Expand Down Expand Up @@ -118,15 +118,15 @@ int main(int argc, char* const argv[]) {
Exiv2::ExifData edMn7;
edMn7["Exif.Image.Make"] = "OLYMPUS CORPORATION";
edMn7["Exif.Image.Model"] = "C8080WZ";
edMn7["Exif.Olympus.0x0201"] = uint16_t(1);
edMn7["Exif.Olympus.0x0201"] = static_cast<uint16_t>(1);
write(file, edMn7);
print(file);

std::cout << "\n----- One Panasonic MakerNote tag\n";
Exiv2::ExifData edMn8;
edMn8["Exif.Image.Make"] = "Panasonic";
edMn8["Exif.Image.Model"] = "DMC-FZ5";
edMn8["Exif.Panasonic.0x0001"] = uint16_t(1);
edMn8["Exif.Panasonic.0x0001"] = static_cast<uint16_t>(1);
write(file, edMn8);
print(file);

Expand All @@ -142,13 +142,13 @@ int main(int argc, char* const argv[]) {
Exiv2::ExifData edMn10;
edMn10["Exif.Image.Make"] = "Minolta";
edMn10["Exif.Image.Model"] = "A fancy Minolta camera";
edMn10["Exif.Minolta.ColorMode"] = uint32_t(1);
edMn10["Exif.MinoltaCsNew.WhiteBalance"] = uint32_t(2);
edMn10["Exif.MinoltaCs5D.WhiteBalance"] = uint16_t(3);
edMn10["Exif.MinoltaCs5D.ColorTemperature"] = int16_t(-1);
edMn10["Exif.MinoltaCs7D.WhiteBalance"] = uint16_t(4);
edMn10["Exif.MinoltaCs7D.ExposureCompensation"] = int16_t(-2);
edMn10["Exif.MinoltaCs7D.ColorTemperature"] = int16_t(-3);
edMn10["Exif.Minolta.ColorMode"] = static_cast<uint32_t>(1);
edMn10["Exif.MinoltaCsNew.WhiteBalance"] = static_cast<uint32_t>(2);
edMn10["Exif.MinoltaCs5D.WhiteBalance"] = static_cast<uint16_t>(3);
edMn10["Exif.MinoltaCs5D.ColorTemperature"] = static_cast<int16_t>(-1);
edMn10["Exif.MinoltaCs7D.WhiteBalance"] = static_cast<uint16_t>(4);
edMn10["Exif.MinoltaCs7D.ExposureCompensation"] = static_cast<int16_t>(-2);
edMn10["Exif.MinoltaCs7D.ColorTemperature"] = static_cast<int16_t>(-3);
write(file, edMn10);
print(file);

Expand Down
2 changes: 1 addition & 1 deletion samples/xmpsample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main() try {
xmpData["Xmp.dc.one"] = -1;
xmpData["Xmp.dc.two"] = 3.1415;
xmpData["Xmp.dc.three"] = Exiv2::Rational(5, 7);
xmpData["Xmp.dc.four"] = uint16_t(255);
xmpData["Xmp.dc.four"] = static_cast<uint16_t>(255);
xmpData["Xmp.dc.five"] = 256;
xmpData["Xmp.dc.six"] = false;

Expand Down
2 changes: 1 addition & 1 deletion src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ bool convertStringCharsetIconv(std::string& str, const char* from, const char* t
size_t outbytesleft = sizeof(outbuf);
size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
if (rc == size_t(-1) && errno != E2BIG) {
if (rc == static_cast<size_t>(-1) && errno != E2BIG) {
#ifndef SUPPRESS_WARNINGS
EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/crwimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void CrwImage::writeMetadata() {

// Write new buffer to file
MemIo tempIo;
tempIo.write((!blob.empty() ? &blob[0] : nullptr), blob.size());
tempIo.write((!blob.empty() ? blob.data() : nullptr), blob.size());
io_->close();
io_->transfer(tempIo); // may throw

Expand All @@ -108,7 +108,7 @@ void CrwParser::decode(CrwImage* pCrwImage, const byte* pData, size_t size) {
// a hack to get absolute offset of preview image inside CRW structure
auto preview = header.findComponent(0x2007, 0x0000);
if (preview) {
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = uint32_t(preview->pData() - pData);
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = static_cast<uint32_t>(preview->pData() - pData);
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(preview->size());
}
} // CrwParser::decode
Expand Down
4 changes: 4 additions & 0 deletions src/crwimage_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ class CiffDirectory : public CiffComponent {
~CiffDirectory() override;
//@}

CiffDirectory(const CiffDirectory&) = delete;
CiffDirectory& operator=(const CiffDirectory&) = delete;

//! @name Manipulators
//@{
// Default assignment operator is fine
Expand Down Expand Up @@ -522,6 +525,7 @@ struct CrwMapping {
*/
class CrwMap {
public:
~CrwMap() = delete;
//! @name Not implemented
//@{
CrwMap(const CrwMap&) = delete;
Expand Down
8 changes: 4 additions & 4 deletions src/exif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ int Exifdatum::ifdId() const {
}

const char* Exifdatum::ifdName() const {
return key_ ? Internal::ifdName(Internal::IfdId(key_->ifdId())) : "";
return key_ ? Internal::ifdName(static_cast<Internal::IfdId>(key_->ifdId())) : "";
}

int Exifdatum::idx() const {
Expand Down Expand Up @@ -422,11 +422,11 @@ void ExifThumb::setJpegThumbnail(const std::string& path) {
}

void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
exifData_["Exif.Thumbnail.Compression"] = uint16_t(6);
exifData_["Exif.Thumbnail.Compression"] = static_cast<uint16_t>(6);
Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
format = uint32_t(0);
format = static_cast<uint32_t>(0);
format.setDataArea(buf, size);
exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = uint32_t(size);
exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
}

void ExifThumb::erase() {
Expand Down
2 changes: 1 addition & 1 deletion src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st

if (n != FINISH || !OK(status)) {
snprintf(buffer, sizeof buffer, "wsa_error = %d,n = %d,sleep_ = %d status = %d", WSAGetLastError(), n,
int(sleep_.count()), status);
static_cast<int>(sleep_.count()), status);
error(errors, buffer, nullptr, nullptr, 0);
} else if (bSearching && OK(status)) {
if (end) {
Expand Down
4 changes: 2 additions & 2 deletions src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStruct
io.seekOrThrow(offset, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // position
std::vector<byte> bytes(count); // allocate memory
// TODO: once we have C++11 use bytes.data()
io.readOrThrow(&bytes[0], count, ErrorCode::kerCorruptedMetadata);
io.readOrThrow(bytes.data(), count, ErrorCode::kerCorruptedMetadata);
io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata);
// TODO: once we have C++11 use bytes.data()
IptcData::printStructure(out, makeSliceUntil(&bytes[0], count), depth);
IptcData::printStructure(out, makeSliceUntil(bytes.data(), count), depth);
}
} else if (option == kpsRecursive && tag == 0x927c /* MakerNote */ && count > 10) {
const long restore = io.tell(); // save
Expand Down
4 changes: 2 additions & 2 deletions src/image_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ std::string stringFormat(const char* format, ...) {
buffer.resize(need + 1);
va_list args; // variable arg list
va_start(args, format); // args start after format
rc = vsnprintf(&buffer[0], buffer.size(), format, args);
rc = vsnprintf(buffer.data(), buffer.size(), format, args);
va_end(args); // free the args
if (rc > 0)
need = static_cast<size_t>(rc);
} while (buffer.size() <= need);

if (rc > 0)
result = std::string(&buffer[0], need);
result = std::string(buffer.data(), need);
return result;
}

Expand Down
10 changes: 5 additions & 5 deletions src/jpgimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void JpegBase::readMetadata() {
append(psBlob, buf.c_data(16), size - 16);
}
// Check whether psBlob is complete
if (!psBlob.empty() && Photoshop::valid(&psBlob[0], psBlob.size())) {
if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
--search;
foundCompletePsData = true;
}
Expand Down Expand Up @@ -263,7 +263,7 @@ void JpegBase::readMetadata() {
const byte* record = nullptr;
uint32_t sizeIptc = 0;
uint32_t sizeHdr = 0;
const byte* pCur = &psBlob[0];
const byte* pCur = psBlob.data();
const byte* pEnd = pCur + psBlob.size();
while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
#ifdef EXIV2_DEBUG_MESSAGES
Expand All @@ -274,7 +274,7 @@ void JpegBase::readMetadata() {
}
pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
}
if (!iptcBlob.empty() && IptcParser::decode(iptcData_, &iptcBlob[0], iptcBlob.size())) {
if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
#ifndef SUPPRESS_WARNINGS
EXV_WARNING << "Failed to decode IPTC metadata.\n";
#endif
Expand Down Expand Up @@ -680,7 +680,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
// Append to psBlob
append(psBlob, buf.c_data(16), buf.size() - 16);
// Check whether psBlob is complete
if (!psBlob.empty() && Photoshop::valid(&psBlob[0], psBlob.size())) {
if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
foundCompletePsData = true;
}
} else if (marker == com_ && skipCom == notfound) {
Expand Down Expand Up @@ -750,7 +750,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
size_t exifSize = rawExif.size();
WriteMethod wm = ExifParser::encode(blob, pExifData, exifSize, bo, exifData_);
if (wm == wmIntrusive) {
pExifData = !blob.empty() ? &blob[0] : nullptr;
pExifData = !blob.empty() ? blob.data() : nullptr;
exifSize = blob.size();
}
if (exifSize > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/makernote_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, const ui
std::string getExifModel(Exiv2::Internal::TiffComponent* pRoot) {
// Lookup the Exif.Image.Model tag
const auto value = getExifValue(pRoot, 0x0110, Exiv2::Internal::ifd0Id);
return (!value || value->count() == 0) ? std::string("") : std::string(value->toString());
return (!value || value->count() == 0) ? std::string("") : static_cast<std::string>(value->toString());
}

void ncrypt(Exiv2::byte* pData, uint32_t size, uint32_t count, uint32_t serial) {
Expand Down
4 changes: 3 additions & 1 deletion src/makernote_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ class TiffMnCreator {
*/
static TiffComponent* create(uint16_t tag, IfdId group, IfdId mnGroup);

~TiffMnCreator() = default;
//! Prevent destruction (needed if used as a policy class)
~TiffMnCreator() = delete;
TiffMnCreator(const TiffComponent&) = delete;
TiffMnCreator& operator=(const TiffComponent&) = delete;

private:
static const TiffMnRegistry registry_[]; //<! List of makernotes
Expand Down
4 changes: 2 additions & 2 deletions src/minoltamn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ std::ostream& MinoltaMakerNote::printMinoltaExposureManualBias5D(std::ostream& o
std::ios::fmtflags f(os.flags());
std::ostringstream oss;
oss.copyfmt(os);
os << std::fixed << std::setprecision(2) << (float(value.toInt64() - 128) / 24);
os << std::fixed << std::setprecision(2) << (static_cast<float>(value.toInt64() - 128) / 24);
os.copyfmt(oss);
os.flags(f);
return os;
Expand All @@ -595,7 +595,7 @@ std::ostream& MinoltaMakerNote::printMinoltaExposureCompensation5D(std::ostream&
std::ios::fmtflags f(os.flags());
std::ostringstream oss;
oss.copyfmt(os);
os << std::fixed << std::setprecision(2) << (float(value.toInt64() - 300) / 100);
os << std::fixed << std::setprecision(2) << (static_cast<float>(value.toInt64() - 300) / 100);
os.copyfmt(oss);
os.flags(f);
return os;
Expand Down
Loading

0 comments on commit 6e56ec1

Please sign in to comment.