summaryrefslogtreecommitdiffstatshomepage
path: root/py/sequence.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-30 13:35:08 +0100
committerDamien George <damien.p.george@gmail.com>2014-03-30 13:35:08 +0100
commitd17926db710189db97a49e9b2e72d782fc404231 (patch)
tree406396ee6f3010511a606dd4ea3ed5a817d959eb /py/sequence.c
parent09d207785c77c85c957471b064ceebe0d2ee0a23 (diff)
downloadmicropython-d17926db710189db97a49e9b2e72d782fc404231.tar.gz
micropython-d17926db710189db97a49e9b2e72d782fc404231.zip
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/sequence.c')
-rw-r--r--py/sequence.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/py/sequence.c b/py/sequence.c
index 184c34e0b8..8810a47d97 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -55,16 +55,16 @@ bool m_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_ui
}
// Special-case comparison function for sequences of bytes
-// Don't pass RT_BINARY_OP_NOT_EQUAL here
+// Don't pass MP_BINARY_OP_NOT_EQUAL here
bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, uint len2) {
// Let's deal only with > & >=
- if (op == RT_BINARY_OP_LESS || op == RT_BINARY_OP_LESS_EQUAL) {
+ if (op == MP_BINARY_OP_LESS || op == MP_BINARY_OP_LESS_EQUAL) {
SWAP(const byte*, data1, data2);
SWAP(uint, len1, len2);
- if (op == RT_BINARY_OP_LESS) {
- op = RT_BINARY_OP_MORE;
+ if (op == MP_BINARY_OP_LESS) {
+ op = MP_BINARY_OP_MORE;
} else {
- op = RT_BINARY_OP_MORE_EQUAL;
+ op = MP_BINARY_OP_MORE_EQUAL;
}
}
uint min_len = len1 < len2 ? len1 : len2;
@@ -83,7 +83,7 @@ bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, u
// ... then longer list length wins (we deal only with >)
return false;
}
- } else if (op == RT_BINARY_OP_MORE) {
+ } else if (op == MP_BINARY_OP_MORE) {
// Otherwise, if we have strict relation, equality means failure
return false;
}
@@ -91,20 +91,20 @@ bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, u
}
// Special-case comparison function for sequences of mp_obj_t
-// Don't pass RT_BINARY_OP_NOT_EQUAL here
+// Don't pass MP_BINARY_OP_NOT_EQUAL here
bool mp_seq_cmp_objs(int op, const mp_obj_t *items1, uint len1, const mp_obj_t *items2, uint len2) {
- if (op == RT_BINARY_OP_EQUAL && len1 != len2) {
+ if (op == MP_BINARY_OP_EQUAL && len1 != len2) {
return false;
}
// Let's deal only with > & >=
- if (op == RT_BINARY_OP_LESS || op == RT_BINARY_OP_LESS_EQUAL) {
+ if (op == MP_BINARY_OP_LESS || op == MP_BINARY_OP_LESS_EQUAL) {
SWAP(const mp_obj_t *, items1, items2);
SWAP(uint, len1, len2);
- if (op == RT_BINARY_OP_LESS) {
- op = RT_BINARY_OP_MORE;
+ if (op == MP_BINARY_OP_LESS) {
+ op = MP_BINARY_OP_MORE;
} else {
- op = RT_BINARY_OP_MORE_EQUAL;
+ op = MP_BINARY_OP_MORE_EQUAL;
}
}
@@ -113,10 +113,10 @@ bool mp_seq_cmp_objs(int op, const mp_obj_t *items1, uint len1, const mp_obj_t *
bool rel_status;
for (int i = 0; i < len; i++) {
eq_status = mp_obj_equal(items1[i], items2[i]);
- if (op == RT_BINARY_OP_EQUAL && !eq_status) {
+ if (op == MP_BINARY_OP_EQUAL && !eq_status) {
return false;
}
- rel_status = (rt_binary_op(op, items1[i], items2[i]) == mp_const_true);
+ rel_status = (mp_binary_op(op, items1[i], items2[i]) == mp_const_true);
if (!eq_status && !rel_status) {
return false;
}
@@ -130,7 +130,7 @@ bool mp_seq_cmp_objs(int op, const mp_obj_t *items1, uint len1, const mp_obj_t *
// ... then longer list length wins (we deal only with >)
return false;
}
- } else if (op == RT_BINARY_OP_MORE) {
+ } else if (op == MP_BINARY_OP_MORE) {
// Otherwise, if we have strict relation, equality means failure
return false;
}