]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
LZ4Compressor.h: fix usage of unsigned var
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 13 Oct 2017 18:39:23 +0000 (20:39 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 25 Oct 2017 16:14:05 +0000 (18:14 +0200)
Fix for:

[src/compressor/lz4/LZ4Compressor.h:49]: (style) Checking if
 unsigned variable 'compressed_len' is less than zero.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/compressor/lz4/LZ4Compressor.h

index 55e816be4f91161b9114c7d4db3370bd15aca4d6..3ab96e23332039b204d25a303c80da47b009c32d 100644 (file)
@@ -39,7 +39,7 @@ class LZ4Compressor : public Compressor {
     const char *data;
     unsigned num = src.get_num_buffers();
     uint32_t origin_len;
-    uint32_t compressed_len;
+    int compressed_len;
     ::encode((uint32_t)num, dst);
     while (left) {
       origin_len = p.get_ptr_and_advance(left, &data);
@@ -51,7 +51,7 @@ class LZ4Compressor : public Compressor {
       pos += compressed_len;
       left -= origin_len;
       ::encode(origin_len, dst);
-      ::encode(compressed_len, dst);
+      ::encode((uint32_t)compressed_len, dst);
     }
     assert(p.end());