|
@@ -331,7 +331,9 @@ void rt_object_init(struct rt_object *object,
|
|
const char *name)
|
|
const char *name)
|
|
{
|
|
{
|
|
rt_base_t level;
|
|
rt_base_t level;
|
|
|
|
+#ifdef RT_DEBUG
|
|
struct rt_list_node *node = RT_NULL;
|
|
struct rt_list_node *node = RT_NULL;
|
|
|
|
+#endif
|
|
struct rt_object_information *information;
|
|
struct rt_object_information *information;
|
|
#ifdef RT_USING_MODULE
|
|
#ifdef RT_USING_MODULE
|
|
struct rt_dlmodule *module = dlmodule_self();
|
|
struct rt_dlmodule *module = dlmodule_self();
|
|
@@ -341,6 +343,7 @@ void rt_object_init(struct rt_object *object,
|
|
information = rt_object_get_information(type);
|
|
information = rt_object_get_information(type);
|
|
RT_ASSERT(information != RT_NULL);
|
|
RT_ASSERT(information != RT_NULL);
|
|
|
|
|
|
|
|
+#ifdef RT_DEBUG
|
|
/* check object type to avoid re-initialization */
|
|
/* check object type to avoid re-initialization */
|
|
|
|
|
|
/* enter critical */
|
|
/* enter critical */
|
|
@@ -353,13 +356,11 @@ void rt_object_init(struct rt_object *object,
|
|
struct rt_object *obj;
|
|
struct rt_object *obj;
|
|
|
|
|
|
obj = rt_list_entry(node, struct rt_object, list);
|
|
obj = rt_list_entry(node, struct rt_object, list);
|
|
- if (obj) /* skip warning when disable debug */
|
|
|
|
- {
|
|
|
|
- RT_ASSERT(obj != object);
|
|
|
|
- }
|
|
|
|
|
|
+ RT_ASSERT(obj != object);
|
|
}
|
|
}
|
|
/* leave critical */
|
|
/* leave critical */
|
|
rt_exit_critical();
|
|
rt_exit_critical();
|
|
|
|
+#endif
|
|
|
|
|
|
/* initialize object's parameters */
|
|
/* initialize object's parameters */
|
|
/* set object type to static */
|
|
/* set object type to static */
|