Skip to content

Commit 51f82f9

Browse files
committed
modubus: update calls to mp_obj_new_str()
Remove last argument from all calls to mp_obj_new_str().
1 parent 326665c commit 51f82f9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ports/unix/modubus.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ STATIC void ubus_lookup_handler(struct ubus_context *ctx,
177177
if (py_cb_func == mp_const_none)
178178
return;
179179
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(3, NULL));
180-
t->items[0] = mp_obj_new_str(obj->path, strlen(obj->path), false);
180+
t->items[0] = mp_obj_new_str(obj->path, strlen(obj->path));
181181
t->items[1] = mp_obj_new_int(obj->id);
182182
t->items[2] = mp_obj_new_int(obj->type_id);
183183
mp_call_function_1_protected(py_cb_func, MP_OBJ_FROM_PTR(t));
@@ -439,7 +439,7 @@ STATIC int ubus_notification_handler(struct ubus_context *ctx, struct ubus_objec
439439
const mp_obj_t args[4] = {
440440
MP_OBJ_FROM_PTR(_ctx),
441441
MP_OBJ_FROM_PTR(_sub),
442-
mp_obj_new_str(method, strlen(method), false),
442+
mp_obj_new_str(method, strlen(method)),
443443
msg ? mp_obj_new_bytes(blob_data(msg), blob_len(msg)) : mp_const_none,
444444
};
445445
mp_call_function_n_kw_protected(_sub->notification_cb, 4, 0, args);
@@ -480,7 +480,7 @@ STATIC void ubus_event_handler(struct ubus_context *ctx, struct ubus_event_handl
480480
const mp_obj_t args[4] = {
481481
MP_OBJ_FROM_PTR(_ctx),
482482
MP_OBJ_FROM_PTR(_ev),
483-
mp_obj_new_str(type, strlen(type), false),
483+
mp_obj_new_str(type, strlen(type)),
484484
msg ? mp_obj_new_bytes(blob_data(msg), blob_len(msg)) : mp_const_none,
485485
};
486486
mp_call_function_n_kw_protected(_ev->ev_cb, 4, 0, args);
@@ -618,7 +618,7 @@ STATIC int obj_method_handler(struct ubus_context *ctx, struct ubus_object *obj,
618618
MP_OBJ_FROM_PTR(_ctx),
619619
MP_OBJ_FROM_PTR(_obj),
620620
mp_obj_new_int((intptr_t)req),
621-
mp_obj_new_str(method, strlen(method), false),
621+
mp_obj_new_str(method, strlen(method)),
622622
msg ? mp_obj_new_bytes(blob_data(msg), blob_len(msg)) : mp_const_none,
623623
};
624624
mp_obj_t res = mp_call_function_n_kw_protected(_obj->method_cb, 5, 0, args);
@@ -710,7 +710,7 @@ STATIC mp_obj_t append_blobmsg_element(mp_obj_t list, struct blob_attr *attr) {
710710
elem = mp_obj_new_int(*(uint64_t *)data);
711711
break;
712712
case BLOBMSG_TYPE_STRING:
713-
elem = mp_obj_new_str(data, len-1, false);
713+
elem = mp_obj_new_str(data, len-1);
714714
break;
715715
case BLOBMSG_TYPE_ARRAY:
716716
elem = blobmsg_to_sequence(data, len);
@@ -741,7 +741,7 @@ STATIC mp_obj_t append_blobmsg_element(mp_obj_t list, struct blob_attr *attr) {
741741
elem = mp_obj_new_int(*(uint64_t *)data);
742742
break;
743743
case BLOB_ATTR_STRING:
744-
elem = mp_obj_new_str(data, len-1, false);
744+
elem = mp_obj_new_str(data, len-1);
745745
break;
746746
}
747747
}
@@ -753,7 +753,7 @@ STATIC mp_obj_t append_blobmsg_element(mp_obj_t list, struct blob_attr *attr) {
753753
if (!slen)
754754
goto append;
755755
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL));
756-
t->items[0] = mp_obj_new_str(name, slen, false);
756+
t->items[0] = mp_obj_new_str(name, slen);
757757
t->items[1] = elem;
758758
elem = MP_OBJ_FROM_PTR(t);
759759
}

0 commit comments

Comments
 (0)