summaryrefslogtreecommitdiff
path: root/components/drivers/ipc/ringbuffer.c
diff options
context:
space:
mode:
authorTangyuxin <[email protected]>2022-09-20 22:31:11 +0800
committerGitHub <[email protected]>2022-09-20 10:31:11 -0400
commita4829b1c004015cca489679cc335b6089aa9da31 (patch)
tree3e346e76bb1c77b5b189ca28b053daeaea5154e9 /components/drivers/ipc/ringbuffer.c
parent746d7a01bdb29c692b696780f938f11253ae1103 (diff)
[fix] Fix simulator compilation warnings (#6438)
* [fix] Fix simulator compilation warnings * Update bsp/simulator/rtconfig_project.h Co-authored-by: Man, Jianting (Meco) <[email protected]>
Diffstat (limited to 'components/drivers/ipc/ringbuffer.c')
-rw-r--r--components/drivers/ipc/ringbuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/ipc/ringbuffer.c b/components/drivers/ipc/ringbuffer.c
index fc9e15f996..90632f5884 100644
--- a/components/drivers/ipc/ringbuffer.c
+++ b/components/drivers/ipc/ringbuffer.c
@@ -192,7 +192,7 @@ rt_size_t rt_ringbuffer_get(struct rt_ringbuffer *rb,
/* less data */
if (size < length)
- length = size;
+ length = (rt_uint16_t)size;
if (rb->buffer_size - rb->read_index > length)
{
@@ -248,7 +248,7 @@ rt_size_t rt_ringbuffer_peek(struct rt_ringbuffer *rb, rt_uint8_t **ptr)
if ((rt_size_t)(rb->buffer_size - rb->read_index) > size)
{
- rb->read_index += size;
+ rb->read_index += (rt_uint16_t)size;
return size;
}