apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: type of input buffer to apr_bucket_foo_create()
Date Sun, 09 Dec 2001 02:48:49 GMT
Cliff Woolley <cliffwoolley@yahoo.com> writes:

> On 8 Dec 2001, Jeff Trawick wrote:
> > Why isn't it const void * instead of const char *? I'm trying to pass
> > unsigned char * into apr_bucket_foo_create() and I have to cast. It
> > seems so clear that it should be const void * (but maybe I need more
> > caffeine).
> If that changes, apr_bucket_read() would have to change, too.  

The problem with linking the types of the two together is the thing
with C and **.  Practically every caller of apr_bucket_read() would
end up needing to cast (and possibly mishandle the const-ness in
doing so).  That is massive suckage.

AFAICT, the least pain for API users is for apr_bucket_read() to
remain the same and for apr_bucket_foo_create() to take void *.

I don't have any other rationalization for the discrepancy (const void
* vs. const char **) :) 

Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
             Born in Roswell... married an alien...

View raw message