Skip to content

Commit 65c5b77

Browse files
committed
fix misplaced const
Signed-off-by: Rosen Penev <[email protected]>
1 parent c9c2a18 commit 65c5b77

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/tiffcomposite_int.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ uint32_t TiffBinaryArray::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, int
11381138

11391139
uint32_t TiffBinaryElement::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, int64_t /*offset*/,
11401140
uint32_t /*valueIdx*/, uint32_t /*dataIdx*/, uint32_t& /*imageIdx*/) {
1141-
Value const* pv = pValue();
1141+
auto pv = pValue();
11421142
if (!pv || pv->count() == 0)
11431143
return 0;
11441144
DataBuf buf(pv->size());
@@ -1511,13 +1511,13 @@ TiffType toTiffType(TypeId typeId) {
15111511
return static_cast<uint16_t>(typeId);
15121512
}
15131513

1514-
bool cmpTagLt(TiffComponent const* lhs, TiffComponent const* rhs) {
1514+
bool cmpTagLt(const TiffComponent* lhs, const TiffComponent* rhs) {
15151515
if (lhs->tag() != rhs->tag())
15161516
return lhs->tag() < rhs->tag();
15171517
return lhs->idx() < rhs->idx();
15181518
}
15191519

1520-
bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs) {
1520+
bool cmpGroupLt(const TiffComponent* lhs, const TiffComponent* rhs) {
15211521
return lhs->group() < rhs->group();
15221522
}
15231523

src/tiffcomposite_int.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,13 +1508,13 @@ class TiffBinaryElement : public TiffEntryBase {
15081508
@brief Compare two TIFF component pointers by tag. Return true if the tag
15091509
of component lhs is less than that of rhs.
15101510
*/
1511-
bool cmpTagLt(TiffComponent const* lhs, TiffComponent const* rhs);
1511+
bool cmpTagLt(const TiffComponent* lhs, const TiffComponent* rhs);
15121512

15131513
/*!
15141514
@brief Compare two TIFF component pointers by group. Return true if the
15151515
group of component lhs is less than that of rhs.
15161516
*/
1517-
bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs);
1517+
bool cmpGroupLt(const TiffComponent* lhs, const TiffComponent* rhs);
15181518

15191519
//! Function to create and initialize a new TIFF entry
15201520
TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group);

src/tiffvisitor_int.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
254254
}
255255
}
256256

257-
void TiffDecoder::getObjData(byte const*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
257+
void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
258258
if (object && object->tag() == tag && object->group() == group) {
259259
pData = object->pData();
260260
size = object->size();
261261
return;
262262
}
263263
TiffFinder finder(tag, group);
264264
pRoot_->accept(finder);
265-
TiffEntryBase const* te = dynamic_cast<TiffEntryBase*>(finder.result());
265+
auto te = dynamic_cast<TiffEntryBase*>(finder.result());
266266
if (te) {
267267
pData = te->pData();
268268
size = te->size();
@@ -274,7 +274,7 @@ void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
274274
// add Exif tag anyway
275275
decodeStdTiffEntry(object);
276276

277-
byte const* pData = nullptr;
277+
const byte* pData = nullptr;
278278
size_t size = 0;
279279
getObjData(pData, size, 0x02bc, ifd0Id, object);
280280
if (pData) {
@@ -307,7 +307,7 @@ void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
307307
}
308308
decodedIptc_ = true;
309309
// 1st choice: IPTCNAA
310-
byte const* pData = nullptr;
310+
const byte* pData = nullptr;
311311
size_t size = 0;
312312
getObjData(pData, size, 0x83bb, ifd0Id, object);
313313
if (pData) {
@@ -327,7 +327,7 @@ void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
327327
size = 0;
328328
getObjData(pData, size, 0x8649, ifd0Id, object);
329329
if (pData) {
330-
byte const* record = nullptr;
330+
const byte* record = nullptr;
331331
uint32_t sizeHdr = 0;
332332
uint32_t sizeData = 0;
333333
if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {

src/tiffvisitor_int.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class TiffDecoder : public TiffVisitor {
307307
Populates \em pData and \em size with the result. If no matching
308308
element is found the function leaves both of these parameters unchanged.
309309
*/
310-
void getObjData(byte const*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object);
310+
void getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object);
311311
//@}
312312

313313
// DATA

0 commit comments

Comments
 (0)