diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-05 22:34:09 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-05 22:34:09 +0200 |
commit | 860ffb0a4365bba62cbd692392375df9fd4a72e7 (patch) | |
tree | 6af9fda7e920151975b6681608ddaae4e0c039c1 /py/objlist.c | |
parent | 12e2656472bf53e467c066eda6f3e177a97210ca (diff) | |
download | micropython-860ffb0a4365bba62cbd692392375df9fd4a72e7.tar.gz micropython-860ffb0a4365bba62cbd692392375df9fd4a72e7.zip |
Convert many object types structs to use C99 tagged initializer syntax.
Diffstat (limited to 'py/objlist.c')
-rw-r--r-- | py/objlist.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/py/objlist.c b/py/objlist.c index 6c0de405fe..a656a4aeb6 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -208,14 +208,12 @@ static MP_DEFINE_CONST_FUN_OBJ_2(list_sort_obj, list_sort); const mp_obj_type_t list_type = { { &mp_const_type }, "list", - list_print, // print - list_make_new, // make_new - NULL, // call_n - NULL, // unary_op - list_binary_op, // binary_op - list_getiter, // getiter - NULL, // iternext - { // method list + .print = list_print, + .make_new = list_make_new, + .unary_op = NULL, + .binary_op = list_binary_op, + .getiter = list_getiter, + .methods = { { "append", &list_append_obj }, { "clear", &list_clear_obj }, { "copy", &list_copy_obj }, @@ -287,14 +285,8 @@ mp_obj_t list_it_iternext(mp_obj_t self_in) { static const mp_obj_type_t list_it_type = { { &mp_const_type }, "list_iterator", - NULL, // print - NULL, // make_new - NULL, // call_n - NULL, // unary_op - NULL, // binary_op - NULL, // getiter - list_it_iternext, // iternext - { { NULL, NULL }, }, // method list + .iternext = list_it_iternext, + .methods = { { NULL, NULL }, }, }; mp_obj_t mp_obj_new_list_iterator(mp_obj_list_t *list, int cur) { |