Skip to content

Commit d41ed4a

Browse files
committed
Replace mp_obj_full_type_t with mp_obj_type_t
1 parent 100833d commit d41ed4a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

gen/gen_mpy.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -710,14 +710,14 @@ def register_int_ptr_type(convertor, *types):
710710
#define LV_OBJ_T {obj_type}
711711
712712
typedef struct mp_lv_obj_type_t {{
713-
mp_obj_full_type_t mp_obj_type;
714713
const lv_obj_class_t *lv_obj_class;
714+
mp_obj_type_t mp_obj_type;
715715
}} mp_lv_obj_type_t;
716716
717717
STATIC const mp_lv_obj_type_t mp_lv_{base_obj}_type;
718718
STATIC const mp_lv_obj_type_t *mp_lv_obj_types[];
719719
720-
STATIC inline const mp_obj_full_type_t *get_BaseObj_type()
720+
STATIC inline const mp_obj_type_t *get_BaseObj_type()
721721
{{
722722
return &mp_lv_{base_obj}_type.mp_obj_type;
723723
}}
@@ -745,8 +745,6 @@ def register_int_ptr_type(convertor, *types):
745745
#endif // __GNUC__
746746
#endif // GENMPY_UNUSED
747747
748-
#define MP_DEFINE_CONST_OBJ_FULL_TYPE(...) MP_DEFINE_CONST_OBJ_TYPE_EXPAND(MP_DEFINE_CONST_OBJ_TYPE_NARGS(__VA_ARGS__, _INV, 12, _INV, 11, _INV, 10, _INV, 9, _INV, 8, _INV, 7, _INV, 6, _INV, 5, _INV, 4, _INV, 3, _INV, 2, _INV, 1, _INV, 0)(mp_obj_full_type_t, __VA_ARGS__))
749-
750748
// Custom function mp object
751749
752750
typedef mp_obj_t (*mp_fun_ptr_var_t)(size_t n, const mp_obj_t *, void *ptr);
@@ -908,7 +906,7 @@ def register_int_ptr_type(convertor, *types):
908906
return mp_lv_obj->callbacks;
909907
}
910908
911-
STATIC inline const mp_obj_full_type_t *get_BaseObj_type();
909+
STATIC inline const mp_obj_type_t *get_BaseObj_type();
912910
913911
STATIC void mp_lv_delete_cb(lv_event_t * e)
914912
{
@@ -928,7 +926,7 @@ def register_int_ptr_type(convertor, *types):
928926
if (!self)
929927
{
930928
// Find the object type
931-
const mp_obj_full_type_t *mp_obj_type = get_BaseObj_type();
929+
const mp_obj_type_t *mp_obj_type = get_BaseObj_type();
932930
const lv_obj_class_t *lv_obj_class = lv_obj_get_class(lv_obj);
933931
const mp_lv_obj_type_t **iter = &mp_lv_obj_types[0];
934932
for (; *iter; iter++) {
@@ -1539,7 +1537,7 @@ def register_int_ptr_type(convertor, *types):
15391537
15401538
STATIC MP_DEFINE_CONST_DICT(mp_base_struct_locals_dict, mp_base_struct_locals_dict_table);
15411539
1542-
MP_DEFINE_CONST_OBJ_TYPE(
1540+
STATIC MP_DEFINE_CONST_OBJ_TYPE(
15431541
mp_lv_base_struct_type,
15441542
MP_QSTR_Struct,
15451543
MP_TYPE_FLAG_NONE,
@@ -1550,7 +1548,7 @@ def register_int_ptr_type(convertor, *types):
15501548
);
15511549
15521550
// TODO: provide constructor
1553-
MP_DEFINE_CONST_OBJ_TYPE(
1551+
STATIC MP_DEFINE_CONST_OBJ_TYPE(
15541552
mp_lv_array_type,
15551553
MP_QSTR_C_Array,
15561554
MP_TYPE_FLAG_NONE,
@@ -2622,7 +2620,7 @@ def gen_obj(obj_name):
26222620
26232621
{ctor}
26242622
2625-
STATIC MP_DEFINE_CONST_OBJ_FULL_TYPE(
2623+
STATIC MP_DEFINE_CONST_OBJ_TYPE(
26262624
mp_lv_{obj}_type_base,
26272625
MP_QSTR_{obj},
26282626
MP_TYPE_FLAG_NONE,
@@ -2636,10 +2634,10 @@ def gen_obj(obj_name):
26362634
);
26372635
26382636
STATIC const mp_lv_obj_type_t mp_lv_{obj}_type = {{
2639-
.mp_obj_type = mp_lv_{obj}_type_base,
26402637
#ifdef LV_OBJ_T
2641-
.lv_obj_class = {lv_class}
2638+
.lv_obj_class = {lv_class},
26422639
#endif
2640+
.mp_obj_type = mp_lv_{obj}_type_base,
26432641
}};
26442642
""".format(
26452643
module_name = module_name,

0 commit comments

Comments
 (0)