Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxim Onciul
pi_files
Commits
d94aa66b
Commit
d94aa66b
authored
Aug 26, 2021
by
Maxim Onciul
Browse files
debug foldToBytes
parent
7d8c9387
Changes
1
Hide whitespace changes
Inline
Side-by-side
polar_rs/src/coding.cpp
View file @
d94aa66b
...
...
@@ -359,6 +359,10 @@ Coding::foldToBytes(vector<uint8_t>* input, unsigned int output_length)
gf
*
output
=
(
gf
*
)
malloc
(
output_length
*
sizeof
(
gf
));
if
(
!
output
)
throw
new
bad_alloc
();
#ifdef TEST
cout
<<
"fold to bytes, Output:"
<<
endl
;
#endif // TEST
for
(
unsigned
int
i
=
0
;
i
<
output_length
;
i
++
)
{
uint8_t
intermediate
=
0
;
...
...
@@ -368,7 +372,13 @@ Coding::foldToBytes(vector<uint8_t>* input, unsigned int output_length)
intermediate
|=
(
input
->
at
(
i
*
8
+
j
));
}
output
[
i
]
=
intermediate
;
#ifdef TEST
cout
<<
output
[
i
]
<<
" "
;
#endif // TEST
}
#ifdef TEST
cout
<<
endl
;
#endif // TEST
return
output
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment