aboutsummaryrefslogtreecommitdiff
path: root/py/objtype.c
diff options
context:
space:
mode:
authorDamien George2014-03-30 13:35:08 +0100
committerDamien George2014-03-30 13:35:08 +0100
commitd17926db710189db97a49e9b2e72d782fc404231 (patch)
tree406396ee6f3010511a606dd4ea3ed5a817d959eb /py/objtype.c
parent09d207785c77c85c957471b064ceebe0d2ee0a23 (diff)
Rename rt_* to mp_*.
Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
Diffstat (limited to 'py/objtype.c')
-rw-r--r--py/objtype.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 513dc7ab2..05d39b121 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -76,7 +76,7 @@ STATIC void class_print(void (*print)(void *env, const char *fmt, ...), void *en
}
if (member != MP_OBJ_NULL) {
- mp_obj_t r = rt_call_function_1(member, self_in);
+ mp_obj_t r = mp_call_function_1(member, self_in);
mp_obj_print_helper(print, env, r, PRINT_STR);
return;
}
@@ -98,12 +98,12 @@ STATIC mp_obj_t class_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const m
// call __init__ function
mp_obj_t init_ret;
if (n_args == 0 && n_kw == 0) {
- init_ret = rt_call_function_n_kw(init_fn, 1, 0, (mp_obj_t*)&o);
+ init_ret = mp_call_function_n_kw(init_fn, 1, 0, (mp_obj_t*)&o);
} else {
mp_obj_t *args2 = m_new(mp_obj_t, 1 + n_args + 2 * n_kw);
args2[0] = o;
memcpy(args2 + 1, args, (n_args + 2 * n_kw) * sizeof(mp_obj_t));
- init_ret = rt_call_function_n_kw(init_fn, n_args + 1, n_kw, args2);
+ init_ret = mp_call_function_n_kw(init_fn, n_args + 1, n_kw, args2);
m_del(mp_obj_t, args2, 1 + n_args + 2 * n_kw);
}
if (init_ret != mp_const_none) {
@@ -121,12 +121,12 @@ STATIC mp_obj_t class_make_new(mp_obj_t self_in, uint n_args, uint n_kw, const m
}
STATIC const qstr unary_op_method_name[] = {
- [RT_UNARY_OP_BOOL] = MP_QSTR___bool__,
- [RT_UNARY_OP_LEN] = MP_QSTR___len__,
- //[RT_UNARY_OP_POSITIVE,
- //[RT_UNARY_OP_NEGATIVE,
- //[RT_UNARY_OP_INVERT,
- [RT_UNARY_OP_NOT] = MP_QSTR_, // don't need to implement this, used to make sure array has full size
+ [MP_UNARY_OP_BOOL] = MP_QSTR___bool__,
+ [MP_UNARY_OP_LEN] = MP_QSTR___len__,
+ //[MP_UNARY_OP_POSITIVE,
+ //[MP_UNARY_OP_NEGATIVE,
+ //[MP_UNARY_OP_INVERT,
+ [MP_UNARY_OP_NOT] = MP_QSTR_, // don't need to implement this, used to make sure array has full size
};
STATIC mp_obj_t class_unary_op(int op, mp_obj_t self_in) {
@@ -137,51 +137,51 @@ STATIC mp_obj_t class_unary_op(int op, mp_obj_t self_in) {
}
mp_obj_t member = mp_obj_class_lookup(self->base.type, op_name);
if (member != MP_OBJ_NULL) {
- return rt_call_function_1(member, self_in);
+ return mp_call_function_1(member, self_in);
} else {
return MP_OBJ_NULL;
}
}
STATIC const qstr binary_op_method_name[] = {
- [RT_BINARY_OP_SUBSCR] = MP_QSTR___getitem__,
+ [MP_BINARY_OP_SUBSCR] = MP_QSTR___getitem__,
/*
- RT_BINARY_OP_OR,
- RT_BINARY_OP_XOR,
- RT_BINARY_OP_AND,
- RT_BINARY_OP_LSHIFT,
- RT_BINARY_OP_RSHIFT,
+ MP_BINARY_OP_OR,
+ MP_BINARY_OP_XOR,
+ MP_BINARY_OP_AND,
+ MP_BINARY_OP_LSHIFT,
+ MP_BINARY_OP_RSHIFT,
*/
- [RT_BINARY_OP_ADD] = MP_QSTR___add__,
- [RT_BINARY_OP_SUBTRACT] = MP_QSTR___sub__,
+ [MP_BINARY_OP_ADD] = MP_QSTR___add__,
+ [MP_BINARY_OP_SUBTRACT] = MP_QSTR___sub__,
/*
- RT_BINARY_OP_MULTIPLY,
- RT_BINARY_OP_FLOOR_DIVIDE,
- RT_BINARY_OP_TRUE_DIVIDE,
- RT_BINARY_OP_MODULO,
- RT_BINARY_OP_POWER,
- RT_BINARY_OP_INPLACE_OR,
- RT_BINARY_OP_INPLACE_XOR,
- RT_BINARY_OP_INPLACE_AND,
- RT_BINARY_OP_INPLACE_LSHIFT,
- RT_BINARY_OP_INPLACE_RSHIFT,
- RT_BINARY_OP_INPLACE_ADD,
- RT_BINARY_OP_INPLACE_SUBTRACT,
- RT_BINARY_OP_INPLACE_MULTIPLY,
- RT_BINARY_OP_INPLACE_FLOOR_DIVIDE,
- RT_BINARY_OP_INPLACE_TRUE_DIVIDE,
- RT_BINARY_OP_INPLACE_MODULO,
- RT_BINARY_OP_INPLACE_POWER,
- RT_BINARY_OP_LESS,
- RT_BINARY_OP_MORE,
- RT_BINARY_OP_EQUAL,
- RT_BINARY_OP_LESS_EQUAL,
- RT_BINARY_OP_MORE_EQUAL,
- RT_BINARY_OP_NOT_EQUAL,
- RT_BINARY_OP_IN,
- RT_BINARY_OP_IS,
+ MP_BINARY_OP_MULTIPLY,
+ MP_BINARY_OP_FLOOR_DIVIDE,
+ MP_BINARY_OP_TRUE_DIVIDE,
+ MP_BINARY_OP_MODULO,
+ MP_BINARY_OP_POWER,
+ MP_BINARY_OP_INPLACE_OR,
+ MP_BINARY_OP_INPLACE_XOR,
+ MP_BINARY_OP_INPLACE_AND,
+ MP_BINARY_OP_INPLACE_LSHIFT,
+ MP_BINARY_OP_INPLACE_RSHIFT,
+ MP_BINARY_OP_INPLACE_ADD,
+ MP_BINARY_OP_INPLACE_SUBTRACT,
+ MP_BINARY_OP_INPLACE_MULTIPLY,
+ MP_BINARY_OP_INPLACE_FLOOR_DIVIDE,
+ MP_BINARY_OP_INPLACE_TRUE_DIVIDE,
+ MP_BINARY_OP_INPLACE_MODULO,
+ MP_BINARY_OP_INPLACE_POWER,
+ MP_BINARY_OP_LESS,
+ MP_BINARY_OP_MORE,
+ MP_BINARY_OP_EQUAL,
+ MP_BINARY_OP_LESS_EQUAL,
+ MP_BINARY_OP_MORE_EQUAL,
+ MP_BINARY_OP_NOT_EQUAL,
+ MP_BINARY_OP_IN,
+ MP_BINARY_OP_IS,
*/
- [RT_BINARY_OP_EXCEPTION_MATCH] = MP_QSTR_, // not implemented, used to make sure array has full size
+ [MP_BINARY_OP_EXCEPTION_MATCH] = MP_QSTR_, // not implemented, used to make sure array has full size
};
STATIC mp_obj_t class_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
@@ -192,7 +192,7 @@ STATIC mp_obj_t class_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
}
mp_obj_t member = mp_obj_class_lookup(lhs->base.type, op_name);
if (member != MP_OBJ_NULL) {
- return rt_call_function_2(member, lhs_in, rhs_in);
+ return mp_call_function_2(member, lhs_in, rhs_in);
} else {
return MP_OBJ_NULL;
}
@@ -242,7 +242,7 @@ bool class_store_item(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_obj_t member = mp_obj_class_lookup(self->base.type, MP_QSTR___setitem__);
if (member != MP_OBJ_NULL) {
mp_obj_t args[3] = {self_in, index, value};
- rt_call_function_n_kw(member, 3, 0, args);
+ mp_call_function_n_kw(member, 3, 0, args);
return true;
} else {
return false;