From 7a16fadbf843ca5d49fb20b5f5785ffccfd9019f Mon Sep 17 00:00:00 2001 From: ian-v Date: Mon, 6 Jan 2014 09:52:29 -0800 Subject: Co-exist with C++ (issue #85) --- py/objtuple.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'py/objtuple.c') diff --git a/py/objtuple.c b/py/objtuple.c index ceca4200e..a8ecc3a4f 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -103,7 +103,7 @@ const mp_obj_type_t tuple_type = { .make_new = tuple_make_new, .binary_op = tuple_binary_op, .getiter = tuple_getiter, - .methods = {{NULL, NULL},}, + .methods = NULL, }; // the zero-length tuple @@ -165,8 +165,14 @@ static mp_obj_t tuple_it_iternext(mp_obj_t self_in) { static const mp_obj_type_t tuple_it_type = { { &mp_const_type }, "tuple_iterator", - .iternext = tuple_it_iternext, - .methods = {{NULL, NULL},}, + NULL, // print + NULL, // make_new + NULL, // call_n + NULL, // unary_op + NULL, // binary_op + NULL, // getiter + tuple_it_iternext, + NULL, // method list }; static mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur) { -- cgit v1.2.3 From 5fd8fd2c16076f683b629b513e8865e461d4c9a8 Mon Sep 17 00:00:00 2001 From: ian-v Date: Mon, 6 Jan 2014 13:51:53 -0800 Subject: Revert MP_BOOL, etc. and use instead --- py/objtuple.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'py/objtuple.c') diff --git a/py/objtuple.c b/py/objtuple.c index a8ecc3a4f..a59e674b1 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -165,14 +165,8 @@ static mp_obj_t tuple_it_iternext(mp_obj_t self_in) { static const mp_obj_type_t tuple_it_type = { { &mp_const_type }, "tuple_iterator", - NULL, // print - NULL, // make_new - NULL, // call_n - NULL, // unary_op - NULL, // binary_op - NULL, // getiter - tuple_it_iternext, - NULL, // method list + .iternext = tuple_it_iternext, + .methods = NULL, }; static mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur) { -- cgit v1.2.3