You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2021/05/26 12:46:12 UTC

[nifi-minifi-cpp] 04/17: fix compilation on some platforms with size_t not the same as uint64_t

This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch MINIFICPP-1507
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 4c01eeaf718b9113554bf2c542265bccd3dcb030
Author: Marton Szasz <sz...@gmail.com>
AuthorDate: Tue Mar 16 13:20:45 2021 +0100

    fix compilation on some platforms with size_t not the same as uint64_t
---
 libminifi/src/io/BufferStream.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libminifi/src/io/BufferStream.cpp b/libminifi/src/io/BufferStream.cpp
index 1dd64ea..be0b68b 100644
--- a/libminifi/src/io/BufferStream.cpp
+++ b/libminifi/src/io/BufferStream.cpp
@@ -38,7 +38,7 @@ int BufferStream::write(const uint8_t *value, int size) {
 
 size_t BufferStream::read(uint8_t *buf, size_t len) {
   const auto bytes_available_in_buffer = buffer_.size() - readOffset_;
-  const auto readlen = std::min(len, bytes_available_in_buffer);
+  const auto readlen = std::min(len, size_t{bytes_available_in_buffer});
   const auto begin = buffer_.begin() + gsl::narrow<decltype(buffer_)::difference_type>(readOffset_);
   std::copy(begin, begin + gsl::narrow<decltype(buffer_)::difference_type>(readlen), buf);