[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Revert to using zlib-provided compress bound

From: Peter Samuelson <peter_at_p12n.org>
Date: Fri, 6 Aug 2010 15:51:00 -0500

[Michael Spang]
> This reverts to using the zlib-provided version, since the old version
> of zlib that was missing this function should be quite rare these
> days.

Maybe I'm just old ... but I bet there's still some zlib 1.1.4
out there. Maybe do the following instead? (Untested.)

[[[
* subversion/libsvn_delta/svndiff.c
  (svnCompressBound): Use zlib compressBound() if available.
]]]

Index: libsvn_delta/svndiff.c
===================================================================
--- subversion/libsvn_delta/svndiff.c (revisione 980368)
+++ subversion/libsvn_delta/svndiff.c (copia locale)
@@ -31,10 +31,12 @@
 #include "svn_private_config.h"
 #include <zlib.h>

-/* This macro is taken from zlib, and was originally the function
- compressBound. It shouldn't ever change, but once every millenium,
- it may be useful for someone to make sure. */
+/* The zlib compressBound function was not exported until 1.2.0. */
+#if ZLIB_VERNUM >= 0x1200
+#define svnCompressBound(LEN) compressBound(LEN)
+#else
 #define svnCompressBound(LEN) ((LEN) + ((LEN) >> 12) + ((LEN) >> 14) + 11)
+#endif

 /* For svndiff1, address/instruction/new data under this size will not
    be compressed using zlib as a secondary compressor. */
Received on 2010-08-06 22:50:37 CEST

This is an archived mail posted to the Subversion Dev mailing list.