mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py/obj: Add "full" and "empty" non-variable-length mp_obj_type_t.
This will always have the maximum/minimum size of a mp_obj_type_t representation and can be used as a member in other structs. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
5ddf671944
commit
e8355eb163
@@ -36,7 +36,8 @@
|
||||
DEFINE TYPES
|
||||
******************************************************************************/
|
||||
typedef struct _mod_network_nic_type_t {
|
||||
mp_obj_type_t base;
|
||||
// Ensure that this struct is big enough to hold any type size.
|
||||
mp_obj_full_type_t base;
|
||||
} mod_network_nic_type_t;
|
||||
|
||||
typedef struct _mod_network_socket_base_t {
|
||||
|
||||
@@ -1285,7 +1285,7 @@ STATIC const mp_rom_map_elem_t wlan_locals_dict_table[] = {
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(wlan_locals_dict, wlan_locals_dict_table);
|
||||
|
||||
STATIC MP_DEFINE_CONST_OBJ_TYPE(
|
||||
STATIC MP_DEFINE_CONST_OBJ_FULL_TYPE(
|
||||
mod_network_nic_type_wlan_base,
|
||||
MP_QSTR_WLAN,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
|
||||
Reference in New Issue
Block a user