From f19d8aa591a4f92054d7fd1af063483f07175a64 Mon Sep 17 00:00:00 2001 From: "dzzxzz@gmail.com" Date: Sat, 2 Jun 2012 09:20:19 +0000 Subject: [PATCH] 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 --- include/rtthread.h | 2 +- src/idle.c | 2 +- src/module.c | 16 ++++++++-------- src/object.c | 8 ++++---- src/thread.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/rtthread.h b/include/rtthread.h index d37534218..d7b096260 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -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); rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name); 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); #ifdef RT_USING_HOOK diff --git a/src/idle.c b/src/idle.c index 96b743ad9..372461bce 100644 --- a/src/idle.c +++ b/src/idle.c @@ -97,7 +97,7 @@ void rt_thread_idle_excute(void) thread->cleanup(thread); /* 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 */ rt_hw_interrupt_enable(lock); diff --git a/src/module.c b/src/module.c index 71929b446..ab1095a63 100644 --- a/src/module.c +++ b/src/module.c @@ -919,7 +919,7 @@ rt_err_t rt_module_unload(rt_module_t module) while (list->next != 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 */ 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) { 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 */ 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) { 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 */ 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) { 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 */ 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) { 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 */ 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) { 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 */ 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) { 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 */ 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) { 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 */ rt_timer_detach((rt_timer_t)object); diff --git a/src/object.c b/src/object.c index f94ba5d40..7dcbf5996 100644 --- a/src/object.c +++ b/src/object.c @@ -356,17 +356,17 @@ void rt_object_delete(rt_object_t object) * * @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 */ RT_ASSERT(object != RT_NULL); if (object->type & RT_Object_Class_Static) - return RT_EOK; + return RT_TRUE; - return -RT_ERROR; + return RT_FALSE; } /** diff --git a/src/thread.c b/src/thread.c index b964099a7..a2adee0c7 100644 --- a/src/thread.c +++ b/src/thread.c @@ -53,7 +53,7 @@ static void rt_thread_exit(void) rt_list_remove(&(thread->thread_timer.list)); 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) { rt_object_detach((rt_object_t)thread);