Skip to content

Commit

Permalink
#2711: add static cast
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRyabinin committed Oct 16, 2023
1 parent fbc7cab commit a46bea3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/aws-cpp-sdk-core/source/client/RequestCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ iostream_outcome Aws::Client::RequestCompression::compress(std::shared_ptr<Aws::

//Adding one to the stream size counter to account for the EOF marker.
streamSize++;
size_t toRead;
size_t toRead = 0;
// Compress
do {
toRead = std::min(streamSize, ZLIB_CHUNK);
Expand All @@ -155,8 +155,9 @@ iostream_outcome Aws::Client::RequestCompression::compress(std::shared_ptr<Aws::
return false;
}
}
assert(streamSize >= toRead);
streamSize -= toRead; //left to read
strm.avail_in = (flush == Z_FINISH)?toRead-1:toRead; //skip EOF if included
strm.avail_in = static_cast<uInt>((flush == Z_FINISH) ? toRead-1 : toRead); //skip EOF if included
strm.next_in = in.get();
do
{
Expand Down Expand Up @@ -254,7 +255,7 @@ Aws::Client::RequestCompression::uncompress(std::shared_ptr<Aws::IOStream> input

//Adding one to the stream size counter to account for the EOF marker.
streamSize++;
size_t toRead;
size_t toRead = 0;
// Decompress
do {
toRead = (streamSize < ZLIB_CHUNK)?streamSize:ZLIB_CHUNK;
Expand All @@ -277,7 +278,7 @@ Aws::Client::RequestCompression::uncompress(std::shared_ptr<Aws::IOStream> input
}

// Filling input buffer to decompress
strm.avail_in = toRead;
strm.avail_in = static_cast<uInt>(toRead);
strm.next_in = in.get();
do
{
Expand Down

0 comments on commit a46bea3

Please sign in to comment.