Skip to content

Commit decf8e6

Browse files
projectgusdpgeorge
authored andcommitted
all: Remove the "STATIC" macro and just use "static" instead.
The STATIC macro was introduced a very long time ago in commit d5df6cd. The original reason for this was to have the option to define it to nothing so that all static functions become global functions and therefore visible to certain debug tools, so one could do function size comparison and other things. This STATIC feature is rarely (if ever) used. And with the use of LTO and heavy inline optimisation, analysing the size of individual functions when they are not static is not a good representation of the size of code when fully optimised. So the macro does not have much use and it's simpler to just remove it. Then you know exactly what it's doing. For example, newcomers don't have to learn what the STATIC macro is and why it exists. Reading the code is also less "loud" with a lowercase static. One other minor point in favour of removing it, is that it stops bugs with `STATIC inline`, which should always be `static inline`. Methodology for this commit was: 1) git ls-files | egrep '\.[ch]$' | \ xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/" 2) Do some manual cleanup in the diff by searching for the word STATIC in comments and changing those back. 3) "git-grep STATIC docs/", manually fixed those cases. 4) "rg -t python STATIC", manually fixed codegen lines that used STATIC. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent b3f2f18 commit decf8e6

File tree

482 files changed

+6288
-6294
lines changed

Some content is hidden

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

482 files changed

+6288
-6294
lines changed

