Skip to content

Commit f47e214

Browse files
agattidpgeorge
authored andcommitted
all: Rename the "NORETURN" macro to "MP_NORETURN".
This commit renames the NORETURN macro, indicating to the compiler that a function does not return, into MP_NORETURN to maintain the same naming convention of other similar macros. To maintain compaitiblity with existing code NORETURN is aliased to MP_NORETURN, but it is also deprecated for MicroPython v2. This changeset was created using a similar process to decf8e6 ("all: Remove the "STATIC" macro and just use "static" instead."), with no documentation or python scripts to change to reflect the new macro name. Signed-off-by: Alessandro Gatti <[email protected]>
1 parent 69993da commit f47e214

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+159
-155
lines changed

extmod/modmachine.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
static void mp_machine_idle(void);
4646

4747
#if MICROPY_PY_MACHINE_BOOTLOADER
48-
NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args);
48+
MP_NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args);
4949
#endif
5050

5151
#if MICROPY_PY_MACHINE_RESET
52-
NORETURN static void mp_machine_reset(void);
52+
MP_NORETURN static void mp_machine_reset(void);
5353
static mp_int_t mp_machine_reset_cause(void);
5454
#endif
5555

@@ -58,7 +58,7 @@ static mp_obj_t mp_machine_unique_id(void);
5858
static mp_obj_t mp_machine_get_freq(void);
5959
static void mp_machine_set_freq(size_t n_args, const mp_obj_t *args);
6060
static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args);
61-
NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args);
61+
MP_NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args);
6262
#endif
6363

6464
// The port can provide additional machine-module implementation in this file.
@@ -67,7 +67,7 @@ NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args);
6767
#endif
6868

6969
#if MICROPY_PY_MACHINE_BOOTLOADER
70-
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args) {
70+
MP_NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args) {
7171
mp_machine_bootloader(n_args, args);
7272
}
7373
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_bootloader_obj, 0, 1, machine_bootloader);
@@ -81,7 +81,7 @@ static MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);
8181

8282
#if MICROPY_PY_MACHINE_RESET
8383

84-
NORETURN static mp_obj_t machine_reset(void) {
84+
MP_NORETURN static mp_obj_t machine_reset(void) {
8585
mp_machine_reset();
8686
}
8787
MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_obj, machine_reset);
@@ -116,7 +116,7 @@ static mp_obj_t machine_lightsleep(size_t n_args, const mp_obj_t *args) {
116116
}
117117
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lightsleep_obj, 0, 1, machine_lightsleep);
118118

119-
NORETURN static mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *args) {
119+
MP_NORETURN static mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *args) {
120120
mp_machine_deepsleep(n_args, args);
121121
}
122122
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_deepsleep_obj, 0, 1, machine_deepsleep);

extmod/modmachine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align);
242242
uintptr_t MICROPY_MACHINE_MEM_GET_WRITE_ADDR(mp_obj_t addr_o, uint align);
243243
#endif
244244

245-
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args);
245+
MP_NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args);
246246
void machine_bitstream_high_low(mp_hal_pin_obj_t pin, uint32_t *timing_ns, const uint8_t *buf, size_t len);
247247
mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us);
248248

extmod/modtls_axtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static const char *const ssl_error_tab2[] = {
105105
"NOT_SUPPORTED",
106106
};
107107

108-
static NORETURN void ssl_raise_error(int err) {
108+
static MP_NORETURN void ssl_raise_error(int err) {
109109
MP_STATIC_ASSERT(SSL_NOT_OK - 3 == SSL_EAGAIN);
110110
MP_STATIC_ASSERT(SSL_ERROR_CONN_LOST - 18 == SSL_ERROR_NOT_SUPPORTED);
111111

extmod/modtls_mbedtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static const unsigned char *asn1_get_data(mp_obj_t obj, size_t *out_len) {
147147
return (const unsigned char *)str;
148148
}
149149

150-
static NORETURN void mbedtls_raise_error(int err) {
150+
static MP_NORETURN void mbedtls_raise_error(int err) {
151151
// Handle special cases.
152152
if (err == MBEDTLS_ERR_SSL_ALLOC_FAILED) {
153153
mp_raise_OSError(MP_ENOMEM);

extmod/moductypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ typedef struct _mp_obj_uctypes_struct_t {
8989
uint32_t flags;
9090
} mp_obj_uctypes_struct_t;
9191

92-
static NORETURN void syntax_error(void) {
92+
static MP_NORETURN void syntax_error(void) {
9393
mp_raise_TypeError(MP_ERROR_TEXT("syntax error in uctypes descriptor"));
9494
}
9595

mpy-cross/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ typedef long mp_off_t;
137137
#ifdef _MSC_VER
138138

139139
#define MP_ENDIANNESS_LITTLE (1)
140-
#define NORETURN __declspec(noreturn)
140+
#define MP_NORETURN __declspec(noreturn)
141141
#define MP_NOINLINE __declspec(noinline)
142142
#define MP_ALWAYSINLINE __forceinline
143143
#define MP_LIKELY(x) (x)

ports/alif/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
extern uint8_t __StackTop, __StackLimit;
5757
extern uint8_t __GcHeapStart, __GcHeapEnd;
5858

59-
NORETURN void panic(const char *msg) {
59+
MP_NORETURN void panic(const char *msg) {
6060
mp_hal_stdout_tx_strn("\nFATAL ERROR:\n", 14);
6161
mp_hal_stdout_tx_strn(msg, strlen(msg));
6262
for (;;) {

ports/alif/modmachine.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static mp_obj_t mp_machine_unique_id(void) {
4747
return mp_obj_new_bytes(id, sizeof(id));
4848
}
4949

50-
NORETURN static void mp_machine_reset(void) {
50+
MP_NORETURN static void mp_machine_reset(void) {
5151
se_services_reset_soc();
5252
}
5353

54-
NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args) {
54+
MP_NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args) {
5555
__disable_irq();
5656

5757
MICROPY_BOARD_ENTER_BOOTLOADER(n_args, args);
@@ -112,7 +112,7 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
112112
#endif
113113
}
114114

115-
NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args) {
115+
MP_NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args) {
116116
#if MICROPY_HW_ENABLE_USBDEV
117117
mp_machine_enable_usb(false);
118118
#endif

ports/cc3200/misc/mperror.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void mperror_heartbeat_signal (void) {
159159
}
160160
}
161161

162-
void NORETURN __fatal_error(const char *msg) {
162+
void MP_NORETURN __fatal_error(const char *msg) {
163163
#ifdef DEBUG
164164
if (msg != NULL) {
165165
// wait for 20ms

ports/cc3200/misc/mperror.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#ifndef MICROPY_INCLUDED_CC3200_MISC_MPERROR_H
2828
#define MICROPY_INCLUDED_CC3200_MISC_MPERROR_H
2929

30-
extern void NORETURN __fatal_error(const char *msg);
30+
extern void MP_NORETURN __fatal_error(const char *msg);
3131

3232
void mperror_init0 (void);
3333
void mperror_bootloader_check_reset_cause (void);

0 commit comments

Comments
 (0)