apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Edwards <a...@us.ibm.com>
Subject [PATCH] WIN64: apr_pools.c
Date Wed, 29 Sep 2004 21:35:34 GMT
In order to eliminate the following warnings for Win64 builds the
appended patch is needed. However this changes fields in the apr_memnode_t
structure in apr/include/apr_allocator.h

Seems that this strucure really should be private and moved along
with struct apr_allocator_t to include/arch/unix/apr_arch_allocator.h
but either moving it or changing it may be construed as changing
the 1.0 API. Personally I don't think so but if anyone thinks
otherwise let's discuss.

Allan
-------------------------------
apr_pools.c(154) : warning C4267: '=' : conversion from 'size_t' to 'apr_uint32_t', possible
loss of data
apr_pools.c(183) : warning C4267: '=' : conversion from 'size_t' to 'apr_uint32_t', possible
loss of data
apr_pools.c(621) : warning C4244: '=' : conversion from '__int64' to 'apr_uint32_t', possible
loss of data
apr_pools.c(908) : warning C4244: '=' : conversion from '__int64' to 'apr_uint32_t', possible
loss of data
apr_pools.c(1009) : warning C4244: '=' : conversion from '__int64' to 'apr_uint32_t', possible
loss of data

Index: apr/include/apr_allocator.h
===================================================================
RCS file: /home/cvs/apr/include/apr_allocator.h,v
retrieving revision 1.19
diff -U3 -r1.19 apr_allocator.h
--- apr/include/apr_allocator.h	13 Feb 2004 09:38:28 -0000	1.19
+++ apr/include/apr_allocator.h	29 Sep 2004 20:29:37 -0000
@@ -53,8 +53,8 @@
  struct apr_memnode_t {
      apr_memnode_t *next;            /**< next memnode */
      apr_memnode_t **ref;            /**< reference to self */
-    apr_uint32_t   index;           /**< size */
-    apr_uint32_t   free_index;      /**< how much free */
+    apr_size_t     index;           /**< size */
+    apr_size_t     free_index;      /**< how much free */
      char          *first_avail;     /**< pointer to first free memory */
      char          *endp;            /**< pointer to end of free memory */
  };
Index: apr/memory/unix/apr_pools.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
retrieving revision 1.206
diff -U3 -r1.206 apr_pools.c
--- apr/memory/unix/apr_pools.c	17 Jun 2004 14:13:58 -0000	1.206
+++ apr/memory/unix/apr_pools.c	29 Sep 2004 20:29:37 -0000
@@ -63,9 +63,9 @@
   */

  struct apr_allocator_t {
-    apr_uint32_t        max_index;
-    apr_uint32_t        max_free_index;
-    apr_uint32_t        current_free_index;
+    apr_size_t          max_index;
+    apr_size_t          max_free_index;
+    apr_size_t          current_free_index;
  #if APR_HAS_THREADS
      apr_thread_mutex_t *mutex;
  #endif /* APR_HAS_THREADS */
@@ -141,7 +141,7 @@
  APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
                                               apr_size_t size)
  {
-    apr_uint32_t max_free_index;
+    apr_size_t max_free_index;

  #if APR_HAS_THREADS
      apr_thread_mutex_t *mutex;
@@ -168,7 +168,7 @@
  apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size)
  {
      apr_memnode_t *node, **ref;
-    apr_uint32_t i, index, max_index;
+    apr_size_t i, index, max_index;

      /* Round up the block size to the next boundary, but always
       * allocate at least a certain size (MIN_ALLOC).
@@ -304,8 +304,8 @@
  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)
@@ -582,7 +582,7 @@
  {
      apr_memnode_t *active, *node;
      void *mem;
-    apr_uint32_t free_index;
+    apr_size_t free_index;

      size = APR_ALIGN_DEFAULT(size);
      active = pool->active;
@@ -877,7 +877,7 @@
      apr_size_t cur_len, size;
      char *strp;
      apr_pool_t *pool;
-    apr_uint32_t free_index;
+    apr_size_t free_index;

      pool = ps->pool;
      active = ps->node;
@@ -948,7 +948,7 @@
      char *strp;
      apr_size_t size;
      apr_memnode_t *active, *node;
-    apr_uint32_t free_index;
+    apr_size_t free_index;

      ps.node = active = pool->active;
      ps.pool = pool;



Mime
View raw message