Skip to content

Commit dc8dd6d

Browse files
committed
Revert subscr signature change
1 parent 15072c6 commit dc8dd6d

29 files changed

+39
-40
lines changed

extmod/machine_mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ STATIC void machine_mem_print(const mp_print_t *print, mp_obj_t self_in, mp_prin
6161
}
6262

6363
#pragma GCC diagnostic ignored "-Wunused-parameter"
64-
STATIC mp_obj_t machine_mem_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
64+
STATIC mp_obj_t machine_mem_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
6565
// TODO support slice index to read/write multiple values at once
6666
machine_mem_obj_t *self = MP_OBJ_TO_PTR(self_in);
6767
if (value == MP_OBJ_NULL) {

extmod/modbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ STATIC mp_obj_t btree_iternext(mp_obj_t self_in) {
247247
}
248248

249249
#pragma GCC diagnostic ignored "-Wunused-parameter"
250-
STATIC mp_obj_t btree_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
250+
STATIC mp_obj_t btree_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
251251
//mp_obj_btree_t *self = MP_OBJ_TO_PTR(self_in);
252252
mp_obj_btree_t *self = mp_instance_cast_to_native_base(self_in, &btree_type);
253253
if (value == MP_OBJ_NULL) {

extmod/moductypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ STATIC void uctypes_struct_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
519519
}
520520

521521
#pragma GCC diagnostic ignored "-Wunused-parameter"
522-
STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_obj_t value, mp_obj_t instance) {
522+
STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t base_in, mp_obj_t index_in, mp_obj_t value) {
523523
mp_obj_uctypes_struct_t *self = mp_instance_cast_to_native_base(base_in, &uctypes_struct_type);
524524

525525
if (value == MP_OBJ_NULL) {

extmod/modurandom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_urandom_randint_obj, mod_urandom_randint);
150150
STATIC mp_obj_t mod_urandom_choice(mp_obj_t seq) {
151151
mp_int_t len = mp_obj_get_int(mp_obj_len(seq));
152152
if (len > 0) {
153-
return mp_obj_subscr(seq, mp_obj_new_int(yasmarang_randbelow(len)), MP_OBJ_SENTINEL, seq);
153+
return mp_obj_subscr(seq, mp_obj_new_int(yasmarang_randbelow(len)), MP_OBJ_SENTINEL);
154154
} else {
155155
nlr_raise(mp_obj_new_exception(&mp_type_IndexError));
156156
}

extmod/vfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ mp_obj_t mp_vfs_listdir(size_t n_args, const mp_obj_t *args) {
373373
mp_obj_t dir_list = mp_obj_new_list(0, NULL);
374374
mp_obj_t next;
375375
while ((next = mp_iternext(iter)) != MP_OBJ_STOP_ITERATION) {
376-
mp_obj_list_append(dir_list, mp_obj_subscr(next, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL, next));
376+
mp_obj_list_append(dir_list, mp_obj_subscr(next, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL));
377377
}
378378
return dir_list;
379379
}

ports/unix/modjni.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ STATIC void get_jclass_name(jobject obj, char *buf) {
242242
}
243243

244244
#pragma GCC diagnostic ignored "-Wunused-parameter"
245-
STATIC mp_obj_t jobject_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
245+
STATIC mp_obj_t jobject_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
246246
mp_obj_jobject_t *self = self_in;
247247
mp_uint_t idx = mp_obj_get_int(index);
248248
char class_name[64];
@@ -311,7 +311,7 @@ STATIC mp_obj_t jobject_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
311311
// TODO: subscr_load_adaptor & subscr_getiter convenience functions
312312
// should be moved to common location for reuse.
313313
STATIC mp_obj_t subscr_load_adaptor(mp_obj_t self_in, mp_obj_t index_in) {
314-
return mp_obj_subscr(self_in, index_in, MP_OBJ_SENTINEL, self_in);
314+
return mp_obj_subscr(self_in, index_in, MP_OBJ_SENTINEL);
315315
}
316316
MP_DEFINE_CONST_FUN_OBJ_2(subscr_load_adaptor_obj, subscr_load_adaptor);
317317

py/obj.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,11 @@ mp_obj_t mp_obj_len_maybe(mp_obj_t o_in) {
487487
}
488488
}
489489

490-
mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
490+
mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) {
491491
mp_obj_type_t *type = mp_obj_get_type(base);
492492

493493
if (type->subscr != NULL) {
494-
mp_obj_t ret = type->subscr(base, index, value, instance);
494+
mp_obj_t ret = type->subscr(base, index, value);
495495
// May have called port specific C code. Make sure it didn't mess up the heap.
496496
assert_heap_ok();
497497
if (ret != MP_OBJ_NULL) {
@@ -546,7 +546,7 @@ STATIC mp_obj_t generic_it_iternext(mp_obj_t self_in) {
546546
mp_obj_type_t *type = mp_obj_get_type(self->obj);
547547
mp_obj_t current_length = type->unary_op(MP_UNARY_OP_LEN, self->obj);
548548
if (self->cur < MP_OBJ_SMALL_INT_VALUE(current_length)) {
549-
mp_obj_t o_out = type->subscr(self->obj, MP_OBJ_NEW_SMALL_INT(self->cur), MP_OBJ_SENTINEL, self->obj);
549+
mp_obj_t o_out = type->subscr(self->obj, MP_OBJ_NEW_SMALL_INT(self->cur), MP_OBJ_SENTINEL);
550550
self->cur += 1;
551551
return o_out;
552552
} else {

py/obj.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, size_t n_args, size_t n_kw, cons
444444
typedef mp_obj_t (*mp_unary_op_fun_t)(mp_unary_op_t op, mp_obj_t);
445445
typedef mp_obj_t (*mp_binary_op_fun_t)(mp_binary_op_t op, mp_obj_t, mp_obj_t);
446446
typedef void (*mp_attr_fun_t)(mp_obj_t self_in, qstr attr, mp_obj_t *dest);
447-
typedef mp_obj_t (*mp_subscr_fun_t)(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance);
447+
typedef mp_obj_t (*mp_subscr_fun_t)(mp_obj_t self_in, mp_obj_t index, mp_obj_t value);
448448
typedef mp_obj_t (*mp_getiter_fun_t)(mp_obj_t self_in, mp_obj_iter_buf_t *iter_buf);
449449

450450
// Buffer protocol
@@ -707,7 +707,7 @@ size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t index, bool
707707
mp_obj_t mp_obj_id(mp_obj_t o_in);
708708
mp_obj_t mp_obj_len(mp_obj_t o_in);
709709
mp_obj_t mp_obj_len_maybe(mp_obj_t o_in); // may return MP_OBJ_NULL
710-
mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val, mp_obj_t instance);
710+
mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val);
711711
mp_obj_t mp_generic_unary_op(mp_unary_op_t op, mp_obj_t o_in);
712712

713713
// cell

py/objarray.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,7 @@ STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in) {
396396
STATIC MP_DEFINE_CONST_FUN_OBJ_2(array_extend_obj, array_extend);
397397
#endif
398398

399-
#pragma GCC diagnostic ignored "-Wunused-parameter"
400-
STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value, mp_obj_t instance) {
399+
STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
401400
if (value == MP_OBJ_NULL) {
402401
// delete item
403402
// TODO implement

py/objdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ mp_obj_t mp_obj_dict_get(mp_obj_t self_in, mp_obj_t index) {
175175
}
176176

177177
#pragma GCC diagnostic ignored "-Wunused-parameter"
178-
STATIC mp_obj_t dict_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value, mp_obj_t instance) {
178+
STATIC mp_obj_t dict_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
179179
if (value == MP_OBJ_NULL) {
180180
// delete
181181
mp_obj_dict_delete(self_in, index);

0 commit comments

Comments
 (0)