Kaynağa Gözat

fix: 修正几个代码编译警告

Wendal Chen 4 yıl önce
ebeveyn
işleme
2b803ee186

+ 1 - 1
luat/include/luat_fs.h

@@ -125,7 +125,7 @@ typedef struct luat_vfs
 }luat_vfs_t;
 
 int luat_vfs_init(void* params);
-int luat_vfs_reg(struct luat_vfs_filesystem* fs);
+int luat_vfs_reg(const struct luat_vfs_filesystem* fs);
 FILE* luat_vfs_add_fd(FILE* fd, luat_vfs_mount_t * mount);
 int luat_vfs_rm_fd(FILE* fd);
 #endif

+ 1 - 1
luat/modules/luat_lib_dbg.c

@@ -169,7 +169,7 @@ void luat_dbg_vars(void *params) {
                 valtype = lua_type(dbg_L, -1);
                 const char* valstr = lua_tolstring(dbg_L, -1, &valstrlen);
                 valoutlen = valstrlen > 127 ? 127 : valstrlen;
-                mempcpy(buff, valstr, valoutlen);
+                memcpy(buff, valstr, valoutlen);
                 buff[valoutlen] = 0x00;
                 // 索引号,变量名,变量类型,值的字符串长度, 值的字符串形式
                 luat_dbg_output("[resp,vars,1,%d] %s %d %d %s", index, varname, valtype, valoutlen, buff);

+ 1 - 1
luat/modules/luat_luadb.c

@@ -309,7 +309,7 @@ _after_head:
 #ifdef LUAT_USE_FS_VFS
 
 FILE* luat_vfs_luadb_fopen(void* userdata, const char *filename, const char *mode) {
-    return luat_luadb_open((luadb_fs_t*)userdata, filename, 0, 0);
+    return (FILE*)luat_luadb_open((luadb_fs_t*)userdata, filename, 0, 0);
 }
 
 

+ 2 - 2
luat/modules/luat_vfs.c

@@ -14,11 +14,11 @@ int luat_vfs_init(void* params) {
     memset(&vfs, 0, sizeof(vfs));
 }
 
-int luat_vfs_reg(struct luat_vfs_filesystem* fs) {
+int luat_vfs_reg(const struct luat_vfs_filesystem* fs) {
     for (size_t i = 0; i < LUAT_VFS_FILESYSTEM_MAX; i++)
     {
         if (vfs.fsList[i] == NULL) {
-            vfs.fsList[i] = fs;
+            vfs.fsList[i] = (struct luat_vfs_filesystem*)fs;
             LLOGD("register fs %s", fs->name);
             return 0;
         }