Skip to content

Commit

Permalink
Replace 0 with NULL because struct pointer is set NULL in.
Browse files Browse the repository at this point in the history
  • Loading branch information
suzukaze committed Jul 14, 2013
1 parent 56a3952 commit 65736fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mrb_pool_open(mrb_state *mrb)

if (pool) {
pool->mrb = mrb;
pool->pages = 0;
pool->pages = NULL;
}

return pool;
Expand Down Expand Up @@ -96,7 +96,7 @@ mrb_pool_alloc(mrb_pool *pool, size_t len)
struct mrb_pool_page *page;
size_t n;

if (!pool) return 0;
if (!pool) return NULL;
len += ALIGN_PADDING(len);
page = pool->pages;
while (page) {
Expand All @@ -109,7 +109,7 @@ mrb_pool_alloc(mrb_pool *pool, size_t len)
page = page->next;
}
page = page_alloc(pool, len);
if (!page) return 0;
if (!page) return NULL;
page->offset = len;
page->next = pool->pages;
pool->pages = page;
Expand Down Expand Up @@ -145,7 +145,7 @@ mrb_pool_realloc(mrb_pool *pool, void *p, size_t oldlen, size_t newlen)
struct mrb_pool_page *page;
void *np;

if (!pool) return 0;
if (!pool) return NULL;
oldlen += ALIGN_PADDING(oldlen);
newlen += ALIGN_PADDING(newlen);
page = pool->pages;
Expand Down Expand Up @@ -177,7 +177,7 @@ main(void)
mrb_pool *pool;
void *p;

pool = mrb_pool_open(0);
pool = mrb_pool_open(NULL);
p = mrb_pool_alloc(pool, len);
for (i=1; i<20; i++) {
printf("%p (len=%d) %d\n", p, len, mrb_pool_can_realloc(pool, p, len*2));
Expand Down

0 comments on commit 65736fa

Please sign in to comment.