apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: [PATCH] Remove unnecessary casting away of "const"
Date Tue, 16 Nov 2004 09:58:34 GMT
On Tue, 16 Nov 2004 07:02:47 +0000, Joe Orton <jorton@redhat.com> wrote:
> On Mon, Nov 15, 2004 at 11:09:40PM +0000, Julian Foad wrote:
> > Remove unnecessary type casts that were casting away "const".
> > No functional change.
> 
> These ones aren't unnecessary, some compilers are more picky about
> implicit signed char * -> unsigned char * conversion, so this will
> introduce warnings (or possibly errors) with some compilers.
> 
> > * apr-util/crypto/apr_md5.c
> >   (apr_md5_encode): Remove some type casts.
> >
> > Index: apr-util/crypto/apr_md5.c
> > ===================================================================
> > --- apr-util/crypto/apr_md5.c (revision 65585)
> > +++ apr-util/crypto/apr_md5.c (working copy)
> > @@ -536,25 +536,25 @@ APU_DECLARE(apr_status_t) apr_md5_encode
> >      /*
> >       * The password first, since that is what is most unknown
> >       */
> > -    apr_md5_update(&ctx, (unsigned char *)pw, strlen(pw));
> > +    apr_md5_update(&ctx, pw, strlen(pw));

except that apr_md5_update was changed to accept "const void *" and
handle required char signed-ness internally to avoid bothering callers
with this sort of nonsense; the missing piece seems to be to remove
those casts; ACK?

APU_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
                                         const void *_input,
                                         apr_size_t inputLen)
{
    const unsigned char *input = _input;

http://cvs.apache.org/viewcvs.cgi/apr-util/crypto/apr_md5.c?r1=1.3&r2=1.4&diff_format=h

Mime
View raw message