change the return type of function rt_object_is_systemobject()

using rt_bool_t instead of rt_err_t

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2150 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz@gmail.com 2012-06-02 09:20:19 +00:00
parent 907bb8c7fd
commit f19d8aa591
5 changed files with 15 additions and 15 deletions

View File

@ -43,7 +43,7 @@ void rt_object_init(struct rt_object *object, enum rt_object_class_type type, co
void rt_object_detach(rt_object_t object); void rt_object_detach(rt_object_t object);
rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name); rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name);
void rt_object_delete(rt_object_t object); void rt_object_delete(rt_object_t object);
rt_err_t rt_object_is_systemobject(rt_object_t object); rt_bool_t rt_object_is_systemobject(rt_object_t object);
rt_object_t rt_object_find(const char *name, rt_uint8_t type); rt_object_t rt_object_find(const char *name, rt_uint8_t type);
#ifdef RT_USING_HOOK #ifdef RT_USING_HOOK

View File

@ -97,7 +97,7 @@ void rt_thread_idle_excute(void)
thread->cleanup(thread); thread->cleanup(thread);
/* if it's a system object, not delete it */ /* if it's a system object, not delete it */
if (rt_object_is_systemobject((rt_object_t)thread) == RT_EOK) if (rt_object_is_systemobject((rt_object_t)thread) == RT_TRUE)
{ {
/* enable interrupt */ /* enable interrupt */
rt_hw_interrupt_enable(lock); rt_hw_interrupt_enable(lock);

View File

@ -919,7 +919,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_thread_detach((rt_thread_t)object); rt_thread_detach((rt_thread_t)object);
@ -937,7 +937,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_sem_detach((rt_sem_t)object); rt_sem_detach((rt_sem_t)object);
@ -956,7 +956,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_mutex_detach((rt_mutex_t)object); rt_mutex_detach((rt_mutex_t)object);
@ -975,7 +975,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_event_detach((rt_event_t)object); rt_event_detach((rt_event_t)object);
@ -994,7 +994,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_mb_detach((rt_mailbox_t)object); rt_mb_detach((rt_mailbox_t)object);
@ -1013,7 +1013,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_mq_detach((rt_mq_t)object); rt_mq_detach((rt_mq_t)object);
@ -1032,7 +1032,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_mp_detach((rt_mp_t)object); rt_mp_detach((rt_mp_t)object);
@ -1060,7 +1060,7 @@ rt_err_t rt_module_unload(rt_module_t module)
while (list->next != list) while (list->next != list)
{ {
object = rt_list_entry(list->next, struct rt_object, list); object = rt_list_entry(list->next, struct rt_object, list);
if (rt_object_is_systemobject(object) == RT_EOK) if (rt_object_is_systemobject(object) == RT_TRUE)
{ {
/* detach static object */ /* detach static object */
rt_timer_detach((rt_timer_t)object); rt_timer_detach((rt_timer_t)object);

View File

@ -356,17 +356,17 @@ void rt_object_delete(rt_object_t object)
* *
* @param object the specified object to be judged. * @param object the specified object to be judged.
* *
* @return RT_EOK if a system object, RT_ERROR for others. * @return RT_TRUE if a system object, RT_FALSE for others.
*/ */
rt_err_t rt_object_is_systemobject(rt_object_t object) rt_bool_t rt_object_is_systemobject(rt_object_t object)
{ {
/* object check */ /* object check */
RT_ASSERT(object != RT_NULL); RT_ASSERT(object != RT_NULL);
if (object->type & RT_Object_Class_Static) if (object->type & RT_Object_Class_Static)
return RT_EOK; return RT_TRUE;
return -RT_ERROR; return RT_FALSE;
} }
/** /**

View File

@ -53,7 +53,7 @@ static void rt_thread_exit(void)
rt_list_remove(&(thread->thread_timer.list)); rt_list_remove(&(thread->thread_timer.list));
rt_object_detach((rt_object_t)&(thread->thread_timer)); rt_object_detach((rt_object_t)&(thread->thread_timer));
if ((rt_object_is_systemobject((rt_object_t)thread) == RT_EOK) && if ((rt_object_is_systemobject((rt_object_t)thread) == RT_TRUE) &&
thread->cleanup == RT_NULL) thread->cleanup == RT_NULL)
{ {
rt_object_detach((rt_object_t)thread); rt_object_detach((rt_object_t)thread);