Skip to content

Commit

Permalink
fix: 修正http/ftp的几个编译警告
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Dec 23, 2024
1 parent aa2c503 commit c231c43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/network/libftp/luat_ftp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int32_t luat_ftp_data_callback(void *data, void *param){
{
if (g_s_ftp.fd)
{
luat_rtos_event_send(g_s_ftp.task_handle, FTP_EVENT_DATA_WRITE_FILE, rx_buffer, rx_len, 0, LUAT_WAIT_FOREVER);
luat_rtos_event_send(g_s_ftp.task_handle, FTP_EVENT_DATA_WRITE_FILE, (uint32_t)rx_buffer, rx_len, 0, LUAT_WAIT_FOREVER);
rx_buffer = NULL;
continue;
}
Expand Down
12 changes: 6 additions & 6 deletions components/network/libhttp/luat_lib_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ static int l_http_request(lua_State *L) {

lua_pushstring(L, "callback");
if (LUA_TFUNCTION == lua_gettable(L, 5)) {
http_ctrl->http_cb = luaL_ref(L, LUA_REGISTRYINDEX);
http_ctrl->http_cb = (void*)luaL_ref(L, LUA_REGISTRYINDEX);
}

if (http_ctrl->http_cb){
lua_pushstring(L, "userdata");
lua_gettable(L, 5);
http_ctrl->http_cb_userdata = luaL_ref(L, LUA_REGISTRYINDEX);
http_ctrl->http_cb_userdata = (void*)luaL_ref(L, LUA_REGISTRYINDEX);
}
}else{
adapter_index = network_get_last_register_adapter();
Expand Down Expand Up @@ -384,13 +384,13 @@ int32_t l_http_callback(lua_State *L, void* ptr){
LLOGD("l_http_callback arg1:%d is_download:%d idp:%d",msg->arg1,http_ctrl->is_download,idp);
if (msg->arg1!=0 && msg->arg1!=HTTP_ERROR_FOTA ){
if (msg->arg1 == HTTP_CALLBACK){
lua_geti(L, LUA_REGISTRYINDEX, http_ctrl->http_cb);
lua_geti(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb);
// int userdata_type = lua_type(L, -2);
if (lua_isfunction(L, -1)) {
lua_pushinteger(L, http_ctrl->resp_content_len);
lua_pushinteger(L, msg->arg2);
if (http_ctrl->http_cb_userdata){
lua_geti(L, LUA_REGISTRYINDEX, http_ctrl->http_cb_userdata);
lua_geti(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb_userdata);
lua_call(L, 3, 0);
}else{
lua_call(L, 2, 0);
Expand Down Expand Up @@ -456,10 +456,10 @@ int32_t l_http_callback(lua_State *L, void* ptr){
}
exit:
if (http_ctrl->http_cb){
luaL_unref(L, LUA_REGISTRYINDEX, http_ctrl->http_cb);
luaL_unref(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb);
http_ctrl->http_cb = 0;
if (http_ctrl->http_cb_userdata){
luaL_unref(L, LUA_REGISTRYINDEX, http_ctrl->http_cb_userdata);
luaL_unref(L, LUA_REGISTRYINDEX, (int)http_ctrl->http_cb_userdata);
http_ctrl->http_cb_userdata = 0;
}
}
Expand Down

0 comments on commit c231c43

Please sign in to comment.