docs/develop/compiler.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Then also edit ``py/lexer.c`` to add the new keyword literal text:
9898
.. code-block:: c
9999
:emphasize-lines: 12
100100
101-
STATIC const char *const tok_kw[] = {
101+
static const char *const tok_kw[] = {
102102
...
103103
"or",
104104
"pass",
@@ -301,7 +301,7 @@ code statement:
301301

302302
.. code-block:: c
303303
304-
STATIC void emit_native_unary_op(emit_t *emit, mp_unary_op_t op) {
304+
static void emit_native_unary_op(emit_t *emit, mp_unary_op_t op) {
305305
vtype_kind_t vtype;
306306
emit_pre_pop_reg(emit, &vtype, REG_ARG_2);
307307
if (vtype == VTYPE_PYOBJ) {

docs/develop/library.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ hypothetical new module ``subsystem`` in the file ``modsubsystem.c``:
4848
#if MICROPY_PY_SUBSYSTEM
4949
5050
// info()
51-
STATIC mp_obj_t py_subsystem_info(void) {
51+
static mp_obj_t py_subsystem_info(void) {
5252
return MP_OBJ_NEW_SMALL_INT(42);
5353
}
5454
MP_DEFINE_CONST_FUN_OBJ_0(subsystem_info_obj, py_subsystem_info);
5555
56-
STATIC const mp_rom_map_elem_t mp_module_subsystem_globals_table[] = {
56+
static const mp_rom_map_elem_t mp_module_subsystem_globals_table[] = {
5757
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_subsystem) },
5858
{ MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&subsystem_info_obj) },
5959
};
60-
STATIC MP_DEFINE_CONST_DICT(mp_module_subsystem_globals, mp_module_subsystem_globals_table);
60+
static MP_DEFINE_CONST_DICT(mp_module_subsystem_globals, mp_module_subsystem_globals_table);
6161
6262
const mp_obj_module_t mp_module_subsystem = {
6363
.base = { &mp_type_module },

docs/develop/natmod.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ The file ``factorial.c`` contains:
128128
#include "py/dynruntime.h"
129129
130130
// Helper function to compute factorial
131-
STATIC mp_int_t factorial_helper(mp_int_t x) {
131+
static mp_int_t factorial_helper(mp_int_t x) {
132132
if (x == 0) {
133133
return 1;
134134
}
135135
return x * factorial_helper(x - 1);
136136
}
137137
138138
// This is the function which will be called from Python, as factorial(x)
139-
STATIC mp_obj_t factorial(mp_obj_t x_obj) {
139+
static mp_obj_t factorial(mp_obj_t x_obj) {
140140
// Extract the integer from the MicroPython input object
141141
mp_int_t x = mp_obj_get_int(x_obj);
142142
// Calculate the factorial
@@ -145,7 +145,7 @@ The file ``factorial.c`` contains:
145145
return mp_obj_new_int(result);
146146
}
147147
// Define a Python reference to the function above
148-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(factorial_obj, factorial);
148+
static MP_DEFINE_CONST_FUN_OBJ_1(factorial_obj, factorial);
149149
150150
// This is the entry point and is called when the module is imported
151151
mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) {

docs/develop/porting.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,17 @@ To add a custom module like ``myport``, first add the module definition in a fil
262262
263263
#include "py/runtime.h"
264264
265-
STATIC mp_obj_t myport_info(void) {
265+
static mp_obj_t myport_info(void) {
266266
mp_printf(&mp_plat_print, "info about my port\n");
267267
return mp_const_none;
268268
}
269-
STATIC MP_DEFINE_CONST_FUN_OBJ_0(myport_info_obj, myport_info);
269+
static MP_DEFINE_CONST_FUN_OBJ_0(myport_info_obj, myport_info);
270270
271-
STATIC const mp_rom_map_elem_t myport_module_globals_table[] = {
271+
static const mp_rom_map_elem_t myport_module_globals_table[] = {
272272
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_myport) },
273273
{ MP_ROM_QSTR(MP_QSTR_info), MP_ROM_PTR(&myport_info_obj) },
274274
};
275-
STATIC MP_DEFINE_CONST_DICT(myport_module_globals, myport_module_globals_table);
275+
static MP_DEFINE_CONST_DICT(myport_module_globals, myport_module_globals_table);
276276
277277
const mp_obj_module_t myport_module = {
278278
.base = { &mp_type_module },

drivers/bus/softqspi.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949

5050
#endif
5151

52-
STATIC void nibble_write(mp_soft_qspi_obj_t *self, uint8_t v) {
52+
static void nibble_write(mp_soft_qspi_obj_t *self, uint8_t v) {
5353
mp_hal_pin_write(self->io0, v & 1);
5454
mp_hal_pin_write(self->io1, (v >> 1) & 1);
5555
mp_hal_pin_write(self->io2, (v >> 2) & 1);
5656
mp_hal_pin_write(self->io3, (v >> 3) & 1);
5757
}
5858

59-
STATIC int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) {
59+
static int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) {
6060
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in;
6161

6262
switch (cmd) {
@@ -80,7 +80,7 @@ STATIC int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) {
8080
return 0; // success
8181
}
8282

83-
STATIC void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *src, uint8_t *dest) {
83+
static void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *src, uint8_t *dest) {
8484
// Will run as fast as possible, limited only by CPU speed and GPIO time
8585
mp_hal_pin_input(self->io1);
8686
mp_hal_pin_output(self->io0);
@@ -119,7 +119,7 @@ STATIC void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const ui
119119
}
120120
}
121121

122-
STATIC void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *buf) {
122+
static void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *buf) {
123123
// Make all IO lines input
124124
mp_hal_pin_input(self->io2);
125125
mp_hal_pin_input(self->io3);
@@ -137,7 +137,7 @@ STATIC void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *bu
137137
}
138138
}
139139

140-
STATIC void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *buf) {
140+
static void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *buf) {
141141
// Make all IO lines output
142142
mp_hal_pin_output(self->io2);
143143
mp_hal_pin_output(self->io3);
@@ -158,7 +158,7 @@ STATIC void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint
158158
//mp_hal_pin_input(self->io1);
159159
}
160160

161-
STATIC int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t data) {
161+
static int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t data) {
162162
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in;
163163
uint32_t cmd_buf = cmd | data << 8;
164164
CS_LOW(self);
@@ -167,7 +167,7 @@ STATIC int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, u
167167
return 0;
168168
}
169169

170-
STATIC int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src) {
170+
static int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src) {
171171
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in;
172172
uint8_t cmd_buf[5] = {cmd};
173173
uint8_t addr_len = mp_spi_set_addr_buff(&cmd_buf[1], addr);
@@ -178,7 +178,7 @@ STATIC int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t
178178
return 0;
179179
}
180180

181-
STATIC int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_t *dest) {
181+
static int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_t *dest) {
182182
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in;
183183
uint32_t cmd_buf = cmd;
184184
CS_LOW(self);
@@ -188,7 +188,7 @@ STATIC int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_
188188
return 0;
189189
}
190190

191-
STATIC int mp_soft_qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr, size_t len, uint8_t *dest) {
191+
static int mp_soft_qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr, size_t len, uint8_t *dest) {
192192
mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in;
193193
uint8_t cmd_buf[7] = {cmd};
194194
uint8_t addr_len = mp_spi_set_addr_buff(&cmd_buf[1], addr);

drivers/cyw43/cywbt.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern uint8_t mp_bluetooth_hci_cmd_buf[4 + 256];
5151
// Provided by the port.
5252
extern machine_uart_obj_t mp_bluetooth_hci_uart_obj;
5353

54-
STATIC void cywbt_wait_cts_low(void) {
54+
static void cywbt_wait_cts_low(void) {
5555
mp_hal_pin_config(CYW43_PIN_BT_CTS, MP_HAL_PIN_MODE_INPUT, MP_HAL_PIN_PULL_UP, 0);
5656
for (int i = 0; i < 200; ++i) {
5757
if (mp_hal_pin_read(CYW43_PIN_BT_CTS) == 0) {
@@ -64,7 +64,7 @@ STATIC void cywbt_wait_cts_low(void) {
6464
}
6565
#endif
6666

67-
STATIC int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) {
67+
static int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) {
6868
mp_bluetooth_hci_uart_write((void *)buf, len);
6969
for (int c, i = 0; i < 6; ++i) {
7070
while ((c = mp_bluetooth_hci_uart_readchar()) == -1) {
@@ -96,7 +96,7 @@ STATIC int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) {
9696
return 0;
9797
}
9898

99-
STATIC int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *param_buf) {
99+
static int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *param_buf) {
100100
uint8_t *buf = mp_bluetooth_hci_cmd_buf;
101101
buf[0] = 0x01;
102102
buf[1] = ocf;
@@ -108,27 +108,27 @@ STATIC int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *para
108108
return cywbt_hci_cmd_raw(4 + param_len, buf);
109109
}
110110

111-
STATIC void put_le16(uint8_t *buf, uint16_t val) {
111+
static void put_le16(uint8_t *buf, uint16_t val) {
112112
buf[0] = val;
113113
buf[1] = val >> 8;
114114
}
115115

116-
STATIC void put_le32(uint8_t *buf, uint32_t val) {
116+
static void put_le32(uint8_t *buf, uint32_t val) {
117117
buf[0] = val;
118118
buf[1] = val >> 8;
119119
buf[2] = val >> 16;
120120
buf[3] = val >> 24;
121121
}
122122

123-
STATIC int cywbt_set_baudrate(uint32_t baudrate) {
123+
static int cywbt_set_baudrate(uint32_t baudrate) {
124124
uint8_t buf[6];
125125
put_le16(buf, 0);
126126
put_le32(buf + 2, baudrate);
127127
return cywbt_hci_cmd(0x3f, 0x18, 6, buf);
128128
}
129129

130130
// download firmware
131-
STATIC int cywbt_download_firmware(const uint8_t *firmware) {
131+
static int cywbt_download_firmware(const uint8_t *firmware) {
132132
cywbt_hci_cmd(0x3f, 0x2e, 0, NULL);
133133

134134
bool last_packet = false;
@@ -255,7 +255,7 @@ int mp_bluetooth_hci_controller_deinit(void) {
255255
}
256256

257257
#ifdef CYW43_PIN_BT_DEV_WAKE
258-
STATIC uint32_t bt_sleep_ticks;
258+
static uint32_t bt_sleep_ticks;
259259
#endif
260260

261261
int mp_bluetooth_hci_controller_sleep_maybe(void) {

drivers/dht/dht.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#define mp_hal_pin_od_high_dht mp_hal_pin_od_high
4141
#endif
4242

43-
STATIC mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) {
43+
static mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) {
4444
mp_hal_pin_obj_t pin = mp_hal_get_pin_obj(pin_in);
4545
mp_hal_pin_open_drain(pin);
4646

drivers/esp-hosted/esp_hosted_hal.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444

4545
extern void mod_network_poll_events(void);
4646

47-
STATIC mp_obj_t esp_hosted_pin_irq_callback(mp_obj_t self_in) {
47+
static mp_obj_t esp_hosted_pin_irq_callback(mp_obj_t self_in) {
4848
#ifdef MICROPY_HW_WIFI_LED
4949
led_toggle(MICROPY_HW_WIFI_LED);
5050
#endif
5151
mod_network_poll_events();
5252
return mp_const_none;
5353
}
54-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_hosted_pin_irq_callback_obj, esp_hosted_pin_irq_callback);
54+
static MP_DEFINE_CONST_FUN_OBJ_1(esp_hosted_pin_irq_callback_obj, esp_hosted_pin_irq_callback);
5555

5656
MP_WEAK int esp_hosted_hal_init(uint32_t mode) {
5757
// Perform a hard reset and set pins to their defaults.

drivers/memory/spiflash.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@
5656
#define PAGE_SIZE (256) // maximum bytes we can write in one SPI transfer
5757
#define SECTOR_SIZE MP_SPIFLASH_ERASE_BLOCK_SIZE
5858

59-
STATIC void mp_spiflash_acquire_bus(mp_spiflash_t *self) {
59+
static void mp_spiflash_acquire_bus(mp_spiflash_t *self) {
6060
const mp_spiflash_config_t *c = self->config;
6161
if (c->bus_kind == MP_SPIFLASH_BUS_QSPI) {
6262
c->bus.u_qspi.proto->ioctl(c->bus.u_qspi.data, MP_QSPI_IOCTL_BUS_ACQUIRE);
6363
}
6464
}
6565

66-
STATIC void mp_spiflash_release_bus(mp_spiflash_t *self) {
66+
static void mp_spiflash_release_bus(mp_spiflash_t *self) {
6767
const mp_spiflash_config_t *c = self->config;
6868
if (c->bus_kind == MP_SPIFLASH_BUS_QSPI) {
6969
c->bus.u_qspi.proto->ioctl(c->bus.u_qspi.data, MP_QSPI_IOCTL_BUS_RELEASE);
7070
}
7171
}
7272

73-
STATIC int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t data) {
73+
static int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t data) {
7474
int ret = 0;
7575
const mp_spiflash_config_t *c = self->config;
7676
if (c->bus_kind == MP_SPIFLASH_BUS_SPI) {
@@ -84,7 +84,7 @@ STATIC int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t l
8484
return ret;
8585
}
8686

87-
STATIC int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src, uint8_t *dest) {
87+
static int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src, uint8_t *dest) {
8888
int ret = 0;
8989
const mp_spiflash_config_t *c = self->config;
9090
if (c->bus_kind == MP_SPIFLASH_BUS_SPI) {
@@ -109,7 +109,7 @@ STATIC int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd,
109109
return ret;
110110
}
111111

112-
STATIC int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t *dest) {
112+
static int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t *dest) {
113113
const mp_spiflash_config_t *c = self->config;
114114
if (c->bus_kind == MP_SPIFLASH_BUS_SPI) {
115115
mp_hal_pin_write(c->bus.u_spi.cs, 0);
@@ -122,7 +122,7 @@ STATIC int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, ui
122122
}
123123
}
124124

125-
STATIC int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len, uint8_t *dest) {
125+
static int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len, uint8_t *dest) {
126126
const mp_spiflash_config_t *c = self->config;
127127
uint8_t cmd;
128128
if (c->bus_kind == MP_SPIFLASH_BUS_SPI) {
@@ -133,11 +133,11 @@ STATIC int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len,
133133
return mp_spiflash_transfer_cmd_addr_data(self, cmd, addr, len, NULL, dest);
134134
}
135135

136-
STATIC int mp_spiflash_write_cmd(mp_spiflash_t *self, uint8_t cmd) {
136+
static int mp_spiflash_write_cmd(mp_spiflash_t *self, uint8_t cmd) {
137137
return mp_spiflash_write_cmd_data(self, cmd, 0, 0);
138138
}
139139

140-
STATIC int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, uint32_t timeout) {
140+
static int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, uint32_t timeout) {
141141
do {
142142
uint32_t sr;
143143
int ret = mp_spiflash_read_cmd(self, CMD_RDSR, 1, &sr);
@@ -152,11 +152,11 @@ STATIC int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, u
152152
return -MP_ETIMEDOUT;
153153
}
154154

155-
STATIC int mp_spiflash_wait_wel1(mp_spiflash_t *self) {
155+
static int mp_spiflash_wait_wel1(mp_spiflash_t *self) {
156156
return mp_spiflash_wait_sr(self, 2, 2, WAIT_SR_TIMEOUT);
157157
}
158158

159-
STATIC int mp_spiflash_wait_wip0(mp_spiflash_t *self) {
159+
static int mp_spiflash_wait_wip0(mp_spiflash_t *self) {
160160
return mp_spiflash_wait_sr(self, 1, 0, WAIT_SR_TIMEOUT);
161161
}
162162

@@ -219,7 +219,7 @@ void mp_spiflash_deepsleep(mp_spiflash_t *self, int value) {
219219
}
220220
}
221221

222-
STATIC int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr) {
222+
static int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr) {
223223
int ret = 0;
224224
// enable writes
225225
ret = mp_spiflash_write_cmd(self, CMD_WREN);
@@ -244,7 +244,7 @@ STATIC int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr)
244244
return mp_spiflash_wait_wip0(self);
245245
}
246246

247-
STATIC int mp_spiflash_write_page(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) {
247+
static int mp_spiflash_write_page(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) {
248248
int ret = 0;
249249
// enable writes
250250
ret = mp_spiflash_write_cmd(self, CMD_WREN);
@@ -361,7 +361,7 @@ int mp_spiflash_cached_read(mp_spiflash_t *self, uint32_t addr, size_t len, uint
361361
return ret;
362362
}
363363

364-
STATIC int mp_spiflash_cache_flush_internal(mp_spiflash_t *self) {
364+
static int mp_spiflash_cache_flush_internal(mp_spiflash_t *self) {
365365
#if USE_WR_DELAY
366366
if (!(self->flags & 1)) {
367367
return 0;
@@ -396,7 +396,7 @@ int mp_spiflash_cache_flush(mp_spiflash_t *self) {
396396
return ret;
397397
}
398398

399-
STATIC int mp_spiflash_cached_write_part(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) {
399+
static int mp_spiflash_cached_write_part(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) {
400400
// Align to 4096 sector
401401
uint32_t offset = addr & 0xfff;
402402
uint32_t sec = addr >> 12;

examples/natmod/btree/btree_c.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ mp_getiter_iternext_custom_t btree_getiter_iternext;
100100
#include "extmod/modbtree.c"
101101

102102
mp_map_elem_t btree_locals_dict_table[8];
103-
STATIC MP_DEFINE_CONST_DICT(btree_locals_dict, btree_locals_dict_table);
103+
static MP_DEFINE_CONST_DICT(btree_locals_dict, btree_locals_dict_table);
104104

105-
STATIC mp_obj_t btree_open(size_t n_args, const mp_obj_t *args) {
105+
static mp_obj_t btree_open(size_t n_args, const mp_obj_t *args) {
106106
// Make sure we got a stream object
107107
mp_get_stream_raise(args[0], MP_STREAM_OP_READ | MP_STREAM_OP_WRITE | MP_STREAM_OP_IOCTL);
108108

@@ -118,7 +118,7 @@ STATIC mp_obj_t btree_open(size_t n_args, const mp_obj_t *args) {
118118

119119
return MP_OBJ_FROM_PTR(btree_new(db, args[0]));
120120
}
121-
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(btree_open_obj, 5, 5, btree_open);
121+
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(btree_open_obj, 5, 5, btree_open);
122122

123123
mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) {
124124
MP_DYNRUNTIME_INIT_ENTRY

0 commit comments

Comments
 (0)