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
2622a957
Commit
2622a957
authored
9 years ago
by
Vadim Vygonets
Committed by
Scott Vokes
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unreachable encoder states
Conflicts: heatshrink_encoder.c
parent
580efc2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
enc_sm.dot
+3
-7
3 additions, 7 deletions
enc_sm.dot
heatshrink_encoder.c
+2
-12
2 additions, 12 deletions
heatshrink_encoder.c
with
5 additions
and
19 deletions
enc_sm.dot
+
3
−
7
View file @
2622a957
...
...
@@ -26,13 +26,10 @@ digraph {
yield_tag_bit
->
yield_tag_bit
[
label
=
"poll(), full buf"
,
color
=
"red"
]
yield_tag_bit
->
yield_literal
[
label
=
"poll(), literal"
,
color
=
"red"
]
yield_tag_bit
->
yield_br_index
[
label
=
"poll(), no literal"
,
color
=
"red"
]
yield_tag_bit
->
flush_bits
[
label
=
"finishing, no literal"
]
yield_tag_bit
->
yield_br_index
[
label
=
"poll(), match"
,
color
=
"red"
]
yield_literal
->
yield_literal
[
label
=
"poll(), full buf"
,
color
=
"red"
]
yield_literal
->
search
[
label
=
"poll(), no match"
,
color
=
"red"
]
yield_literal
->
yield_tag_bit
[
label
=
"poll(), match"
,
color
=
"red"
]
yield_literal
->
flush_bits
[
label
=
"poll(), final literal"
,
color
=
"red"
]
yield_literal
->
search
[
label
=
"done"
]
yield_br_index
->
yield_br_index
[
label
=
"poll(), full buf"
,
color
=
"red"
]
yield_br_index
->
yield_br_length
[
label
=
"poll()"
,
color
=
"red"
]
...
...
@@ -40,8 +37,7 @@ digraph {
yield_br_length
->
yield_br_length
[
label
=
"poll(), full buf"
,
color
=
"red"
]
yield_br_length
->
search
[
label
=
"done"
]
save_backlog
->
flush_bits
[
label
=
"finishing, no literal"
]
save_backlog
->
yield_tag_bit
[
label
=
"finishing, literal"
]
save_backlog
->
flush_bits
[
label
=
"finishing"
]
save_backlog
->
not_full
[
label
=
"expect more input"
]
flush_bits
->
flush_bits
[
label
=
"poll(), full buf"
,
color
=
"red"
]
...
...
This diff is collapsed.
Click to expand it.
heatshrink_encoder.c
+
2
−
12
View file @
2622a957
...
...
@@ -62,7 +62,6 @@ static int can_take_byte(output_info *oi);
static
int
is_finishing
(
heatshrink_encoder
*
hse
);
static
int
on_final_literal
(
heatshrink_encoder
*
hse
);
static
void
save_backlog
(
heatshrink_encoder
*
hse
);
static
int
has_literal
(
heatshrink_encoder
*
hse
);
/* Push COUNT (max 8) bits to the output buffer, which has room. */
static
void
push_bits
(
heatshrink_encoder
*
hse
,
uint8_t
count
,
uint8_t
bits
,
...
...
@@ -292,7 +291,6 @@ static HSE_state st_step_search(heatshrink_encoder *hse) {
if
(
match_pos
==
MATCH_NOT_FOUND
)
{
LOG
(
"ss Match not found
\n
"
);
hse
->
match_scan_index
++
;
hse
->
flags
|=
FLAG_HAS_LITERAL
;
hse
->
match_length
=
0
;
return
HSES_YIELD_TAG_BIT
;
}
else
{
...
...
@@ -326,9 +324,7 @@ static HSE_state st_yield_literal(heatshrink_encoder *hse,
output_info
*
oi
)
{
if
(
can_take_byte
(
oi
))
{
push_literal_byte
(
hse
,
oi
);
hse
->
flags
&=
~
FLAG_HAS_LITERAL
;
if
(
on_final_literal
(
hse
))
{
return
HSES_FLUSH_BITS
;
}
return
hse
->
match_length
>
0
?
HSES_YIELD_TAG_BIT
:
HSES_SEARCH
;
return
HSES_SEARCH
;
}
else
{
return
HSES_YIELD_LITERAL
;
}
...
...
@@ -368,13 +364,7 @@ static HSE_state st_yield_br_length(heatshrink_encoder *hse,
static
HSE_state
st_save_backlog
(
heatshrink_encoder
*
hse
)
{
if
(
is_finishing
(
hse
))
{
/* copy remaining literal (if necessary) */
if
(
has_literal
(
hse
))
{
hse
->
flags
|=
FLAG_ON_FINAL_LITERAL
;
return
HSES_YIELD_TAG_BIT
;
}
else
{
return
HSES_FLUSH_BITS
;
}
return
HSES_FLUSH_BITS
;
}
else
{
LOG
(
"-- saving backlog
\n
"
);
save_backlog
(
hse
);
...
...
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