fix compile warning

This commit is contained in:
daishengdong
2019-10-31 15:08:13 +08:00
parent f63d2d4e48
commit 30ea36a7ab
5 changed files with 4 additions and 8 deletions

View File

@@ -21,7 +21,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h>
#include <string.h> #include <string.h>
#define TOS_OFFSET_OF_FIELD(type, field) \ #define TOS_OFFSET_OF_FIELD(type, field) \

View File

@@ -19,6 +19,7 @@
#define _TOS_KTYPES_H_ #define _TOS_KTYPES_H_
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
typedef uint8_t k_prio_t; typedef uint8_t k_prio_t;
typedef uint8_t k_stack_t; typedef uint8_t k_stack_t;

View File

@@ -440,9 +440,9 @@ __DEBUG__ __STATIC_INLINE__ void task_default_walker(k_task_t *task)
tos_kprintln("tsk stat: %s", state_str); tos_kprintln("tsk stat: %s", state_str);
tos_kprintln("stk size: %d", task->stk_size); tos_kprintln("stk size: %d", task->stk_size);
tos_kprintln("stk base: 0x%x", task->stk_base); tos_kprintln("stk base: 0x%p", task->stk_base);
tos_kprintln("stk top : 0x%x", (cpu_addr_t)task->stk_base + task->stk_size); tos_kprintln("stk top : 0x%p", task->stk_base + task->stk_size);
tos_kprintln(""); tos_kprintf("\n");
} }
#endif /* _TOS_TASK_H_ */ #endif /* _TOS_TASK_H_ */

View File

@@ -196,11 +196,9 @@ __API__ k_err_t tos_bin_heap_destroy_dyn(k_bin_heap_t *bin_heap)
TOS_PTR_SANITY_CHECK(bin_heap); TOS_PTR_SANITY_CHECK(bin_heap);
TOS_OBJ_VERIFY(bin_heap, KNL_OBJ_TYPE_BINARY_HEAP); TOS_OBJ_VERIFY(bin_heap, KNL_OBJ_TYPE_BINARY_HEAP);
#if TOS_CFG_MMHEAP_EN > 0u
if (!knl_object_alloc_is_dynamic(&bin_heap->knl_obj)) { if (!knl_object_alloc_is_dynamic(&bin_heap->knl_obj)) {
return K_ERR_OBJ_INVALID_ALLOC_TYPE; return K_ERR_OBJ_INVALID_ALLOC_TYPE;
} }
#endif
tos_mmheap_free(bin_heap->pool); tos_mmheap_free(bin_heap->pool);

View File

@@ -255,11 +255,9 @@ __API__ k_err_t tos_prio_q_destroy_dyn(k_prio_q_t *prio_q)
TOS_PTR_SANITY_CHECK(prio_q); TOS_PTR_SANITY_CHECK(prio_q);
TOS_OBJ_VERIFY(prio_q, KNL_OBJ_TYPE_PRIORITY_QUEUE); TOS_OBJ_VERIFY(prio_q, KNL_OBJ_TYPE_PRIORITY_QUEUE);
#if TOS_CFG_MMHEAP_EN > 0u
if (!knl_object_alloc_is_dynamic(&prio_q->knl_obj)) { if (!knl_object_alloc_is_dynamic(&prio_q->knl_obj)) {
return K_ERR_OBJ_INVALID_ALLOC_TYPE; return K_ERR_OBJ_INVALID_ALLOC_TYPE;
} }
#endif
prio_q_pool_mgr_deinit(&prio_q->pool_mgr); prio_q_pool_mgr_deinit(&prio_q->pool_mgr);
prio_q_prio_mgr_deinit(&prio_q->prio_mgr); prio_q_prio_mgr_deinit(&prio_q->prio_mgr);