]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed warnings shown by compiler
authorPaul Cruz <paulcruz74@fb.com>
Fri, 11 Aug 2017 21:41:44 +0000 (14:41 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Fri, 11 Aug 2017 21:41:44 +0000 (14:41 -0700)
doc/educational_decoder/harness.c
doc/educational_decoder/zstd_decompress.c

index 683278dfcd0147272acaa05102c4dc1233771982..31e1c292432c99c62903d943ffcad3663ce13f76 100644 (file)
@@ -87,7 +87,7 @@ int main(int argc, char **argv) {
     }
 
     size_t decompressed_size = ZSTD_get_decompressed_size(input, input_size);
-    if (decompressed_size == -1) {
+    if (decompressed_size == (size_t)-1) {
         decompressed_size = MAX_COMPRESSION_RATIO * input_size;
         fprintf(stderr, "WARNING: Compressed data does not contain "
                         "decompressed size, going to assume the compression "
@@ -117,4 +117,3 @@ int main(int argc, char **argv) {
     free(dict);
     input = output = dict = NULL;
 }
-
index 93c346312377dac003943fe250386909803d934e..236ad58aab79f4f748a07cd180dddee65648a335 100644 (file)
@@ -1374,7 +1374,7 @@ static void execute_sequences(frame_context_t *const ctx, ostream_t *const out,
         // than the offset
         // ex: if the output so far was "abc", a command with offset=3 and
         // match_length=6 would produce "abcabcabc" as the new output
-        for (size_t i = 0; i < match_length; i++) {
+        for (size_t j = 0; j < match_length; j++) {
             *write_ptr = *(write_ptr - offset);
             write_ptr++;
         }
@@ -2117,7 +2117,7 @@ static void FSE_init_dtable(FSE_dtable *const dtable,
     }
 
     // Now we can fill baseline and num bits
-    for (int i = 0; i < size; i++) {
+    for (size_t i = 0; i < size; i++) {
         u8 symbol = dtable->symbols[i];
         u16 next_state_desc = state_desc[symbol]++;
         // Fills in the table appropriately, next_state_desc increases by symbol