fix kernel and framework no cast type error

This commit is contained in:
tyustli
2019-06-18 20:09:19 +08:00
parent 34059c40c4
commit d8eb0cfc1e
21 changed files with 92 additions and 90 deletions
+5 -5
View File
@@ -1308,7 +1308,7 @@ rt_err_t rt_mb_init(rt_mailbox_t mb,
rt_ipc_object_init(&(mb->parent));
/* init mailbox */
mb->msg_pool = msgpool;
mb->msg_pool = (rt_ubase_t *)msgpool;
mb->size = size;
mb->entry = 0;
mb->in_offset = 0;
@@ -1376,7 +1376,7 @@ rt_mailbox_t rt_mb_create(const char *name, rt_size_t size, rt_uint8_t flag)
/* init mailbox */
mb->size = size;
mb->msg_pool = RT_KERNEL_MALLOC(mb->size * sizeof(rt_ubase_t));
mb->msg_pool = (rt_ubase_t *)RT_KERNEL_MALLOC(mb->size * sizeof(rt_ubase_t));
if (mb->msg_pool == RT_NULL)
{
/* delete mailbox object */
@@ -1816,7 +1816,7 @@ rt_err_t rt_mq_init(rt_mq_t mq,
{
head = (struct rt_mq_message *)((rt_uint8_t *)mq->msg_pool +
temp * (mq->msg_size + sizeof(struct rt_mq_message)));
head->next = mq->msg_queue_free;
head->next = (struct rt_mq_message *)mq->msg_queue_free;
mq->msg_queue_free = head;
}
@@ -1909,7 +1909,7 @@ rt_mq_t rt_mq_create(const char *name,
{
head = (struct rt_mq_message *)((rt_uint8_t *)mq->msg_pool +
temp * (mq->msg_size + sizeof(struct rt_mq_message)));
head->next = mq->msg_queue_free;
head->next = (struct rt_mq_message *)mq->msg_queue_free;
mq->msg_queue_free = head;
}
@@ -2093,7 +2093,7 @@ rt_err_t rt_mq_urgent(rt_mq_t mq, void *buffer, rt_size_t size)
temp = rt_hw_interrupt_disable();
/* link msg to the beginning of message queue */
msg->next = mq->msg_queue_head;
msg->next = (struct rt_mq_message *)mq->msg_queue_head;
mq->msg_queue_head = msg;
/* if there is no tail */
+10 -8
View File
@@ -326,7 +326,7 @@ rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_ubase_t count)
const unsigned char *su1, *su2;
int res = 0;
for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
for (su1 = (const unsigned char *)cs, su2 = (const unsigned char *)ct; 0 < count; ++su1, ++su2, count--)
if ((res = *su1 - *su2) != 0)
break;
@@ -1117,14 +1117,14 @@ RTM_EXPORT(rt_console_get_device);
*/
rt_device_t rt_console_set_device(const char *name)
{
rt_device_t new, old;
rt_device_t new_device, old_device;
/* save old device */
old = _console_device;
old_device = _console_device;
/* find new console device */
new = rt_device_find(name);
if (new != RT_NULL)
new_device = rt_device_find(name);
if (new_device != RT_NULL)
{
if (_console_device != RT_NULL)
{
@@ -1133,11 +1133,11 @@ rt_device_t rt_console_set_device(const char *name)
}
/* set new console device */
rt_device_open(new, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM);
_console_device = new;
rt_device_open(new_device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM);
_console_device = new_device;
}
return old;
return old_device;
}
RTM_EXPORT(rt_console_set_device);
#endif
@@ -1332,7 +1332,9 @@ int __rt_ffs(int value)
#ifdef RT_DEBUG
/* RT_ASSERT(EX)'s hook */
void (*rt_assert_hook)(const char *ex, const char *func, rt_size_t line);
/**
* This function will set a hook function to RT_ASSERT(EX). It will run when the expression is false.
*
+1 -1
View File
@@ -141,7 +141,7 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
(void *)rt_thread_exit);
#else
thread->sp = (void *)rt_hw_stack_init(thread->entry, thread->parameter,
(void *)((char *)thread->stack_addr + thread->stack_size - sizeof(rt_ubase_t)),
(rt_uint8_t *)((char *)thread->stack_addr + thread->stack_size - sizeof(rt_ubase_t)),
(void *)rt_thread_exit);
#endif