Skip to content
Snippets Groups Projects
Commit a9ca0cd9 authored by Scott Vokes's avatar Scott Vokes
Browse files

Consistently use "decompress", not "uncompress".

parent de92281f
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ can't decode correctly will need to wait until the next major release.
heatshrink uses the [Lempel-Ziv-Storer-Szymanski][LZSS] algorithm for
compression, with a few important implementation details:
1. The compression and uncompression state machines have been designed
1. The compression and decompression state machines have been designed
to run incrementally - processing can work a few bytes at a time,
suspending and resuming as additional data / buffer space becomes
available.
......
......@@ -55,13 +55,13 @@ static void usage(void) {
"Usage:\n"
" heatshrink [-h] [-e|-d] [-v] [-w SIZE] [-l BITS] [IN_FILE] [OUT_FILE]\n"
"\n"
"heatshrink compresses or uncompresses byte streams using LZSS, and is\n"
"heatshrink compresses or decompresses byte streams using LZSS, and is\n"
"designed especially for embedded, low-memory, and/or hard real-time\n"
"systems.\n"
"\n"
" -h print help\n"
" -e encode (compress, default)\n"
" -d decode (uncompress)\n"
" -d decode (decompress)\n"
" -v verbose (print input & output sizes, compression ratio, etc.)\n"
"\n"
" -w SIZE Base-2 log of LZSS sliding window size\n"
......
......@@ -384,7 +384,7 @@ static bool do_compress(heatshrink_encoder *hse,
return efres == HSER_FINISH_DONE;
}
static bool do_uncompress(heatshrink_decoder *hsd,
static bool do_decompress(heatshrink_decoder *hsd,
uint8_t *input, size_t input_size,
uint8_t *output, size_t output_buf_size, size_t *output_used_size) {
size_t sunk = 0;
......@@ -446,17 +446,17 @@ prop_encoded_and_decoded_data_should_match(void *input,
return THEFT_TRIAL_ERROR;
}
size_t uncompressed_size = 0;
if (!do_uncompress(hsd, output, compressed_size, output2,
BUF_SIZE, &uncompressed_size)) {
size_t decompressed_size = 0;
if (!do_decompress(hsd, output, compressed_size, output2,
BUF_SIZE, &decompressed_size)) {
return THEFT_TRIAL_ERROR;
}
// verify uncompressed output matches original input
if (r->size != uncompressed_size) {
// verify decompressed output matches original input
if (r->size != decompressed_size) {
return THEFT_TRIAL_FAIL;
}
if (0 != memcmp(output2, r->buf, uncompressed_size)) {
if (0 != memcmp(output2, r->buf, decompressed_size)) {
return THEFT_TRIAL_FAIL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment