Skip to content

Commit

Permalink
Fix implicit cast warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse authored and neheb committed Aug 1, 2022
1 parent 4410f46 commit ee5dae4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tiffcomposite_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,11 +995,11 @@ uint32_t TiffEntryBase::writeOffset(byte* buf, size_t offset, TiffType tiffType,
case ttSignedShort:
if (offset > std::numeric_limits<uint16_t>::max())
throw Error(ErrorCode::kerOffsetOutOfRange);
rc = us2Data(buf, static_cast<uint16_t>(offset), byteOrder);
rc = static_cast<uint32_t>(us2Data(buf, static_cast<uint16_t>(offset), byteOrder));
break;
case ttUnsignedLong:
case ttSignedLong:
rc = l2Data(buf, static_cast<uint32_t>(offset), byteOrder);
rc = static_cast<uint32_t>(l2Data(buf, static_cast<uint32_t>(offset), byteOrder));
break;
default:
throw Error(ErrorCode::kerUnsupportedDataAreaOffsetType);
Expand Down Expand Up @@ -1100,10 +1100,10 @@ uint32_t TiffBinaryArray::doWrite(IoWrapper& ioWrapper, ByteOrder byteOrder, siz
size_t elSize = TypeInfo::typeSize(toTypeId(cfg()->elTiffType_, 0, cfg()->group_));
switch (elSize) {
case 2:
idx += us2Data(buf, static_cast<uint16_t>(size()), byteOrder);
idx += static_cast<uint32_t>(us2Data(buf, static_cast<uint16_t>(size()), byteOrder));
break;
case 4:
idx += ul2Data(buf, static_cast<uint32_t>(size()), byteOrder);
idx += static_cast<uint32_t>(ul2Data(buf, static_cast<uint32_t>(size()), byteOrder));
break;
default:
break;
Expand Down

0 comments on commit ee5dae4

Please sign in to comment.