8000 updated all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE · peterzuger/bitstruct-micropython@ef3268c · GitHub
[go: up one dir, main page]

Skip to content

Commit ef3268c

Browse files
committed
updated all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE
for micropython/micropython#8813
1 parent 19038cf commit ef3268c

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

bitstruct/bitstruct.c

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,33 +1185,23 @@ STATIC const mp_rom_map_elem_t bitstruct_CompiledFormatDict_locals_dict_table[]
11851185
};
11861186
STATIC MP_DEFINE_CONST_DICT(bitstruct_CompiledFormatDict_locals_dict,bitstruct_CompiledFormatDict_locals_dict_table);
11871187

1188+
MP_DEFINE_CONST_OBJ_TYPE(
1189+
bitstruct_CompiledFormat_type,
1190+
MP_QSTR_CompiledFormat,
1191+
MP_TYPE_FLAG_NONE,
1192+
print, bitstruct_CompiledFormat_print,
1193+
make_new, bitstruct_CompiledFormat_make_new,
1194+
locals_dict, &bitstruct_CompiledFormat_locals_dict
1195+
);
11881196

1189-
const mp_obj_type_t bitstruct_CompiledFormat_type = {
1190-
// "inherit" the type "type"
1191-
{ &mp_type_type },
1192-
// give it a name
1193-
.name = MP_QSTR_CompiledFormat,
1194-
// give it a print-function
1195-
.print = bitstruct_CompiledFormat_print,
1196-
// give it a constructor
1197-
.make_new = bitstruct_CompiledFormat_make_new,
1198-
// and the global members
1199-
.locals_dict = (mp_obj_dict_t*)&bitstruct_CompiledFormat_locals_dict,
1200-
};
1201-
1202-
1203-
const mp_obj_type_t bitstruct_CompiledFormatDict_type = {
1204-
// "inherit" the type "type"
1205-
{ &mp_type_type },
1206-
// give it a name
1207-
.name = MP_QSTR_CompiledFormatDict,
1208-
// give it a print-function
1209-
.print = bitstruct_CompiledFormatDict_print,
1210-
// give it a constructor
1211-
.make_new = bitstruct_CompiledFormatDict_make_new,
1212-
// and the global members
1213-
.locals_dict = (mp_obj_dict_t*)&bitstruct_CompiledFormatDict_locals_dict,
1214-
};
1197+
MP_DEFINE_CONST_OBJ_TYPE(
1198+
bitstruct_CompiledFormatDict_type,
1199+
MP_QSTR_CompiledFormatDict,
1200+
MP_TYPE_FLAG_NONE,
1201+
print, bitstruct_CompiledFormatDict_print,
1202+
make_new, bitstruct_CompiledFormatDict_make_new,
1203+
locals_dict, &bitstruct_CompiledFormatDict_locals_dict
1204+
);
12151205

12161206
/**
12171207
* Python: bitstruct.CompiledFormat(fmt)

0 commit comments

Comments
 (0)
0