Skip to content

Commit

Permalink
apr_pools: make index(es) an apr_size_t everywhere.
Browse files Browse the repository at this point in the history
Avoids "conversion from 'size_t' to 'apr_uint32_t', possible loss" warnings.



git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1822357 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ylavic committed Jan 26, 2018
1 parent 8c3e7fa commit 3d61931
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions memory/unix/apr_pools.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)

APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
{
apr_uint32_t index;
apr_size_t index;
apr_memnode_t *node, **ref;

for (index = 0; index <= MAX_INDEX; index++) {
Expand Down Expand Up @@ -235,7 +235,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
apr_size_t in_size)
{
apr_uint32_t max_free_index;
apr_size_t max_free_index;
apr_size_t size = in_size;

allocator_lock(allocator);
Expand Down Expand Up @@ -280,7 +280,7 @@ static APR_INLINE
apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size)
{
apr_memnode_t *node, **ref;
apr_uint32_t max_index, upper_index;
apr_size_t max_index, upper_index;
apr_size_t size, i, index;

/* Round up the block size to the next boundary, but always
Expand Down Expand Up @@ -341,7 +341,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size)
ref--;
max_index--;
}
while (*ref == NULL && max_index > 0);
while (*ref == NULL && max_index);

allocator->max_index = max_index;
}
Expand Down Expand Up @@ -423,8 +423,8 @@ static APR_INLINE
void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
{
apr_memnode_t *next, *freelist = NULL;
apr_uint32_t index, max_index;
apr_uint32_t max_free_index, current_free_index;
apr_size_t index, max_index;
apr_size_t max_free_index, current_free_index;

allocator_lock(allocator);

Expand Down Expand Up @@ -554,7 +554,7 @@ typedef struct debug_node_t debug_node_t;

struct debug_node_t {
debug_node_t *next;
apr_uint32_t index;
apr_size_t index;
void *beginp[64];
void *endp[64];
};
Expand Down Expand Up @@ -1848,7 +1848,7 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size,
static void pool_clear_debug(apr_pool_t *pool, const char *file_line)
{
debug_node_t *node;
apr_uint32_t index;
apr_size_t index;

/* Run pre destroy cleanups */
run_cleanups(&pool->pre_cleanups);
Expand Down Expand Up @@ -2265,7 +2265,7 @@ static int pool_find(apr_pool_t *pool, void *data)
{
void **pmem = (void **)data;
debug_node_t *node;
apr_uint32_t index;
apr_size_t index;

node = pool->nodes;

Expand Down Expand Up @@ -2298,7 +2298,7 @@ static int pool_num_bytes(apr_pool_t *pool, void *data)
{
apr_size_t *psize = (apr_size_t *)data;
debug_node_t *node;
apr_uint32_t index;
apr_size_t index;

node = pool->nodes;

Expand Down

0 comments on commit 3d61931

Please sign in to comment.