From 30e19c78bdb4c33a7953651ea564f89792ec10dd Mon Sep 17 00:00:00 2001 From: Liangfu Chen Date: Thu, 26 Mar 2020 17:51:57 +0800 Subject: [PATCH] lint Change-Id: Ibf3c06619ef296df5c49f3945cb6428777781d69 --- src/runtime/crt/memory.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/runtime/crt/memory.c b/src/runtime/crt/memory.c index d73a662491076..fc5917dca9aea 100644 --- a/src/runtime/crt/memory.c +++ b/src/runtime/crt/memory.c @@ -28,6 +28,8 @@ #include #include +#include + /*! Number of bits in a page */ #define TVM_CRT_PAGE_BITS (TVM_CRT_PAGE_BYTES << 3) @@ -223,8 +225,8 @@ void* MemoryManager_Alloc(MemoryManager * mgr, tvm_index_t size) { } else { PageTable * ptable = &(mgr->ptable); start = ptable->count; - CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize), - "insufficient memory, start=%ld, npage=%ld, total=%ld", + CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize), + "insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "", start, npage, start + npage); /* insert page entry */ Page p = PageCreate(start, npage); @@ -274,8 +276,8 @@ void* MemoryManager_Realloc(MemoryManager * mgr, void * ptr, tvm_index_t size) { free_map->erase(free_map, it); } else { start = ptable->count; - CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize), - "insufficient memory, start=%ld, npage=%ld, total=%ld", + CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize), + "insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "", start, npage, start + npage); Page p = PageCreate(start, npage); ptable->resize(ptable, start + npage, &p); @@ -300,8 +302,8 @@ void* MemoryManager_Realloc(MemoryManager * mgr, void * ptr, tvm_index_t size) { } else { PageTable * ptable = &(mgr->ptable); start = ptable->count; - CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize), - "insufficient memory, start=%ld, npage=%ld, total=%ld", + CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize), + "insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "", start, npage, start + npage); /* insert page entry */ Page p = PageCreate(start, npage);