Skip to content
Snippets Groups Projects
Commit 5d91ca9a authored by Scott Vokes's avatar Scott Vokes
Browse files

Use consistently signed vars during index construction.

parent 15ebaddc
No related branches found
No related tags found
No related merge requests found
...@@ -448,7 +448,7 @@ static void do_indexing(heatshrink_encoder *hse) { ...@@ -448,7 +448,7 @@ static void do_indexing(heatshrink_encoder *hse) {
* dynamically improve the index. * dynamically improve the index.
* */ * */
struct hs_index *hsi = HEATSHRINK_ENCODER_INDEX(hse); struct hs_index *hsi = HEATSHRINK_ENCODER_INDEX(hse);
uint16_t last[256]; int16_t last[256];
memset(last, 0xFF, sizeof(last)); memset(last, 0xFF, sizeof(last));
uint8_t * const data = hse->buffer; uint8_t * const data = hse->buffer;
...@@ -459,7 +459,7 @@ static void do_indexing(heatshrink_encoder *hse) { ...@@ -459,7 +459,7 @@ static void do_indexing(heatshrink_encoder *hse) {
for (uint16_t i=0; i<end; i++) { for (uint16_t i=0; i<end; i++) {
uint8_t v = data[i]; uint8_t v = data[i];
uint16_t lv = last[v]; int16_t lv = last[v];
index[i] = lv; index[i] = lv;
last[v] = i; last[v] = i;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment