From 3363586cbbf507937a6be74397f4ffd5c6966fe5 Mon Sep 17 00:00:00 2001 From: dongly Date: Wed, 3 Aug 2022 00:09:49 +0800 Subject: Fix some compilation warning (#5744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix some compilation warning * 补充修正一些数据类型的使用错误 Co-authored-by: Meco Man <920369182@qq.com> --- src/kservice.c | 2 +- src/mem.c | 6 +++++- src/timer.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/kservice.c b/src/kservice.c index dfa0da9cd6..1704f9d600 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -287,7 +287,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count) char *src_ptr = (char *)src; long *aligned_dst; long *aligned_src; - int len = count; + rt_ubase_t len = count; /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */ diff --git a/src/mem.c b/src/mem.c index 307391cac1..14593bcfd7 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2021, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -290,10 +290,14 @@ void *rt_smem_alloc(rt_smem_t m, rt_size_t size) RT_ASSERT(rt_object_is_systemobject(&m->parent)); if (size != RT_ALIGN(size, RT_ALIGN_SIZE)) + { RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d, but align to %d\n", size, RT_ALIGN(size, RT_ALIGN_SIZE))); + } else + { RT_DEBUG_LOG(RT_DEBUG_MEM, ("malloc size %d\n", size)); + } small_mem = (struct rt_small_mem *)m; /* alignment size */ diff --git a/src/timer.c b/src/timer.c index 82caec8ecb..ce11bf3518 100644 --- a/src/timer.c +++ b/src/timer.c @@ -832,7 +832,7 @@ static void _timer_thread_entry(void *parameter) */ void rt_system_timer_init(void) { - int i; + rt_size_t i; for (i = 0; i < sizeof(_timer_list) / sizeof(_timer_list[0]); i++) { -- cgit v1.3.1