fix misplaced const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 3 years ago
parent c9c2a1847b
commit 65c5b772c9

@ -1138,7 +1138,7 @@ uint32_t TiffBinaryArray::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, int
uint32_t TiffBinaryElement::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, int64_t /*offset*/, uint32_t TiffBinaryElement::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, int64_t /*offset*/,
uint32_t /*valueIdx*/, uint32_t /*dataIdx*/, uint32_t& /*imageIdx*/) { uint32_t /*valueIdx*/, uint32_t /*dataIdx*/, uint32_t& /*imageIdx*/) {
Value const* pv = pValue(); auto pv = pValue();
if (!pv || pv->count() == 0) if (!pv || pv->count() == 0)
return 0; return 0;
DataBuf buf(pv->size()); DataBuf buf(pv->size());
@ -1511,13 +1511,13 @@ TiffType toTiffType(TypeId typeId) {
return static_cast<uint16_t>(typeId); return static_cast<uint16_t>(typeId);
} }
bool cmpTagLt(TiffComponent const* lhs, TiffComponent const* rhs) { bool cmpTagLt(const TiffComponent* lhs, const TiffComponent* rhs) {
if (lhs->tag() != rhs->tag()) if (lhs->tag() != rhs->tag())
return lhs->tag() < rhs->tag(); return lhs->tag() < rhs->tag();
return lhs->idx() < rhs->idx(); return lhs->idx() < rhs->idx();
} }
bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs) { bool cmpGroupLt(const TiffComponent* lhs, const TiffComponent* rhs) {
return lhs->group() < rhs->group(); return lhs->group() < rhs->group();
} }

@ -1508,13 +1508,13 @@ class TiffBinaryElement : public TiffEntryBase {
@brief Compare two TIFF component pointers by tag. Return true if the tag @brief Compare two TIFF component pointers by tag. Return true if the tag
of component lhs is less than that of rhs. of component lhs is less than that of rhs.
*/ */
bool cmpTagLt(TiffComponent const* lhs, TiffComponent const* rhs); bool cmpTagLt(const TiffComponent* lhs, const TiffComponent* rhs);
/*! /*!
@brief Compare two TIFF component pointers by group. Return true if the @brief Compare two TIFF component pointers by group. Return true if the
group of component lhs is less than that of rhs. group of component lhs is less than that of rhs.
*/ */
bool cmpGroupLt(TiffComponent const* lhs, TiffComponent const* rhs); bool cmpGroupLt(const TiffComponent* lhs, const TiffComponent* rhs);
//! Function to create and initialize a new TIFF entry //! Function to create and initialize a new TIFF entry
TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group); TiffComponent::UniquePtr newTiffEntry(uint16_t tag, IfdId group);

@ -254,7 +254,7 @@ void TiffDecoder::visitIfdMakernote(TiffIfdMakernote* object) {
} }
} }
void TiffDecoder::getObjData(byte const*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) { void TiffDecoder::getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object) {
if (object && object->tag() == tag && object->group() == group) { if (object && object->tag() == tag && object->group() == group) {
pData = object->pData(); pData = object->pData();
size = object->size(); size = object->size();
@ -262,7 +262,7 @@ void TiffDecoder::getObjData(byte const*& pData, size_t& size, uint16_t tag, Ifd
} }
TiffFinder finder(tag, group); TiffFinder finder(tag, group);
pRoot_->accept(finder); pRoot_->accept(finder);
TiffEntryBase const* te = dynamic_cast<TiffEntryBase*>(finder.result()); auto te = dynamic_cast<TiffEntryBase*>(finder.result());
if (te) { if (te) {
pData = te->pData(); pData = te->pData();
size = te->size(); size = te->size();
@ -274,7 +274,7 @@ void TiffDecoder::decodeXmp(const TiffEntryBase* object) {
// add Exif tag anyway // add Exif tag anyway
decodeStdTiffEntry(object); decodeStdTiffEntry(object);
byte const* pData = nullptr; const byte* pData = nullptr;
size_t size = 0; size_t size = 0;
getObjData(pData, size, 0x02bc, ifd0Id, object); getObjData(pData, size, 0x02bc, ifd0Id, object);
if (pData) { if (pData) {
@ -307,7 +307,7 @@ void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
} }
decodedIptc_ = true; decodedIptc_ = true;
// 1st choice: IPTCNAA // 1st choice: IPTCNAA
byte const* pData = nullptr; const byte* pData = nullptr;
size_t size = 0; size_t size = 0;
getObjData(pData, size, 0x83bb, ifd0Id, object); getObjData(pData, size, 0x83bb, ifd0Id, object);
if (pData) { if (pData) {
@ -327,7 +327,7 @@ void TiffDecoder::decodeIptc(const TiffEntryBase* object) {
size = 0; size = 0;
getObjData(pData, size, 0x8649, ifd0Id, object); getObjData(pData, size, 0x8649, ifd0Id, object);
if (pData) { if (pData) {
byte const* record = nullptr; const byte* record = nullptr;
uint32_t sizeHdr = 0; uint32_t sizeHdr = 0;
uint32_t sizeData = 0; uint32_t sizeData = 0;
if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) { if (0 != Photoshop::locateIptcIrb(pData, size, &record, sizeHdr, sizeData)) {

@ -307,7 +307,7 @@ class TiffDecoder : public TiffVisitor {
Populates \em pData and \em size with the result. If no matching Populates \em pData and \em size with the result. If no matching
element is found the function leaves both of these parameters unchanged. element is found the function leaves both of these parameters unchanged.
*/ */
void getObjData(byte const*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object); void getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object);
//@} //@}
// DATA // DATA

Loading…
Cancel
Save