translate: Can't use compress_max_length_bits during qstr generation

This commit is contained in:
Jeff Epler 2022-02-17 08:38:02 -06:00
parent 2b32dce256
commit 1309ef083b
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 2 additions and 0 deletions

View File

@ -87,11 +87,13 @@ STATIC int put_utf8(char *buf, int u) {
} }
uint16_t decompress_length(const compressed_string_t *compressed) { uint16_t decompress_length(const compressed_string_t *compressed) {
#ifndef NO_QSTR
#if (compress_max_length_bits <= 8) #if (compress_max_length_bits <= 8)
return 1 + (compressed->data >> (8 - compress_max_length_bits)); return 1 + (compressed->data >> (8 - compress_max_length_bits));
#else #else
return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits)); return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
#endif #endif
#endif
} }
char *decompress(const compressed_string_t *compressed, char *decompressed) { char *decompress(const compressed_string_t *compressed, char *decompressed) {