summaryrefslogtreecommitdiffstatshomepage
path: root/py/objstr.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-05 22:34:09 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-05 22:34:09 +0200
commit860ffb0a4365bba62cbd692392375df9fd4a72e7 (patch)
tree6af9fda7e920151975b6681608ddaae4e0c039c1 /py/objstr.c
parent12e2656472bf53e467c066eda6f3e177a97210ca (diff)
downloadmicropython-860ffb0a4365bba62cbd692392375df9fd4a72e7.tar.gz
micropython-860ffb0a4365bba62cbd692392375df9fd4a72e7.zip
Convert many object types structs to use C99 tagged initializer syntax.
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/py/objstr.c b/py/objstr.c
index a1d139e83a..db3e0beca0 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -187,14 +187,10 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR(str_format_obj, 1, str_format);
const mp_obj_type_t str_type = {
{ &mp_const_type },
"str",
- str_print, // print
- NULL, // make_new
- NULL, // call_n
- NULL, // unary_op
- str_binary_op, // binary_op
- str_getiter, // getiter
- NULL, // iternext
- { // method list
+ .print = str_print,
+ .binary_op = str_binary_op,
+ .getiter = str_getiter,
+ .methods = {
{ "join", &str_join_obj },
{ "format", &str_format_obj },
{ NULL, NULL }, // end-of-list sentinel
@@ -238,14 +234,8 @@ mp_obj_t str_it_iternext(mp_obj_t self_in) {
static const mp_obj_type_t str_it_type = {
{ &mp_const_type },
"str_iterator",
- NULL, // print
- NULL, // make_new
- NULL, // call_n
- NULL, // unary_op
- NULL, // binary_op
- NULL, // getiter
- str_it_iternext, // iternext
- { { NULL, NULL }, }, // method str
+ .iternext = str_it_iternext,
+ .methods = { { NULL, NULL }, },
};
mp_obj_t mp_obj_new_str_iterator(mp_obj_str_t *str, int cur) {