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

Re: Compile error in ra_svn was Re: 1.0.2 build error on AIX 4.3.2, 4.3.3, 5.1, 5.2

From: Albert Chin <subversion-dev_at_mlists.thewrittenword.com>
Date: 2004-05-14 20:32:51 CEST

On Tue, May 04, 2004 at 03:22:04PM -0400, Greg Hudson wrote:
> On Tue, 2004-05-04 at 14:42, Justin Erenkrantz wrote:
> > FWIW, I get the same error with Sun's C compiler. And, I have the same
> > patch applied locally as well. However, I think we brought this up before
> > and GregH didn't seem overly enthusiastic for anyone to commit it.
>
> I thought this was taken care of in r8343. I guess not.
>
> At any rate, I'd appreciate if people would put a little more effort
> into getting the variable declarations right rather than just bashing
> stuff with casts. Let me know if this patch works:

Your patch works. I also had to apply the following patch to work
around the same issue. This patch simply works around the issue
though. read_handler_gz() should be of type svn_read_fn_t which is:
  typedef svn_error_t *(*svn_read_fn_t) (void *baton,
                                         char *buffer,
                                         apr_size_t *len);

Should *all* functions that are of type svn_error_t accept 'unsigned
char' as the second argument? Ditto for write_handler_gz() and:
  typedef svn_error_t *(*svn_write_fn_t) (void *baton,
                                          const char *data,
                                          apr_size_t *len);

--- subversion/libsvn_subr/stream.c.orig Fri May 14 12:48:05 2004
+++ subversion/libsvn_subr/stream.c Fri May 14 12:48:28 2004
@@ -385,7 +385,7 @@
 
 /* Handle reading from a compressed stream */
 static svn_error_t *
-read_handler_gz (void *baton, char *buffer, apr_size_t *len)
+read_handler_gz (void *baton, unsigned char *buffer, apr_size_t *len)
 {
   struct zbaton *btn = baton;
   int zerr;
@@ -433,7 +433,7 @@
 
 /* Compress data and write it to the substream */
 static svn_error_t *
-write_handler_gz (void *baton, const char *buffer, apr_size_t *len)
+write_handler_gz (void *baton, const unsigned char *buffer, apr_size_t *len)
 {
   struct zbaton *btn = baton;
   apr_pool_t *subpool;
@@ -458,7 +458,7 @@
   subpool = svn_pool_create (btn->pool);
   write_buf = apr_palloc (subpool, buf_size);
   
- btn->out->next_in = (char *) buffer;
+ btn->out->next_in = (unsigned char *) buffer;
   btn->out->avail_in = *len;
   
   while (btn->out->avail_in > 0)

-- 
albert chin (china@thewrittenword.com)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 14 20:33:07 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.