summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/ipc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 4a6244ac3b..329fc7f4cf 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -1797,7 +1797,7 @@ rt_err_t rt_mb_init(rt_mailbox_t mb,
/* initialize mailbox */
mb->msg_pool = (rt_ubase_t *)msgpool;
- mb->size = size;
+ mb->size = (rt_uint16_t)size;
mb->entry = 0;
mb->in_offset = 0;
mb->out_offset = 0;
@@ -1899,7 +1899,7 @@ rt_mailbox_t rt_mb_create(const char *name, rt_size_t size, rt_uint8_t flag)
_ipc_object_init(&(mb->parent));
/* initialize mailbox */
- mb->size = size;
+ mb->size = (rt_uint16_t)size;
mb->msg_pool = (rt_ubase_t *)RT_KERNEL_MALLOC(mb->size * sizeof(rt_ubase_t));
if (mb->msg_pool == RT_NULL)
{
@@ -2511,7 +2511,7 @@ rt_err_t rt_mq_init(rt_mq_t mq,
/* get correct message size */
mq->msg_size = RT_ALIGN(msg_size, RT_ALIGN_SIZE);
- mq->max_msgs = pool_size / (mq->msg_size + sizeof(struct rt_mq_message));
+ mq->max_msgs = (rt_uint16_t)(pool_size / (mq->msg_size + sizeof(struct rt_mq_message)));
/* initialize message list */
mq->msg_queue_head = RT_NULL;
@@ -2636,7 +2636,7 @@ rt_mq_t rt_mq_create(const char *name,
/* get correct message size */
mq->msg_size = RT_ALIGN(msg_size, RT_ALIGN_SIZE);
- mq->max_msgs = max_msgs;
+ mq->max_msgs = (rt_uint16_t)max_msgs;
/* allocate message pool */
mq->msg_pool = RT_KERNEL_MALLOC((mq->msg_size + sizeof(struct rt_mq_message)) * mq->max_msgs);