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
4e31a819
Commit
4e31a819
authored
9 years ago
by
Vadim Vygonets
Browse files
Options
Downloads
Patches
Plain Diff
Fix debug output and asserts
parent
0e4f18a2
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
heatshrink_decoder.c
+5
-3
5 additions, 3 deletions
heatshrink_decoder.c
heatshrink_encoder.c
+1
-1
1 addition, 1 deletion
heatshrink_encoder.c
with
6 additions
and
4 deletions
heatshrink_decoder.c
+
5
−
3
View file @
4e31a819
...
...
@@ -25,8 +25,10 @@ static const char *state_names[] = {
"empty"
,
"input_available"
,
"yield_literal"
,
"backref_index"
,
"backref_count"
,
"backref_index_msb"
,
"backref_index_lsb"
,
"backref_count_msb"
,
"backref_count_lsb"
,
"yield_backref"
,
"check_for_more_input"
,
};
...
...
@@ -280,7 +282,7 @@ static HSD_state st_yield_backref(heatshrink_decoder *hsd,
uint16_t
neg_offset
=
hsd
->
output_index
;
LOG
(
"-- emitting %zu bytes from -%u bytes back
\n
"
,
count
,
neg_offset
);
ASSERT
(
neg_offset
<
mask
+
1
);
ASSERT
(
count
<=
1
<<
BACKREF_COUNT_BITS
(
hsd
));
ASSERT
(
count
<=
(
size_t
)(
1
<<
BACKREF_COUNT_BITS
(
hsd
))
)
;
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
uint8_t
c
=
buf
[(
hsd
->
head_index
-
neg_offset
)
&
mask
];
...
...
This diff is collapsed.
Click to expand it.
heatshrink_encoder.c
+
1
−
1
View file @
4e31a819
...
...
@@ -312,7 +312,7 @@ static HSE_state st_step_search(heatshrink_encoder *hse) {
LOG
(
"ss Found match of %d bytes at %d
\n
"
,
match_length
,
match_pos
);
hse
->
match_pos
=
match_pos
;
hse
->
match_length
=
match_length
;
ASSERT
(
match_pos
<
1
<<
hse
->
window_sz2
/*window_length*/
);
ASSERT
(
match_pos
<
1
<<
HEATSHRINK_ENCODER_WINDOW_BITS
(
hse
)
/*window_length*/
);
return
HSES_YIELD_TAG_BIT
;
}
...
...
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