Author: stefan2
Date: Mon May  9 16:28:16 2011
New Revision: 1101091

URL: http://svn.apache.org/viewvc?rev=1101091&view=rev
Log:
Fix a number of conversion and formatting issues.

* subversion/libsvn_subr/cache-membuffer.c
  (MIN_SEGMENT_SIZE): ensure that cache sizes > 4GB work
  (svn_cache__membuffer_cache_create): formatting fixes; add missing cast

Modified:
    subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1101091&r1=1101090&r2=1101091&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Mon May  9 
16:28:16 2011
@@ -115,7 +115,7 @@
 /* Don't create cache segments smaller than this value unless the total
  * cache size itself is smaller.
  */
-#define MIN_SEGMENT_SIZE 0x2000000
+#define MIN_SEGMENT_SIZE 0x2000000ull
 
 /* Invalid index reference value. Equivalent to APR_UINT32_T(-1)
  */
@@ -925,13 +925,13 @@ svn_cache__membuffer_cache_create(svn_me
    * Segments should not be smaller than 32MB and max. cachable item
    * size should grow as fast as segmentation.
    */
-  while ((2 * MIN_SEGMENT_SIZE << (2 * segment_count_shift)) < total_size)
+  while (((2 * MIN_SEGMENT_SIZE) << (2 * segment_count_shift)) < total_size)
     ++segment_count_shift;
 
   segment_count = 1 << segment_count_shift;
 
   /* allocate cache as an array of segments / cache objects */
-  c = apr_palloc(pool, segment_count * sizeof(*c));
+  c = (svn_membuffer_t *)apr_palloc(pool, segment_count * sizeof(*c));
 
   /* Split total cache size into segments of equal size
    */
@@ -966,7 +966,7 @@ svn_cache__membuffer_cache_create(svn_me
       directory_size = group_count * sizeof(entry_group_t);
     }
 
-    for (seg = 0; seg < segment_count; ++seg)
+  for (seg = 0; seg < segment_count; ++seg)
     {
       /* allocate buffers and initialize cache members
        */


Reply via email to