Skip to content

Commit 6e56ec1

Browse files
authored
Merge pull request #2245 from neheb/2
clang-tidy 14 fixes
2 parents 93dc63b + cf963e9 commit 6e56ec1

35 files changed

+108
-92
lines changed

app/actions.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ class TaskFactory {
9797
*/
9898
static TaskFactory& instance();
9999

100+
~TaskFactory() = default;
100101
//! Prevent copy construction: not implemented.
101102
TaskFactory(const TaskFactory&) = delete;
103+
TaskFactory& operator=(const TaskFactory&) = delete;
102104

103105
//! Destructor
104106
void cleanup();

app/exiv2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int main(int argc, char* const argv[]) {
137137

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

142142
// Process all files
143143
auto filesCount = params.files_.size();

app/exiv2app.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ class Params : public Util::Getopt {
110110
static Params& instance();
111111

112112
//! Prevent copy-construction: not implemented.
113+
~Params() = default;
113114
Params(const Params&) = delete;
115+
Params& operator=(const Params&) = delete;
114116

115117
//! Enumerates print modes
116118
enum PrintMode {

include/exiv2/webpimage.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class EXIV2API WebPImage : public Image {
5454
[[nodiscard]] std::string mimeType() const override;
5555
//@}
5656

57+
~WebPImage() = default;
5758
//! Copy constructor
5859
WebPImage(const WebPImage&) = delete;
5960
//! Assignment operator

samples/addmoddel.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ int main(int argc, char* const argv[]) {
3131
// This is the quickest way to add (simple) Exif data. If a metadatum for
3232
// a given key already exists, its value is overwritten. Otherwise a new
3333
// tag is added.
34-
exifData["Exif.Image.Model"] = "Test 1"; // AsciiValue
35-
exifData["Exif.Image.SamplesPerPixel"] = uint16_t(162); // UShortValue
36-
exifData["Exif.Image.XResolution"] = -2; // LongValue
37-
exifData["Exif.Image.YResolution"] = Exiv2::Rational(-2, 3); // RationalValue
34+
exifData["Exif.Image.Model"] = "Test 1"; // AsciiValue
35+
exifData["Exif.Image.SamplesPerPixel"] = static_cast<uint16_t>(162); // UShortValue
36+
exifData["Exif.Image.XResolution"] = -2; // LongValue
37+
exifData["Exif.Image.YResolution"] = Exiv2::Rational(-2, 3); // RationalValue
3838
std::cout << "Added a few tags the quick way.\n";
3939

4040
// Create a ASCII string value (note the use of create)

samples/exifdata-test.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ int main(int argc, char* const argv[]) {
3434
std::cout << "Copy construction, non-intrusive changes\n";
3535
Exiv2::ExifData ed1(ed);
3636
ed1["Exif.Image.DateTime"] = "Sunday, 11am";
37-
ed1["Exif.Image.Orientation"] = uint16_t(2);
37+
ed1["Exif.Image.Orientation"] = static_cast<uint16_t>(2);
3838
ed1["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am";
39-
ed1["Exif.Photo.MeteringMode"] = uint16_t(1);
39+
ed1["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
4040
ed1["Exif.Iop.InteroperabilityIndex"] = "123";
4141
// ed1["Exif.Thumbnail.Orientation"] = uint16_t(2);
4242
write(file, ed1);
@@ -61,11 +61,11 @@ int main(int argc, char* const argv[]) {
6161
ed3["Exif.Thumbnail.Artist"] = "Test 6 Ifd1 tag";
6262
ed3 = ed;
6363
ed3["Exif.Image.DateTime"] = "Sunday, 11am";
64-
ed3["Exif.Image.Orientation"] = uint16_t(2);
64+
ed3["Exif.Image.Orientation"] = static_cast<uint16_t>(2);
6565
ed3["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am";
66-
ed3["Exif.Photo.MeteringMode"] = uint16_t(1);
66+
ed3["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
6767
ed3["Exif.Iop.InteroperabilityIndex"] = "123";
68-
ed3["Exif.Thumbnail.Orientation"] = uint16_t(2);
68+
ed3["Exif.Thumbnail.Orientation"] = static_cast<uint16_t>(2);
6969
write(file, ed3);
7070
print(file);
7171
std::cout << "----------------------------------------------\n";
@@ -78,9 +78,9 @@ int main(int argc, char* const argv[]) {
7878
ed4["Exif.Image.DateTime"] = "Sunday, 11am and ten minutes";
7979
ed4["Exif.Image.Orientation"] = "2 3 4 5";
8080
ed4["Exif.Photo.DateTimeOriginal"] = "Sunday, 11am and ten minutes";
81-
ed4["Exif.Photo.MeteringMode"] = uint16_t(1);
81+
ed4["Exif.Photo.MeteringMode"] = static_cast<uint16_t>(1);
8282
ed4["Exif.Iop.InteroperabilityIndex"] = "123";
83-
ed4["Exif.Thumbnail.Orientation"] = uint16_t(2);
83+
ed4["Exif.Thumbnail.Orientation"] = static_cast<uint16_t>(2);
8484
write(file, ed4);
8585
print(file);
8686

samples/iptceasy.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main(int argc, char* const argv[]) try {
2323
iptcData["Iptc.Application2.Headline"] = "The headline I am";
2424
iptcData["Iptc.Application2.Keywords"] = "Yet another keyword";
2525
iptcData["Iptc.Application2.DateCreated"] = "2004-8-3";
26-
iptcData["Iptc.Application2.Urgency"] = uint16_t(1);
26+
iptcData["Iptc.Application2.Urgency"] = static_cast<uint16_t>(1);
2727
iptcData["Iptc.Envelope.ModelVersion"] = 42;
2828
iptcData["Iptc.Envelope.TimeSent"] = "14:41:0-05:00";
2929
iptcData["Iptc.Application2.RasterizedCaption"] = "230 42 34 2 90 84 23 146";

samples/remotetest.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ int main(int argc, char* const argv[]) {
3434
// set/add metadata
3535
std::cout << "Modify the metadata ...\n";
3636
Exiv2::ExifData exifData;
37-
exifData["Exif.Photo.UserComment"] = "Hello World"; // AsciiValue
38-
exifData["Exif.Image.Software"] = "Exiv2"; // AsciiValue
39-
exifData["Exif.Image.Copyright"] = "Exiv2"; // AsciiValue
40-
exifData["Exif.Image.Make"] = "Canon"; // AsciiValue
41-
exifData["Exif.Canon.OwnerName"] = "Tuan"; // UShortValue
42-
exifData["Exif.CanonCs.LensType"] = uint16_t(65535); // LongValue
37+
exifData["Exif.Photo.UserComment"] = "Hello World"; // AsciiValue
38+
exifData["Exif.Image.Software"] = "Exiv2"; // AsciiValue
39+
exifData["Exif.Image.Copyright"] = "Exiv2"; // AsciiValue
40+
exifData["Exif.Image.Make"] = "Canon"; // AsciiValue
41+
exifData["Exif.Canon.OwnerName"] = "Tuan"; // UShortValue
42+
exifData["Exif.CanonCs.LensType"] = static_cast<uint16_t>(65535); // LongValue
4343
Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::asciiString);
4444
v->read("2013:06:09 14:30:30");
4545
Exiv2::ExifKey key("Exif.Image.DateTime");

samples/tiff-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void mini1(const char* path) {
6161
enforce(wm == wmIntrusive, Exiv2::ErrorCode::kerErrorMessage, "encode returned an unexpected value");
6262
std::cout << "Test 3: Wrote non-empty Exif data without original binary data:\n";
6363
exifData.clear();
64-
ByteOrder bo = ExifParser::decode(exifData, &blob[0], blob.size());
64+
ByteOrder bo = ExifParser::decode(exifData, blob.data(), blob.size());
6565
enforce(bo == bigEndian, Exiv2::ErrorCode::kerErrorMessage, "decode returned an unexpected value");
6666
print(exifData);
6767
}

samples/write2-test.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ int main(int argc, char* const argv[]) {
5656
edMn1["Exif.Image.Make"] = "Canon";
5757
edMn1["Exif.Image.Model"] = "Canon PowerShot S40";
5858
edMn1["Exif.Canon.0xabcd"] = "A Canon makernote tag";
59-
edMn1["Exif.CanonCs.0x0002"] = uint16_t(41);
60-
edMn1["Exif.CanonSi.0x0005"] = uint16_t(42);
61-
edMn1["Exif.CanonCf.0x0001"] = uint16_t(43);
62-
edMn1["Exif.CanonPi.0x0001"] = uint16_t(44);
63-
edMn1["Exif.CanonPa.0x0001"] = uint16_t(45);
59+
edMn1["Exif.CanonCs.0x0002"] = static_cast<uint16_t>(41);
60+
edMn1["Exif.CanonSi.0x0005"] = static_cast<uint16_t>(42);
61+
edMn1["Exif.CanonCf.0x0001"] = static_cast<uint16_t>(43);
62+
edMn1["Exif.CanonPi.0x0001"] = static_cast<uint16_t>(44);
63+
edMn1["Exif.CanonPa.0x0001"] = static_cast<uint16_t>(45);
6464
write(file, edMn1);
6565
print(file);
6666

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

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

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

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

@@ -142,13 +142,13 @@ int main(int argc, char* const argv[]) {
142142
Exiv2::ExifData edMn10;
143143
edMn10["Exif.Image.Make"] = "Minolta";
144144
edMn10["Exif.Image.Model"] = "A fancy Minolta camera";
145-
edMn10["Exif.Minolta.ColorMode"] = uint32_t(1);
146-
edMn10["Exif.MinoltaCsNew.WhiteBalance"] = uint32_t(2);
147-
edMn10["Exif.MinoltaCs5D.WhiteBalance"] = uint16_t(3);
148-
edMn10["Exif.MinoltaCs5D.ColorTemperature"] = int16_t(-1);
149-
edMn10["Exif.MinoltaCs7D.WhiteBalance"] = uint16_t(4);
150-
edMn10["Exif.MinoltaCs7D.ExposureCompensation"] = int16_t(-2);
151-
edMn10["Exif.MinoltaCs7D.ColorTemperature"] = int16_t(-3);
145+
edMn10["Exif.Minolta.ColorMode"] = static_cast<uint32_t>(1);
146+
edMn10["Exif.MinoltaCsNew.WhiteBalance"] = static_cast<uint32_t>(2);
147+
edMn10["Exif.MinoltaCs5D.WhiteBalance"] = static_cast<uint16_t>(3);
148+
edMn10["Exif.MinoltaCs5D.ColorTemperature"] = static_cast<int16_t>(-1);
149+
edMn10["Exif.MinoltaCs7D.WhiteBalance"] = static_cast<uint16_t>(4);
150+
edMn10["Exif.MinoltaCs7D.ExposureCompensation"] = static_cast<int16_t>(-2);
151+
edMn10["Exif.MinoltaCs7D.ColorTemperature"] = static_cast<int16_t>(-3);
152152
write(file, edMn10);
153153
print(file);
154154

samples/xmpsample.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main() try {
4040
xmpData["Xmp.dc.one"] = -1;
4141
xmpData["Xmp.dc.two"] = 3.1415;
4242
xmpData["Xmp.dc.three"] = Exiv2::Rational(5, 7);
43-
xmpData["Xmp.dc.four"] = uint16_t(255);
43+
xmpData["Xmp.dc.four"] = static_cast<uint16_t>(255);
4444
xmpData["Xmp.dc.five"] = 256;
4545
xmpData["Xmp.dc.six"] = false;
4646

src/convert.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ bool convertStringCharsetIconv(std::string& str, const char* from, const char* t
15841584
size_t outbytesleft = sizeof(outbuf);
15851585
size_t rc = iconv(cd, &inptr, &inbytesleft, &outptr, &outbytesleft);
15861586
const size_t outbytesProduced = sizeof(outbuf) - outbytesleft;
1587-
if (rc == size_t(-1) && errno != E2BIG) {
1587+
if (rc == static_cast<size_t>(-1) && errno != E2BIG) {
15881588
#ifndef SUPPRESS_WARNINGS
15891589
EXV_WARNING << "iconv: " << strError() << " inbytesleft = " << inbytesleft << "\n";
15901590
#endif

src/crwimage.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void CrwImage::writeMetadata() {
9393

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

@@ -108,7 +108,7 @@ void CrwParser::decode(CrwImage* pCrwImage, const byte* pData, size_t size) {
108108
// a hack to get absolute offset of preview image inside CRW structure
109109
auto preview = header.findComponent(0x2007, 0x0000);
110110
if (preview) {
111-
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = uint32_t(preview->pData() - pData);
111+
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormat"] = static_cast<uint32_t>(preview->pData() - pData);
112112
(pCrwImage->exifData())["Exif.Image2.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(preview->size());
113113
}
114114
} // CrwParser::decode

src/crwimage_int.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ class CiffDirectory : public CiffComponent {
330330
~CiffDirectory() override;
331331
//@}
332332

333+
CiffDirectory(const CiffDirectory&) = delete;
334+
CiffDirectory& operator=(const CiffDirectory&) = delete;
335+
333336
//! @name Manipulators
334337
//@{
335338
// Default assignment operator is fine
@@ -522,6 +525,7 @@ struct CrwMapping {
522525
*/
523526
class CrwMap {
524527
public:
528+
~CrwMap() = delete;
525529
//! @name Not implemented
526530
//@{
527531
CrwMap(const CrwMap&) = delete;

src/exif.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ int Exifdatum::ifdId() const {
301301
}
302302

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

307307
int Exifdatum::idx() const {
@@ -422,11 +422,11 @@ void ExifThumb::setJpegThumbnail(const std::string& path) {
422422
}
423423

424424
void ExifThumb::setJpegThumbnail(const byte* buf, size_t size) {
425-
exifData_["Exif.Thumbnail.Compression"] = uint16_t(6);
425+
exifData_["Exif.Thumbnail.Compression"] = static_cast<uint16_t>(6);
426426
Exifdatum& format = exifData_["Exif.Thumbnail.JPEGInterchangeFormat"];
427-
format = uint32_t(0);
427+
format = static_cast<uint32_t>(0);
428428
format.setDataArea(buf, size);
429-
exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = uint32_t(size);
429+
exifData_["Exif.Thumbnail.JPEGInterchangeFormatLength"] = static_cast<uint32_t>(size);
430430
}
431431

432432
void ExifThumb::erase() {

src/http.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st
336336

337337
if (n != FINISH || !OK(status)) {
338338
snprintf(buffer, sizeof buffer, "wsa_error = %d,n = %d,sleep_ = %d status = %d", WSAGetLastError(), n,
339-
int(sleep_.count()), status);
339+
static_cast<int>(sleep_.count()), status);
340340
error(errors, buffer, nullptr, nullptr, 0);
341341
} else if (bSearching && OK(status)) {
342342
if (end) {

src/image.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStruct
425425
io.seekOrThrow(offset, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // position
426426
std::vector<byte> bytes(count); // allocate memory
427427
// TODO: once we have C++11 use bytes.data()
428-
io.readOrThrow(&bytes[0], count, ErrorCode::kerCorruptedMetadata);
428+
io.readOrThrow(bytes.data(), count, ErrorCode::kerCorruptedMetadata);
429429
io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata);
430430
// TODO: once we have C++11 use bytes.data()
431-
IptcData::printStructure(out, makeSliceUntil(&bytes[0], count), depth);
431+
IptcData::printStructure(out, makeSliceUntil(bytes.data(), count), depth);
432432
}
433433
} else if (option == kpsRecursive && tag == 0x927c /* MakerNote */ && count > 10) {
434434
const long restore = io.tell(); // save

src/image_int.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ std::string stringFormat(const char* format, ...) {
2424
buffer.resize(need + 1);
2525
va_list args; // variable arg list
2626
va_start(args, format); // args start after format
27-
rc = vsnprintf(&buffer[0], buffer.size(), format, args);
27+
rc = vsnprintf(buffer.data(), buffer.size(), format, args);
2828
va_end(args); // free the args
2929
if (rc > 0)
3030
need = static_cast<size_t>(rc);
3131
} while (buffer.size() <= need);
3232

3333
if (rc > 0)
34-
result = std::string(&buffer[0], need);
34+
result = std::string(buffer.data(), need);
3535
return result;
3636
}
3737

src/jpgimage.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void JpegBase::readMetadata() {
188188
append(psBlob, buf.c_data(16), size - 16);
189189
}
190190
// Check whether psBlob is complete
191-
if (!psBlob.empty() && Photoshop::valid(&psBlob[0], psBlob.size())) {
191+
if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
192192
--search;
193193
foundCompletePsData = true;
194194
}
@@ -263,7 +263,7 @@ void JpegBase::readMetadata() {
263263
const byte* record = nullptr;
264264
uint32_t sizeIptc = 0;
265265
uint32_t sizeHdr = 0;
266-
const byte* pCur = &psBlob[0];
266+
const byte* pCur = psBlob.data();
267267
const byte* pEnd = pCur + psBlob.size();
268268
while (pCur < pEnd && 0 == Photoshop::locateIptcIrb(pCur, pEnd - pCur, &record, sizeHdr, sizeIptc)) {
269269
#ifdef EXIV2_DEBUG_MESSAGES
@@ -274,7 +274,7 @@ void JpegBase::readMetadata() {
274274
}
275275
pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
276276
}
277-
if (!iptcBlob.empty() && IptcParser::decode(iptcData_, &iptcBlob[0], iptcBlob.size())) {
277+
if (!iptcBlob.empty() && IptcParser::decode(iptcData_, iptcBlob.data(), iptcBlob.size())) {
278278
#ifndef SUPPRESS_WARNINGS
279279
EXV_WARNING << "Failed to decode IPTC metadata.\n";
280280
#endif
@@ -680,7 +680,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
680680
// Append to psBlob
681681
append(psBlob, buf.c_data(16), buf.size() - 16);
682682
// Check whether psBlob is complete
683-
if (!psBlob.empty() && Photoshop::valid(&psBlob[0], psBlob.size())) {
683+
if (!psBlob.empty() && Photoshop::valid(psBlob.data(), psBlob.size())) {
684684
foundCompletePsData = true;
685685
}
686686
} else if (marker == com_ && skipCom == notfound) {
@@ -750,7 +750,7 @@ void JpegBase::doWriteMetadata(BasicIo& outIo) {
750750
size_t exifSize = rawExif.size();
751751
WriteMethod wm = ExifParser::encode(blob, pExifData, exifSize, bo, exifData_);
752752
if (wm == wmIntrusive) {
753-
pExifData = !blob.empty() ? &blob[0] : nullptr;
753+
pExifData = !blob.empty() ? blob.data() : nullptr;
754754
exifSize = blob.size();
755755
}
756756
if (exifSize > 0) {

src/makernote_int.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ const Exiv2::Value* getExifValue(Exiv2::Internal::TiffComponent* pRoot, const ui
10361036
std::string getExifModel(Exiv2::Internal::TiffComponent* pRoot) {
10371037
// Lookup the Exif.Image.Model tag
10381038
const auto value = getExifValue(pRoot, 0x0110, Exiv2::Internal::ifd0Id);
1039-
return (!value || value->count() == 0) ? std::string("") : std::string(value->toString());
1039+
return (!value || value->count() == 0) ? std::string("") : static_cast<std::string>(value->toString());
10401040
}
10411041

10421042
void ncrypt(Exiv2::byte* pData, uint32_t size, uint32_t count, uint32_t serial) {

src/makernote_int.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ class TiffMnCreator {
8181
*/
8282
static TiffComponent* create(uint16_t tag, IfdId group, IfdId mnGroup);
8383

84+
~TiffMnCreator() = default;
8485
//! Prevent destruction (needed if used as a policy class)
85-
~TiffMnCreator() = delete;
86+
TiffMnCreator(const TiffComponent&) = delete;
87+
TiffMnCreator& operator=(const TiffComponent&) = delete;
8688

8789
private:
8890
static const TiffMnRegistry registry_[]; //<! List of makernotes

src/minoltamn_int.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ std::ostream& MinoltaMakerNote::printMinoltaExposureManualBias5D(std::ostream& o
583583
std::ios::fmtflags f(os.flags());
584584
std::ostringstream oss;
585585
oss.copyfmt(os);
586-
os << std::fixed << std::setprecision(2) << (float(value.toInt64() - 128) / 24);
586+
os << std::fixed << std::setprecision(2) << (static_cast<float>(value.toInt64() - 128) / 24);
587587
os.copyfmt(oss);
588588
os.flags(f);
589589
return os;
@@ -595,7 +595,7 @@ std::ostream& MinoltaMakerNote::printMinoltaExposureCompensation5D(std::ostream&
595595
std::ios::fmtflags f(os.flags());
596596
std::ostringstream oss;
597597
oss.copyfmt(os);
598-
os << std::fixed << std::setprecision(2) << (float(value.toInt64() - 300) / 100);
598+
os << std::fixed << std::setprecision(2) << (static_cast<float>(value.toInt64() - 300) / 100);
599599
os.copyfmt(oss);
600600
os.flags(f);
601601
return os;

0 commit comments

Comments
 (0)