Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IlmImf: Fix clang compiler warnings #770

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ TileBufferTask::execute ()
// Uncompress the data, if necessary
//

if (_tileBuffer->compressor && _tileBuffer->dataSize < Int64(sizeOfTile))
if (_tileBuffer->compressor && _tileBuffer->dataSize < static_cast<Int64>(sizeOfTile))
{
_tileBuffer->format = _tileBuffer->compressor->format();

Expand All @@ -605,7 +605,7 @@ TileBufferTask::execute ()
// sanity check data size: the uncompressed data should be exactly
// 'sizeOfTile' (if it's less, the file is corrupt and there'll be a buffer overrun)
//
if(_tileBuffer->dataSize != sizeOfTile)
if (_tileBuffer->dataSize != static_cast<Int64>(sizeOfTile))
{
THROW (IEX_NAMESPACE::InputExc, "size mismatch when reading deep tile: expected " << sizeOfTile << "bytes of uncompressed data but got " << _tileBuffer->dataSize);
}
Expand Down Expand Up @@ -1800,7 +1800,7 @@ DeepTiledInputFile::readPixelSampleCounts (int dx1, int dx2,
// @TODO refactor the compressor code to ensure full 64-bit support.
//

Int64 compressorMaxDataSize = Int64(std::numeric_limits<int>::max());
Int64 compressorMaxDataSize = static_cast<Int64>(std::numeric_limits<int>::max());
if (dataSize > compressorMaxDataSize ||
unpackedDataSize > compressorMaxDataSize ||
tableSize > compressorMaxDataSize)
Expand Down
6 changes: 3 additions & 3 deletions OpenEXR/IlmImf/ImfDwaCompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ DwaCompressor::LossyDctDecoderBase::execute ()

for (int i = 0; i < _SSE_ALIGNMENT; ++i)
{
if (((size_t)(rowBlockHandle + i) & _SSE_ALIGNMENT_MASK) == 0)
if ((reinterpret_cast<size_t>(rowBlockHandle + i) & _SSE_ALIGNMENT_MASK) == 0)
arkellr marked this conversation as resolved.
Show resolved Hide resolved
rowBlock[0] = (unsigned short *)(rowBlockHandle + i);
}

Expand Down Expand Up @@ -1010,7 +1010,7 @@ DwaCompressor::LossyDctDecoderBase::execute ()

for (int y = 8 * blocky; y < 8 * blocky + maxY; ++y)
{
if ((size_t)_rowPtrs[comp][y] & _SSE_ALIGNMENT_MASK)
if (reinterpret_cast<size_t>(_rowPtrs[comp][y]) & _SSE_ALIGNMENT_MASK)
arkellr marked this conversation as resolved.
Show resolved Hide resolved
fastPath = false;
}

Expand Down Expand Up @@ -2820,7 +2820,7 @@ DwaCompressor::uncompress
//
// sanity check for buffer data lying within range
//
if (cd->planarUncBufferEnd + dstScanlineSize - _planarUncBuffer[UNKNOWN] > _planarUncBufferSize[UNKNOWN] )
if ((cd->planarUncBufferEnd + static_cast<size_t>(dstScanlineSize)) > (_planarUncBuffer[UNKNOWN] + _planarUncBufferSize[UNKNOWN]) )
{
throw Iex::InputExc("DWA data corrupt");
}
Expand Down
3 changes: 1 addition & 2 deletions OpenEXR/IlmImf/ImfMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1882,8 +1882,7 @@ getScanlineChunkOffsetTableSize(const Header& header)
const Box2i &dataWindow = header.dataWindow();

vector<size_t> bytesPerLine;
size_t maxBytesPerLine = bytesPerLineTable (header,
bytesPerLine);
bytesPerLineTable (header, bytesPerLine);

int linesInBuffer = numLinesInBuffer ( header.compression() );

Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfOpaqueAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class OpaqueAttribute: public Attribute
virtual void copyValueFrom (const Attribute &other);


const int dataSize() const { return _dataSize; }
int dataSize() const { return _dataSize; }
const Array<char>& data() const { return _data; }

private:
Expand Down