Browse Source

Explicit cast from size_t to uInt (#941)

* Explicit cast from size_t to uInt

* static_cast<uInt> instead of C style cast
Baruch Nissenbaum 4 years ago
parent
commit
2917b8a005
1 changed files with 2 additions and 2 deletions
  1. 2 2
      httplib.h

+ 2 - 2
httplib.h

@@ -2564,7 +2564,7 @@ public:
 
     std::array<char, CPPHTTPLIB_COMPRESSION_BUFSIZ> buff{};
     do {
-      strm_.avail_out = buff.size();
+      strm_.avail_out = static_cast<uInt>(buff.size());
       strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
 
       ret = deflate(&strm_, flush);
@@ -2615,7 +2615,7 @@ public:
 
     std::array<char, CPPHTTPLIB_COMPRESSION_BUFSIZ> buff{};
     while (strm_.avail_in > 0) {
-      strm_.avail_out = buff.size();
+      strm_.avail_out = static_cast<uInt>(buff.size());
       strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
 
       ret = inflate(&strm_, Z_NO_FLUSH);