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

Re: [PATCH] Fix compiler warnings

From: <cmpilato_at_collab.net>
Date: 2003-01-21 21:15:43 CET

Blair Zajac blair@orcaware.com writes:

 cmpilato@collab.net wrote:
  
  Karl Fogel kfogel@newton.ch.collab.net writes:
  
    Perhaps the bigger question is whether to somehow fix the apr_md5_*
    API to take char*'s instead? I'm sort of on the fence here. Before
    starting what will most likely be a painful discussion on dev@apr,
    I'd like to see what you guys (namely Karl since he wrote most of the
    checksum code that uses MD5) think first. What makes more sense?
  
   I have to admit, it makes more sense to me to fix APR. I mean, most
   callers are probably passing signed 'char *' data. If APR's md5 code
   internally needs to treat it as unsigned, for the purpose of the
   digest update algorith, it should just cast.
  
  I disagree. This is a collection of bytes, treated as bytes, not as
  characters. I believe APR's typing choice to be a) more accurate, and
  b) more revealing about the usage for the data. 'char *' looks like
  something that's human-readable -- these digest are not.
 
 Why not use void * then?

Why bother? 'unsigned char' is, as far as I know, the way to
represent 8 bits of data. This has been the case in every piece of
software I've ever worked on.

You wanna change APR? Then make the interface return apr_byte_t *
(which is, of course, unsigned char *).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:04:42 2006

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.