diff src/dynarr.c @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 3d6bfa290dbd
children 8626e4521993
line wrap: on
line diff
--- a/src/dynarr.c	Mon Aug 13 10:27:41 2007 +0200
+++ b/src/dynarr.c	Mon Aug 13 10:28:48 2007 +0200
@@ -133,7 +133,7 @@
     multiplier = 1.5;
 
   for (newsize = dy->max; newsize < size;)
-    newsize = max (Dynarr_min_size, multiplier * newsize);
+    newsize = max (Dynarr_min_size, (int) (multiplier * newsize));
 
   /* Don't do anything if the array is already big enough. */
   if (newsize > dy->max)
@@ -201,10 +201,10 @@
    what was requested of it is returned in MALLOC_OVERHEAD in STATS.
    See the comment above the definition of this structure. */
 
-int
+size_t
 Dynarr_memory_usage (void *d, struct overhead_stats *stats)
 {
-  int total = 0;
+  size_t total = 0;
   Dynarr *dy = (Dynarr *) d;
 
   /* We have to be a bit tricky here because not all of the
@@ -213,8 +213,8 @@
 
   if (dy->base)
     {
-      int malloc_used = malloced_storage_size (dy->base,
-					       dy->elsize * dy->max, 0);
+      size_t malloc_used = malloced_storage_size (dy->base,
+						  dy->elsize * dy->max, 0);
       /* #### This may or may not be correct.  Some Dynarrs would
 	 prefer that we use dy->cur instead of dy->largest here. */
       int was_requested = dy->elsize * dy->largest;