Skip to content

Commit c231c43

Browse files
committed
fix: 修正http/ftp的几个编译警告
1 parent aa2c503 commit c231c43

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/network/libftp/luat_ftp_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int32_t luat_ftp_data_callback(void *data, void *param){
130130
{
131131
if (g_s_ftp.fd)
132132
{
133-
luat_rtos_event_send(g_s_ftp.task_handle, FTP_EVENT_DATA_WRITE_FILE, rx_buffer, rx_len, 0, LUAT_WAIT_FOREVER);
133+
luat_rtos_event_send(g_s_ftp.task_handle, FTP_EVENT_DATA_WRITE_FILE, (uint32_t)rx_buffer, rx_len, 0, LUAT_WAIT_FOREVER);
134134
rx_buffer = NULL;
135135
continue;
136136
}

components/network/libhttp/luat_lib_http.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ static int l_http_request(lua_State *L) {
204204

205205
lua_pushstring(L, "callback");
206206
if (LUA_TFUNCTION == lua_gettable(L, 5)) {
207-
http_ctrl->http_cb = luaL_ref(L, LUA_REGISTRYINDEX);
207+
http_ctrl->http_cb = (void*)luaL_ref(L, LUA_REGISTRYINDEX);
208208
}
209209

210210
if (http_ctrl->http_cb){
211211
lua_pushstring(L, "userdata");
212212
lua_gettable(L, 5);
213-
http_ctrl->http_cb_userdata = luaL_ref(L, LUA_REGISTRYINDEX);
213+
http_ctrl->http_cb_userdata = (void*)luaL_ref(L, LUA_REGISTRYINDEX);
214214
}
215215
}else{
216216
adapter_index = network_get_last_register_adapter();
@@ -384,13 +384,13 @@ int32_t l_http_callback(lua_State *L, void* ptr){
384384
LLOGD("l_http_callback arg1:%d is_download:%d idp:%d",msg->arg1,http_ctrl->is_download,idp);
385385
if (msg->arg1!=0 && msg->arg1!=HTTP_ERROR_FOTA ){
386386
if (msg->arg1 == HTTP_CALLBACK){
387-
lua_geti(L, LUA_REGISTRYINDEX, http_ctrl->http_cb);
387+
lua_geti(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb);
388388
// int userdata_type = lua_type(L, -2);
389389
if (lua_isfunction(L, -1)) {
390390
lua_pushinteger(L, http_ctrl->resp_content_len);
391391
lua_pushinteger(L, msg->arg2);
392392
if (http_ctrl->http_cb_userdata){
393-
lua_geti(L, LUA_REGISTRYINDEX, http_ctrl->http_cb_userdata);
393+
lua_geti(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb_userdata);
394394
lua_call(L, 3, 0);
395395
}else{
396396
lua_call(L, 2, 0);
@@ -456,10 +456,10 @@ int32_t l_http_callback(lua_State *L, void* ptr){
456456
}
457457
exit:
458458
if (http_ctrl->http_cb){
459-
luaL_unref(L, LUA_REGISTRYINDEX, http_ctrl->http_cb);
459+
luaL_unref(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb);
460460
http_ctrl->http_cb = 0;
461461
if (http_ctrl->http_cb_userdata){
462-
luaL_unref(L, LUA_REGISTRYINDEX, http_ctrl->http_cb_userdata);
462+
luaL_unref(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb_userdata);
463463
http_ctrl->http_cb_userdata = 0;
464464
}
465465
}

0 commit comments

Comments
 (0)