summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-02-12 14:33:45 +0800
committerBernard Xiong <[email protected]>2019-02-12 14:33:45 +0800
commit7383269905417f9e4f8f5304e164e0ae31d7169a (patch)
tree31ad9f66b3188d3911b16a92c7cb54675cc6bc63 /src
parentf182626681adbe9e10c64e38bf06cef804312b2d (diff)
[Kernel] Code cleanup for compiling warning.
Diffstat (limited to 'src')
-rw-r--r--src/kservice.c2
-rw-r--r--src/mem.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/kservice.c b/src/kservice.c
index dc7370d58b..b640107a33 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -476,7 +476,7 @@ rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen)
{
const char *sc;
- for (sc = s; *sc != '\0' && sc - s < maxlen; ++sc) /* nothing */
+ for (sc = s; *sc != '\0' && sc - s < (int)maxlen; ++sc) /* nothing */
;
return sc - s;
diff --git a/src/mem.c b/src/mem.c
index ca5329404e..8099b6bb7e 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -644,7 +644,7 @@ int memcheck(void)
{
position = (rt_ubase_t)mem - (rt_ubase_t)heap_ptr;
if (position < 0) goto __exit;
- if (position > mem_size_aligned) goto __exit;
+ if (position > (int)mem_size_aligned) goto __exit;
if (mem->magic != HEAP_MAGIC) goto __exit;
if (mem->used != 0 && mem->used != 1) goto __exit;
}