Skip to content

Commit 55874b6

Browse files
committed
Rename compressed_string_t to mp_rom_error_text_t to match upstream
1 parent 702b4a5 commit 55874b6

File tree

29 files changed

+100
-111
lines changed

29 files changed

+100
-111
lines changed

devices/ble_hci/common-hal/_bleio/att.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
17221722

17231723
// FIX Do we need all of these?
17241724
static void check_att_err(uint8_t err) {
1725-
const compressed_string_t *msg = NULL;
1725+
const mp_rom_error_text_t *msg = NULL;
17261726
switch (err) {
17271727
case 0:
17281728
return;

ports/espressif/common-hal/espidf/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ intptr_t common_hal_espidf_get_psram_end(void) {
122122
}
123123

124124
void raise_esp_error(esp_err_t err) {
125-
const compressed_string_t *msg = NULL;
125+
const mp_rom_error_text_t *msg = NULL;
126126
const mp_obj_type_t *exception_type = &mp_type_espidf_IDFError;
127127
switch (err) {
128128
case ESP_FAIL:

ports/espressif/common-hal/wifi/Monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void wifi_monitor_cb(void *recv_buf, wifi_promiscuous_pkt_type_t type) {
7878
}
7979

8080
void common_hal_wifi_monitor_construct(wifi_monitor_obj_t *self, uint8_t channel, size_t queue) {
81-
const compressed_string_t *monitor_mode_init_error = translate("monitor init failed");
81+
const mp_rom_error_text_t *monitor_mode_init_error = translate("monitor init failed");
8282

8383
self->queue = xQueueCreate(queue, sizeof(monitor_packet_t));
8484
if (!self->queue) {

py/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ STATIC void compile_error_set_line(compiler_t *comp, mp_parse_node_t pn) {
255255
}
256256
}
257257

258-
STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, const compressed_string_t *msg) {
258+
STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, const mp_rom_error_text_t *msg) {
259259
// only register the error if there has been no other error
260260
if (comp->compile_error == MP_OBJ_NULL) {
261261
comp->compile_error = mp_obj_new_exception_msg(&mp_type_SyntaxError, msg);

py/emitinlinethumb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static inline bool emit_inline_thumb_allow_float(emit_inline_asm_t *emit) {
7575
#endif
7676

7777
// CIRCUITPY-CHANGE
78-
STATIC void emit_inline_thumb_error_msg(emit_inline_asm_t *emit, const compressed_string_t *msg) {
78+
STATIC void emit_inline_thumb_error_msg(emit_inline_asm_t *emit, const mp_rom_error_text_t *msg) {
7979
*emit->error_slot = mp_obj_new_exception_msg(&mp_type_SyntaxError, msg);
8080
}
8181

py/emitinlinextensa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct _emit_inline_asm_t {
4444
};
4545

4646
// CIRCUITPY-CHANGE
47-
STATIC void emit_inline_xtensa_error_msg(emit_inline_asm_t *emit, const compressed_string_t *msg) {
47+
STATIC void emit_inline_xtensa_error_msg(emit_inline_asm_t *emit, const mp_rom_error_text_t *msg) {
4848
*emit->error_slot = mp_obj_new_exception_msg(&mp_type_SyntaxError, msg);
4949
}
5050

py/maketranslationdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def output_translation_data(encoding_table, i18ns, out):
595595
decompressed = decompressed.replace(c, C_ESCAPES[c])
596596
formatted = ["{:d}".format(x) for x in compressed]
597597
out.write(
598-
"const compressed_string_t translation{} = {{ .data = {}, .tail = {{ {} }} }}; // {}\n".format(
598+
"const mp_rom_error_text_t translation{} = {{ .data = {}, .tail = {{ {} }} }}; // {}\n".format(
599599
i, formatted[0], ", ".join(formatted[1:]), original, decompressed
600600
)
601601
)

py/misc.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,22 +330,15 @@ inline MP_ALWAYSINLINE const char *MP_COMPRESSED_ROM_TEXT(const char *msg) {
330330

331331
#endif
332332

333+
#elif CIRCUITPY
334+
#include "supervisor/shared/translate/translate.h"
333335
#else
334336

335337
// Compression not enabled, just make it a no-op.
336338

337339
typedef const char *mp_rom_error_text_t;
338340
#define MP_COMPRESSED_ROM_TEXT(x) x
339341

340-
#endif // MICROPY_ROM_TEXT_COMPRESSION
341-
342-
// Might add more types of compressed text in the future.
343-
// For now, forward directly to MP_COMPRESSED_ROM_TEXT.
344-
// CIRCUITPY-CHANGE: MP_ERROR_TEXT() -> translate()
345-
#if CIRCUITPY
346-
#include "supervisor/shared/translate/translate.h"
347-
#else
348-
#define MP_ERROR_TEXT(x) (mp_rom_error_text_t)MP_COMPRESSED_ROM_TEXT(x)
349-
#endif
342+
#endif // MICROPY_ROM_TEXT_COMPRESSION // CIRCUITPY
350343

351344
#endif // MICROPY_INCLUDED_PY_MISC_H

py/moderrno.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) {
127127
return NULL;
128128
}
129129

130-
const compressed_string_t *desc = NULL;
130+
const mp_rom_error_text_t *desc = NULL;
131131
switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) {
132132
case EPERM:
133133
desc = MP_ERROR_TEXT("Operation not permitted");

py/mpprint.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
496496
break;
497497
}
498498
case 'S': {
499-
compressed_string_t *arg = va_arg(args, compressed_string_t *);
499+
mp_rom_error_text_t *arg = va_arg(args, mp_rom_error_text_t *);
500500
size_t len_with_nul = decompress_length(arg);
501501
size_t len = len_with_nul - 1;
502502
char str[len_with_nul];
@@ -593,15 +593,15 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
593593
return chrs;
594594
}
595595

596-
int mp_cprintf(const mp_print_t *print, const compressed_string_t *compressed_fmt, ...) {
596+
int mp_cprintf(const mp_print_t *print, const mp_rom_error_text_t *compressed_fmt, ...) {
597597
va_list ap;
598598
va_start(ap, compressed_fmt);
599599
int ret = mp_vcprintf(print, compressed_fmt, ap);
600600
va_end(ap);
601601
return ret;
602602
}
603603

604-
int mp_vcprintf(const mp_print_t *print, const compressed_string_t *compressed_fmt, va_list args) {
604+
int mp_vcprintf(const mp_print_t *print, const mp_rom_error_text_t *compressed_fmt, va_list args) {
605605
char fmt[decompress_length(compressed_fmt)];
606606
// TODO: Optimise this to format-while-decompressing (and not require the temp stack space).
607607
decompress(compressed_fmt, fmt);

0 commit comments

Comments
 (0)