summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2018-04-04 16:41:28 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2018-04-04 16:41:28 +0000
commit314b040c089888b15a534d629dc4cc8fa12a1689 (patch)
tree006b09777733730dde79618fa65941d987975b8d
parent413d05f16d328249b17a88d22247b5d5f521f743 (diff)
downloadlibapr-314b040c089888b15a534d629dc4cc8fa12a1689.tar.gz
Merge r1822357 from trunk:
apr_pools: make index(es) an apr_size_t everywhere. Avoids "conversion from 'size_t' to 'apr_uint32_t', possible loss" warnings. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1828361 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--memory/unix/apr_pools.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index b9cdee761..524e9acb4 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -179,7 +179,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++) {
@@ -226,7 +226,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;
#if APR_HAS_THREADS
@@ -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;
+ apr_size_t max_index;
apr_size_t size, i, index;
/* Round up the block size to the next boundary, but always
@@ -338,7 +338,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;
}
@@ -435,8 +435,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;
#if APR_HAS_THREADS
if (allocator->mutex)
@@ -559,7 +559,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];
};
@@ -1814,7 +1814,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);
@@ -2230,7 +2230,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;
@@ -2263,7 +2263,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;