py: Fix prefix on few sequence helpers, was incorrectly "mp_".
diff --git a/py/obj.h b/py/obj.h
index 089b953..0ec3c29 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -564,9 +564,9 @@
// sequence helpers
void mp_seq_multiply(const void *items, uint item_sz, uint len, uint times, void *dest);
-bool m_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_uint_t *begin, machine_uint_t *end);
-#define m_seq_copy(dest, src, len, item_t) memcpy(dest, src, len * sizeof(item_t))
-#define m_seq_cat(dest, src1, len1, src2, len2, item_t) { memcpy(dest, src1, (len1) * sizeof(item_t)); memcpy(dest + (len1), src2, (len2) * sizeof(item_t)); }
+bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_uint_t *begin, machine_uint_t *end);
+#define mp_seq_copy(dest, src, len, item_t) memcpy(dest, src, len * sizeof(item_t))
+#define mp_seq_cat(dest, src1, len1, src2, len2, item_t) { memcpy(dest, src1, (len1) * sizeof(item_t)); memcpy(dest + (len1), src2, (len2) * sizeof(item_t)); }
bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, uint len2);
bool mp_seq_cmp_objs(int op, const mp_obj_t *items1, uint len1, const mp_obj_t *items2, uint len2);
mp_obj_t mp_seq_index_obj(const mp_obj_t *items, uint len, uint n_args, const mp_obj_t *args);
diff --git a/py/objarray.c b/py/objarray.c
index 6fca4a4..b394d77 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -176,7 +176,7 @@
return MP_OBJ_NOT_SUPPORTED;
}
machine_uint_t start, stop;
- if (!m_seq_get_fast_slice_indexes(o->len, index_in, &start, &stop)) {
+ if (!mp_seq_get_fast_slice_indexes(o->len, index_in, &start, &stop)) {
assert(0);
}
mp_obj_array_t *res = array_new(o->typecode, stop - start);
diff --git a/py/objlist.c b/py/objlist.c
index 2a5de35..08c1716 100644
--- a/py/objlist.c
+++ b/py/objlist.c
@@ -119,7 +119,7 @@
}
mp_obj_list_t *p = rhs;
mp_obj_list_t *s = list_new(o->len + p->len);
- m_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t);
+ mp_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t);
return s;
}
case MP_BINARY_OP_INPLACE_ADD: {
@@ -162,11 +162,11 @@
#if MICROPY_ENABLE_SLICE
if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
machine_uint_t start, stop;
- if (!m_seq_get_fast_slice_indexes(self->len, index, &start, &stop)) {
+ if (!mp_seq_get_fast_slice_indexes(self->len, index, &start, &stop)) {
assert(0);
}
mp_obj_list_t *res = list_new(stop - start);
- m_seq_copy(res->items, self->items + start, res->len, mp_obj_t);
+ mp_seq_copy(res->items, self->items + start, res->len, mp_obj_t);
return res;
}
#endif
diff --git a/py/objstr.c b/py/objstr.c
index 26c6edd..80b0cf8 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -333,7 +333,7 @@
#if MICROPY_ENABLE_SLICE
if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
machine_uint_t start, stop;
- if (!m_seq_get_fast_slice_indexes(self_len, index, &start, &stop)) {
+ if (!mp_seq_get_fast_slice_indexes(self_len, index, &start, &stop)) {
assert(0);
}
return mp_obj_new_str(self_data + start, stop - start, false);
diff --git a/py/objtuple.c b/py/objtuple.c
index 109e3ba..7d4e877 100644
--- a/py/objtuple.c
+++ b/py/objtuple.c
@@ -127,7 +127,7 @@
}
mp_obj_tuple_t *p = rhs;
mp_obj_tuple_t *s = mp_obj_new_tuple(o->len + p->len, NULL);
- m_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t);
+ mp_seq_cat(s->items, o->items, o->len, p->items, p->len, mp_obj_t);
return s;
}
case MP_BINARY_OP_MULTIPLY: {
@@ -159,11 +159,11 @@
#if MICROPY_ENABLE_SLICE
if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
machine_uint_t start, stop;
- if (!m_seq_get_fast_slice_indexes(self->len, index, &start, &stop)) {
+ if (!mp_seq_get_fast_slice_indexes(self->len, index, &start, &stop)) {
assert(0);
}
mp_obj_tuple_t *res = mp_obj_new_tuple(stop - start, NULL);
- m_seq_copy(res->items, self->items + start, res->len, mp_obj_t);
+ mp_seq_copy(res->items, self->items + start, res->len, mp_obj_t);
return res;
}
#endif
diff --git a/py/runtime.c b/py/runtime.c
index f8eac40..1479d8c 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -578,7 +578,7 @@
}
// copy the fixed pos args
- m_seq_copy(args2 + args2_len, args, n_args, mp_obj_t);
+ mp_seq_copy(args2 + args2_len, args, n_args, mp_obj_t);
args2_len += n_args;
} else if (MP_OBJ_IS_TYPE(pos_seq, &mp_type_tuple) || MP_OBJ_IS_TYPE(pos_seq, &mp_type_list)) {
@@ -599,7 +599,7 @@
}
// copy the fixed and variable position args
- m_seq_cat(args2 + args2_len, args, n_args, items, len, mp_obj_t);
+ mp_seq_cat(args2 + args2_len, args, n_args, items, len, mp_obj_t);
args2_len += n_args + len;
} else {
@@ -615,7 +615,7 @@
}
// copy the fixed position args
- m_seq_copy(args2 + args2_len, args, n_args, mp_obj_t);
+ mp_seq_copy(args2 + args2_len, args, n_args, mp_obj_t);
// extract the variable position args from the iterator
mp_obj_t iterable = mp_getiter(pos_seq);
@@ -633,7 +633,7 @@
uint pos_args_len = args2_len;
// Copy the fixed kw args.
- m_seq_copy(args2 + args2_len, args + n_args, 2 * n_kw, mp_obj_t);
+ mp_seq_copy(args2 + args2_len, args + n_args, 2 * n_kw, mp_obj_t);
args2_len += 2 * n_kw;
// Extract (key,value) pairs from kw_dict dictionary and append to args2.
diff --git a/py/sequence.c b/py/sequence.c
index 3d2bbba..91162fc 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -50,7 +50,7 @@
}
}
-bool m_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_uint_t *begin, machine_uint_t *end) {
+bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_uint_t *begin, machine_uint_t *end) {
machine_int_t start, stop, step;
mp_obj_slice_get(slice, &start, &stop, &step);
if (step != 1) {