未验证 提交 1f28bd89 编写于 作者: G guo 提交者: GitHub

Merge pull request #5174 from mysterywolf/timewarning

[libc][time] Ensure the data types are consistent
......@@ -244,7 +244,7 @@ rt_size_t rt_ringbuffer_peak(struct rt_ringbuffer *rb, rt_uint8_t **ptr)
*ptr = &rb->buffer_ptr[rb->read_index];
if(rb->buffer_size - rb->read_index > size)
if((rt_size_t)(rb->buffer_size - rb->read_index) > size)
{
rb->read_index += size;
return size;
......
......@@ -240,7 +240,7 @@ RTM_EXPORT(mktime);
char* asctime_r(const struct tm *t, char *buf)
{
/* Checking input validity */
if (rt_strlen(days) <= (t->tm_wday << 2) || rt_strlen(months) <= (t->tm_mon << 2))
if ((int)rt_strlen(days) <= (t->tm_wday << 2) || (int)rt_strlen(months) <= (t->tm_mon << 2))
{
LOG_W("asctime_r: the input parameters exceeded the limit, please check it.");
*(int*) buf = *(int*) days;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册