Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heatshrink
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Heatshrink
Commits
a9ca0cd9
Commit
a9ca0cd9
authored
9 years ago
by
Scott Vokes
Browse files
Options
Downloads
Patches
Plain Diff
Consistently use "decompress", not "uncompress".
parent
de92281f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CONTRIBUTING.md
+1
-1
1 addition, 1 deletion
CONTRIBUTING.md
heatshrink.c
+2
-2
2 additions, 2 deletions
heatshrink.c
test_heatshrink_dynamic_theft.c
+7
-7
7 additions, 7 deletions
test_heatshrink_dynamic_theft.c
with
10 additions
and
10 deletions
CONTRIBUTING.md
+
1
−
1
View file @
a9ca0cd9
...
...
@@ -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
un
compression state machines have been designed
1.
The compression and
de
compression 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.
...
...
This diff is collapsed.
Click to expand it.
heatshrink.c
+
2
−
2
View file @
a9ca0cd9
...
...
@@ -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
un
compresses byte streams using LZSS, and is
\n
"
"heatshrink compresses or
de
compresses 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 (
un
compress)
\n
"
" -d decode (
de
compress)
\n
"
" -v verbose (print input & output sizes, compression ratio, etc.)
\n
"
"
\n
"
" -w SIZE Base-2 log of LZSS sliding window size
\n
"
...
...
This diff is collapsed.
Click to expand it.
test_heatshrink_dynamic_theft.c
+
7
−
7
View file @
a9ca0cd9
...
...
@@ -384,7 +384,7 @@ static bool do_compress(heatshrink_encoder *hse,
return
efres
==
HSER_FINISH_DONE
;
}
static
bool
do_
un
compress
(
heatshrink_decoder
*
hsd
,
static
bool
do_
de
compress
(
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
un
compressed_size
=
0
;
if
(
!
do_
un
compress
(
hsd
,
output
,
compressed_size
,
output2
,
BUF_SIZE
,
&
un
compressed_size
))
{
size_t
de
compressed_size
=
0
;
if
(
!
do_
de
compress
(
hsd
,
output
,
compressed_size
,
output2
,
BUF_SIZE
,
&
de
compressed_size
))
{
return
THEFT_TRIAL_ERROR
;
}
// verify
un
compressed output matches original input
if
(
r
->
size
!=
un
compressed_size
)
{
// verify
de
compressed output matches original input
if
(
r
->
size
!=
de
compressed_size
)
{
return
THEFT_TRIAL_FAIL
;
}
if
(
0
!=
memcmp
(
output2
,
r
->
buf
,
un
compressed_size
))
{
if
(
0
!=
memcmp
(
output2
,
r
->
buf
,
de
compressed_size
))
{
return
THEFT_TRIAL_FAIL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment