Przeglądaj źródła

[更新]: 由于更新mp_obj_new_str参数个数而更新的代码。

SummerGift 8 lat temu
rodzic
commit
e54600735b

+ 1 - 1
extmod/modujson.c

@@ -166,7 +166,7 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
                     goto fail;
                 }
                 S_NEXT(s);
-                next = mp_obj_new_str(vstr.buf, vstr.len, false);
+                next = mp_obj_new_str(vstr.buf, vstr.len);
                 break;
             case '-':
             case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': {

+ 1 - 3
lib/netutils/netutils.c

@@ -29,8 +29,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "py/obj.h"
-#include "py/nlr.h"
 #include "py/runtime.h"
 #include "lib/netutils/netutils.h"
 
@@ -43,7 +41,7 @@ mp_obj_t netutils_format_ipv4_addr(uint8_t *ip, netutils_endian_t endian) {
     } else {
         ip_len = snprintf(ip_str, 16, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
     }
-    return mp_obj_new_str(ip_str, ip_len, false);
+    return mp_obj_new_str(ip_str, ip_len);
 }
 
 // Takes an array with a raw IP address, and a port, and returns a net-address

+ 1 - 1
port/genhdr/qstrdefs.generated.h

@@ -590,7 +590,7 @@ QDEF(MP_QSTR_modify, (const byte*)"\xf5\x06" "modify")
 QDEF(MP_QSTR_SOL_SOCKET, (const byte*)"\x0f\x0a" "SOL_SOCKET")
 QDEF(MP_QSTR_SO_REUSEADDR, (const byte*)"\x21\x0c" "SO_REUSEADDR")
 QDEF(MP_QSTR_pend_throw, (const byte*)"\xf3\x0a" "pend_throw")
-
+QDEF(MP_QSTR__space_, (const byte*)"\xe1\x07" "_space_")
 
 
 // This file was automatically generated by makeqstrdata.py

+ 1 - 1
port/machine_pin.c

@@ -178,7 +178,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_pin_value_obj, 1, 2, machine_
 // pin.name()
 STATIC mp_obj_t machine_pin_name(size_t n_args, const mp_obj_t *args) {
     machine_pin_obj_t *self = (machine_pin_obj_t *)args[0];
-    return mp_obj_new_str(self->name, strlen(self->name), false);
+    return mp_obj_new_str(self->name, strlen(self->name));
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_pin_name_obj, 1, 2, machine_pin_name);
 

+ 2 - 2
port/moduos_file.c

@@ -58,7 +58,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_posix_chdir_obj, mp_posix_chdir);
 mp_obj_t mp_posix_getcwd(void) {
     char buf[MICROPY_ALLOC_PATH_MAX + 1];
     getcwd(buf, sizeof(buf));
-    return mp_obj_new_str(buf, strlen(buf), false);
+    return mp_obj_new_str(buf, strlen(buf));
 }
 MP_DEFINE_CONST_FUN_OBJ_0(mp_posix_getcwd_obj, mp_posix_getcwd);
 
@@ -120,7 +120,7 @@ mp_obj_t mp_posix_listdir(size_t n_args, const mp_obj_t *args) {
 
                 if (dfs_file_stat(fullpath, &stat) == 0) {
                     mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(3, NULL));
-                    t->items[0] = mp_obj_new_str(dirent.d_name, strlen(dirent.d_name), false);
+                    t->items[0] = mp_obj_new_str(dirent.d_name, strlen(dirent.d_name));
                     t->items[1] = MP_OBJ_NEW_SMALL_INT(MP_S_IFDIR);
                     t->items[2] = MP_OBJ_NEW_SMALL_INT(0); // no inode number
                     mp_obj_t next = MP_OBJ_FROM_PTR(t);

+ 1 - 1
port/mpy_main.c

@@ -82,7 +82,7 @@ void mpy_main(const char *filename) {
     /* system path initialization */
     mp_obj_list_init(mp_sys_path, 0);
     mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
-    mp_obj_list_append(mp_sys_path, mp_obj_new_str(MICROPY_PY_PATH, strlen(MICROPY_PY_PATH), false));
+    mp_obj_list_append(mp_sys_path, mp_obj_new_str(MICROPY_PY_PATH, strlen(MICROPY_PY_PATH)));
     mp_obj_list_init(mp_sys_argv, 0);
 
     if (filename) {