Skip to content

Commit

Permalink
For std::min and std::max cast to like data types (#2389)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Kriske <kriske_jeffery_e@lilly.com>
  • Loading branch information
jekriske-lilly authored Jul 6, 2020
1 parent 75f5b57 commit 67f5fcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions torchvision/csrc/cpu/decoder/seekable_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bool SeekableBuffer::readBytes(
size_t maxBytes,
uint64_t timeoutMs) {
// Resize to th minimum 4K page or less
buffer_.resize(std::min(maxBytes, 4 * 1024UL));
buffer_.resize(std::min(maxBytes, size_t(4 * 1024UL)));
end_ = 0;
eof_ = false;

Expand All @@ -72,7 +72,7 @@ bool SeekableBuffer::readBytes(
if (res > 0) {
end_ += res;
if (end_ == buffer_.size()) {
buffer_.resize(std::min(end_ * 4UL, maxBytes));
buffer_.resize(std::min(size_t(end_ * 4UL), maxBytes));
}
} else if (res == 0) {
eof_ = true;
Expand Down
4 changes: 2 additions & 2 deletions torchvision/csrc/cpu/decoder/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ void setFormatDimensions(
}
}
// prevent zeros
destW = std::max(destW, 1UL);
destH = std::max(destH, 1UL);
destW = std::max(destW, size_t(1UL));
destH = std::max(destH, size_t(1UL));
}
} // namespace Util
} // namespace ffmpeg

0 comments on commit 67f5fcf

Please sign in to comment.