Skip to content

Commit d02adae

Browse files
committed
Fix type mismatch when TAMP_ESP32=1.
1 parent f397d88 commit d02adae

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tamp/_c_src/tamp/compressor.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,13 @@ static TAMP_NOINLINE tamp_res write_extended_match_token(TampCompressor* compres
368368
res = partial_flush(compressor, output, output_size, output_written_size);
369369
if (TAMP_UNLIKELY(res != TAMP_OK)) return res;
370370

371-
// Write to window (up to end of buffer, no wrap)
372-
uint16_t remaining = WINDOW_SIZE - compressor->window_pos;
371+
// Write to window (up to end of buffer, no wrap).
372+
// Local uint16_t matches tamp_window_copy signature; struct field may be uint32_t (TAMP_ESP32).
373+
uint16_t wp = compressor->window_pos;
374+
uint16_t remaining = WINDOW_SIZE - wp;
373375
uint8_t window_write = MIN(count, remaining);
374-
tamp_window_copy(compressor->window, &compressor->window_pos, position, window_write, window_mask);
376+
tamp_window_copy(compressor->window, &wp, position, window_write, window_mask);
377+
compressor->window_pos = wp;
375378

376379
compressor->extended_match_count = 0; // Position reset not needed - only read when count > 0
377380

0 commit comments

Comments
 (0)