Merge pull request #4399 from zhangsz0516/zhangsz_0228

[update][kernel]规范rt_object_t强制转换的使用,消除上次提交的编译警告
This commit is contained in:
Bernard Xiong 2021-02-28 20:32:53 +08:00 committed by GitHub
commit 53b308948d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -358,8 +358,6 @@ RTM_EXPORT(rt_thread_startup);
*/
rt_err_t rt_thread_detach(rt_thread_t thread)
{
rt_base_t lock;
/* thread check */
RT_ASSERT(thread != RT_NULL);
RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);

View File

@ -201,7 +201,7 @@ void rt_timer_init(rt_timer_t timer,
RT_ASSERT(timer != RT_NULL);
/* timer object initialization */
rt_object_init((rt_object_t)timer, RT_Object_Class_Timer, name);
rt_object_init(&(timer->parent), RT_Object_Class_Timer, name);
_rt_timer_init(timer, timeout, parameter, time, flag);
}
@ -298,7 +298,7 @@ rt_err_t rt_timer_delete(rt_timer_t timer)
/* enable interrupt */
rt_hw_interrupt_enable(level);
rt_object_delete((rt_object_t)timer);
rt_object_delete(&(timer->parent));
return RT_EOK;
}