You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@attglobal.net> on 2001/12/08 14:18:56 UTC
type of input buffer to apr_bucket_foo_create()
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).
--
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: type of input buffer to apr_bucket_foo_create()
Posted by Jeff Trawick <tr...@attglobal.net>.
Cliff Woolley <cl...@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:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: type of input buffer to apr_bucket_foo_create()
Posted by Cliff Woolley <cl...@yahoo.com>.
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. Is that
what we want? I'm not sure. Maybe it is...
--Cliff
--------------------------------------------------------------
Cliff Woolley
cliffwoolley@yahoo.com
Charlottesville, VA