aboutsummaryrefslogtreecommitdiff
path: root/extmod/moductypes.c
diff options
context:
space:
mode:
authorEmil Renner Berthing2019-11-28 12:47:21 +0100
committerEmil Renner Berthing2020-10-22 11:53:16 +0200
commitccd92335a11f03597f94da2ac937811ff3fa50cf (patch)
tree2a31448c25724edf2ff5213b1cc1b52dd5ff0f82 /extmod/moductypes.c
parentdde3db21fcd8d810bb59e0c56dfa5fd9208e1544 (diff)
py, extmod: Introduce and use MP_FALLTHROUGH macro.
Newer GCC versions are able to warn about switch cases that fall through. This is usually a sign of a forgotten break statement, but in the few cases where a fall through is intended we annotate it with this macro to avoid the warning.
Diffstat (limited to 'extmod/moductypes.c')
-rw-r--r--extmod/moductypes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
index 811258424..c5fbf12e4 100644
--- a/extmod/moductypes.c
+++ b/extmod/moductypes.c
@@ -506,6 +506,7 @@ STATIC mp_obj_t uctypes_struct_attr_op(mp_obj_t self_in, qstr attr, mp_obj_t set
return mp_obj_new_bytearray_by_ref(uctypes_struct_agg_size(sub, self->flags, &dummy), self->addr + offset);
}
// Fall thru to return uctypes struct object
+ MP_FALLTHROUGH
}
case PTR: {
mp_obj_uctypes_struct_t *o = m_new_obj(mp_obj_uctypes_struct_t);
@@ -627,7 +628,7 @@ STATIC mp_obj_t uctypes_struct_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
return mp_obj_new_int((mp_int_t)(uintptr_t)p);
}
}
- /* fallthru */
+ MP_FALLTHROUGH
default:
return MP_OBJ_NULL; // op not supported