Fixed return type of internal function that allocates radix tree nodes.

This commit is contained in:
Ruslan Ermilov 2012-12-20 11:16:03 +00:00
parent 48613efacc
commit 86dd001ebf

View file

@ -9,7 +9,7 @@
#include <ngx_core.h> #include <ngx_core.h>
static void *ngx_radix_alloc(ngx_radix_tree_t *tree); static ngx_radix_node_t *ngx_radix_alloc(ngx_radix_tree_t *tree);
ngx_radix_tree_t * ngx_radix_tree_t *
@ -263,13 +263,13 @@ ngx_radix32tree_find(ngx_radix_tree_t *tree, uint32_t key)
} }
static void * static ngx_radix_node_t *
ngx_radix_alloc(ngx_radix_tree_t *tree) ngx_radix_alloc(ngx_radix_tree_t *tree)
{ {
char *p; ngx_radix_node_t *p;
if (tree->free) { if (tree->free) {
p = (char *) tree->free; p = tree->free;
tree->free = tree->free->right; tree->free = tree->free->right;
return p; return p;
} }
@ -283,7 +283,7 @@ ngx_radix_alloc(ngx_radix_tree_t *tree)
tree->size = ngx_pagesize; tree->size = ngx_pagesize;
} }
p = tree->start; p = (ngx_radix_node_t *) tree->start;
tree->start += sizeof(ngx_radix_node_t); tree->start += sizeof(ngx_radix_node_t);
tree->size -= sizeof(ngx_radix_node_t); tree->size -= sizeof(ngx_radix_node_t);