瀏覽代碼

[src]消除参数传递警告(warning: passing argument 1 of 'zoneindex' from incompatible pointer type [-Wincompatible-pointer-types])

liruncong 6 年之前
父節點
當前提交
39673cf4f6
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/slab.c

+ 2 - 2
src/slab.c

@@ -398,10 +398,10 @@ void rt_system_heap_init(void *begin_addr, void *end_addr)
  * Calculate the zone index for the allocation request size and set the
  * Calculate the zone index for the allocation request size and set the
  * allocation request size to that particular zone's chunk size.
  * allocation request size to that particular zone's chunk size.
  */
  */
-rt_inline int zoneindex(rt_uint32_t *bytes)
+rt_inline int zoneindex(rt_size_t *bytes)
 {
 {
     /* unsigned for shift opt */
     /* unsigned for shift opt */
-    rt_uint32_t n = (rt_uint32_t) * bytes;
+    rt_uint32_t n = (rt_uint32_t)(*bytes);
 
 
     if (n < 128)
     if (n < 128)
     {
     {