mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
unittests: fix heatshrink compiler error on macOS
This commit is contained in:
parent
aab71bd993
commit
a79ee2d623
@ -46,20 +46,20 @@ static int _comp_uncomp(const uint8_t *buf, size_t len)
|
|||||||
|
|
||||||
/* compress */
|
/* compress */
|
||||||
while(1) {
|
while(1) {
|
||||||
unsigned n_sunk = 0;
|
size_t n_sunk = 0;
|
||||||
if (n) {
|
if (n) {
|
||||||
heatshrink_encoder_sink(&_encoder, inpos, n, &n_sunk);
|
heatshrink_encoder_sink(&_encoder, inpos, n, &n_sunk);
|
||||||
if (n_sunk) {
|
if (n_sunk) {
|
||||||
inpos += n_sunk;
|
inpos += n_sunk;
|
||||||
n -= n_sunk;
|
n -= n_sunk;
|
||||||
}
|
}
|
||||||
unsigned written = 0;
|
size_t written = 0;
|
||||||
heatshrink_encoder_poll(&_encoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
heatshrink_encoder_poll(&_encoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
||||||
outpos += written;
|
outpos += written;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while (heatshrink_encoder_finish(&_encoder) == HSER_FINISH_MORE) {
|
while (heatshrink_encoder_finish(&_encoder) == HSER_FINISH_MORE) {
|
||||||
unsigned written = 0;
|
size_t written = 0;
|
||||||
heatshrink_encoder_poll(&_encoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
heatshrink_encoder_poll(&_encoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
||||||
outpos += written;
|
outpos += written;
|
||||||
}
|
}
|
||||||
@ -73,20 +73,20 @@ static int _comp_uncomp(const uint8_t *buf, size_t len)
|
|||||||
outpos = _buf_res;
|
outpos = _buf_res;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
unsigned n_sunk = 0;
|
size_t n_sunk = 0;
|
||||||
if (n) {
|
if (n) {
|
||||||
heatshrink_decoder_sink(&_decoder, inpos, n, &n_sunk);
|
heatshrink_decoder_sink(&_decoder, inpos, n, &n_sunk);
|
||||||
if (n_sunk) {
|
if (n_sunk) {
|
||||||
inpos += n_sunk;
|
inpos += n_sunk;
|
||||||
n -= n_sunk;
|
n -= n_sunk;
|
||||||
}
|
}
|
||||||
unsigned written = 0;
|
size_t written = 0;
|
||||||
heatshrink_decoder_poll(&_decoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
heatshrink_decoder_poll(&_decoder, outpos, (_buf + sizeof(_buf) - outpos), &written);
|
||||||
outpos += written;
|
outpos += written;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while (heatshrink_decoder_finish(&_decoder) == HSDR_FINISH_MORE) {
|
while (heatshrink_decoder_finish(&_decoder) == HSDR_FINISH_MORE) {
|
||||||
unsigned written = 0;
|
size_t written = 0;
|
||||||
heatshrink_decoder_poll(&_decoder, outpos, (_buf_res + sizeof(_buf_res) - outpos), &written);
|
heatshrink_decoder_poll(&_decoder, outpos, (_buf_res + sizeof(_buf_res) - outpos), &written);
|
||||||
outpos += written;
|
outpos += written;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user