diff --git a/doc/educational_decoder/harness.c b/doc/educational_decoder/harness.c index 683278dfc..31e1c2924 100644 --- a/doc/educational_decoder/harness.c +++ b/doc/educational_decoder/harness.c @@ -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; } - diff --git a/doc/educational_decoder/zstd_decompress.c b/doc/educational_decoder/zstd_decompress.c index 93c346312..236ad58aa 100644 --- a/doc/educational_decoder/zstd_decompress.c +++ b/doc/educational_decoder/zstd_decompress.c @@ -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