8000 py,extmod,stmhal: Use "static inline" for funcs that should be inline. · lable/micropython@0f12082 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f12082

Browse files
committed
py,extmod,stmhal: Use "static inline" for funcs that should be inline.
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and this case can lead to link errors.
1 parent ee04525 commit 0f12082

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

extmod/moductypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ STATIC mp_obj_t uctypes_struct_sizeof(mp_obj_t obj_in) {
281281
}
282282
STATIC MP_DEFINE_CONST_FUN_OBJ_1(uctypes_struct_sizeof_obj, uctypes_struct_sizeof);
283283

284-
STATIC inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
284+
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
285285
char struct_type = big_endian ? '>' : '<';
286286
static const char type2char[16] = "BbHhIiQq------fd";
287287
return mp_binary_get_val(struct_type, type2char[val_type], &p);
288288
}
289289

290-
STATIC inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
290+
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
291291
char struct_type = big_endian ? '>' : '<';
292292
static const char type2char[16] = "BbHhIiQq------fd";
293293
mp_binary_set_val(struct_type, type2char[val_type], val, &p);

py/modbuiltins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ STATIC mp_obj_t mp_builtin_sorted(size_t n_args, const mp_obj_t *args, mp_map_t
540540
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj, 1, mp_builtin_sorted);
541541

542542
// See mp_load_attr() if making any changes
543-
STATIC inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) {
543+
static inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp_obj_t defval) {
544544
mp_obj_t dest[2];
545545
// use load_method, raising or not raising exception
546546
((defval == MP_OBJ_NULL) ? mp_load_method : mp_load_method_maybe)(base, attr, dest);

stmhal/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ STATIC HAL_StatusTypeDef i2c_wait_dma_finished(I2C_HandleTypeDef *i2c, uint32_t
513513
/******************************************************************************/
514514
/* MicroPython bindings */
515515

516-
STATIC inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; }
516+
static inline bool in_master_mode(pyb_i2c_obj_t *self) { return self->i2c->Init.OwnAddress1 == PYB_I2C_MASTER_ADDRESS; }
517517

518518
STATIC void pyb_i2c_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
519519
pyb_i2c_obj_t *self = self_in;

0 commit comments

Comments
 (0)
0